Skip to content

Commit 1970e2e

Browse files
committed
Fix intermittent CI failures by removing problematic routing test
This removes the test/integration/routing/plugins_test.rb file from Redmine core during CI runs to prevent intermittent failures caused by plugin state pollution. Fixes the 'No route matches' error that occurs when this test runs before other tests and clears plugin routes/menus. Related to Redmine issue: https://www.redmine.org/issues/38707
1 parent 5391261 commit 1970e2e

File tree

4 files changed

+320
-0
lines changed

4 files changed

+320
-0
lines changed

.github/workflows/6_0_7.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ jobs:
9090
working-directory: redmine
9191
run: |
9292
sed -i '/rubocop/d' Gemfile
93+
rm -f test/integration/routing/plugins_test.rb # Fix routing tests # TODO Remove this line when https://www.redmine.org/issues/38707 is fixed
9394
rm -f .rubocop*
9495
cp plugins/redmine_base_rspec/spec/support/database-${{ matrix.db }}.yml config/database.yml
9596

.github/workflows/6_0_7.yml.backup

Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
name: Tests 6.0.7
2+
3+
env:
4+
PLUGIN_NAME: redmine_datetime_custom_field
5+
REDMINE_VERSION: 6.0.7
6+
RAILS_ENV: test
7+
8+
on:
9+
push:
10+
pull_request:
11+
12+
jobs:
13+
test:
14+
name: ${{ github.workflow }} ${{ matrix.db }} ruby-${{ matrix.ruby }}
15+
runs-on: ubuntu-latest
16+
17+
strategy:
18+
matrix:
19+
ruby: ['3.3']
20+
db: ['postgres']
21+
fail-fast: false
22+
23+
services:
24+
postgres:
25+
image: postgres:13
26+
env:
27+
POSTGRES_DB: redmine
28+
POSTGRES_USER: postgres
29+
POSTGRES_PASSWORD: postgres
30+
ports:
31+
- 5432:5432
32+
options: >-
33+
--health-cmd pg_isready
34+
--health-interval 10s
35+
--health-timeout 5s
36+
--health-retries 5
37+
38+
steps:
39+
- name: Checkout Redmine
40+
uses: actions/checkout@v4
41+
with:
42+
repository: redmine/redmine
43+
ref: ${{ env.REDMINE_VERSION }}
44+
path: redmine
45+
46+
- name: Update package archives
47+
run: sudo apt-get update --yes --quiet
48+
49+
- name: Install package dependencies
50+
run: >
51+
sudo apt-get update && sudo apt-get install --yes --quiet
52+
build-essential
53+
cmake
54+
libicu-dev
55+
libpq-dev
56+
ghostscript
57+
gsfonts
58+
59+
- name: Set up chromedriver
60+
uses: nanasess/setup-chromedriver@master
61+
- run: |
62+
export DISPLAY=:99
63+
chromedriver --url-base=/wd/hub &
64+
sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 & # optional
65+
66+
- name: Allow imagemagick to read PDF files
67+
run: |
68+
echo '<policymap>' > policy.xml
69+
echo '<policy domain="coder" rights="read | write" pattern="PDF" />' >> policy.xml
70+
echo '</policymap>' >> policy.xml
71+
sudo rm /etc/ImageMagick-6/policy.xml
72+
sudo mv policy.xml /etc/ImageMagick-6/policy.xml
73+
74+
- name: Setup Ruby
75+
uses: ruby/setup-ruby@v1
76+
with:
77+
ruby-version: ${{ matrix.ruby }}
78+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
79+
80+
- name: Setup Bundler
81+
run: gem install bundler -v '~> 1.0'
82+
83+
- name: Checkout dependencies - Base RSpec plugin
84+
uses: actions/checkout@v4
85+
with:
86+
repository: jbbarth/redmine_base_rspec
87+
path: redmine/plugins/redmine_base_rspec
88+
89+
- name: Prepare Redmine source
90+
working-directory: redmine
91+
run: |
92+
sed -i '/rubocop/d' Gemfile
93+
rm -f .rubocop*
94+
cp plugins/redmine_base_rspec/spec/support/database-${{ matrix.db }}.yml config/database.yml
95+
96+
- name: Install Ruby dependencies
97+
working-directory: redmine
98+
run: |
99+
bundle install --jobs=4 --retry=3 --without development
100+
101+
- name: Generate session store secret
102+
env:
103+
RAILS_ENV: test
104+
working-directory: redmine
105+
run: |
106+
bundle exec rake generate_secret_token
107+
108+
- name: Run Redmine DB and migration tasks
109+
env:
110+
RAILS_ENV: test
111+
working-directory: redmine
112+
run: |
113+
bundle exec rake db:create db:migrate
114+
bundle exec rails test:scm:setup:subversion
115+
116+
- name: Checkout dependencies - Base Deface plugin
117+
uses: actions/checkout@v4
118+
with:
119+
repository: jbbarth/redmine_base_deface
120+
path: redmine/plugins/redmine_base_deface
121+
122+
- name: Checkout dependencies - Base StimulusJS plugin
123+
uses: actions/checkout@v4
124+
with:
125+
repository: nanego/redmine_base_stimulusjs
126+
path: redmine/plugins/redmine_base_stimulusjs
127+
128+
- name: Checkout plugin
129+
uses: actions/checkout@v4
130+
with:
131+
path: redmine/plugins/${{ env.PLUGIN_NAME }}
132+
133+
- name: Install plugins dependencies and run plugins migrations
134+
env:
135+
RAILS_ENV: test
136+
working-directory: redmine
137+
run: |
138+
bundle install --jobs=4 --retry=3 --without development
139+
bundle exec rake redmine:plugins:migrate
140+
# cp -i plugins/*/spec/fixtures/*yml test/fixtures/
141+
bundle exec rails db:fixtures:load
142+
143+
- name: Run core tests
144+
env:
145+
RAILS_ENV: test
146+
working-directory: redmine
147+
run: bundle exec rails test
148+
149+
- name: Run plugin tests
150+
env:
151+
RAILS_ENV: test
152+
working-directory: redmine
153+
run: bundle exec rails redmine:plugins:test NAME=${{ env.PLUGIN_NAME }} RUBYOPT="-W0"
154+
155+
- name: Run uninstall test
156+
env:
157+
RAILS_ENV: test
158+
working-directory: redmine
159+
run: bundle exec rake redmine:plugins:migrate NAME=${{ env.PLUGIN_NAME }} VERSION=0

.github/workflows/master.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ jobs:
9090
working-directory: redmine
9191
run: |
9292
sed -i '/rubocop/d' Gemfile
93+
rm -f test/integration/routing/plugins_test.rb # Fix routing tests # TODO Remove this line when https://www.redmine.org/issues/38707 is fixed
9394
rm -f .rubocop*
9495
cp plugins/redmine_base_rspec/spec/support/database-${{ matrix.db }}.yml config/database.yml
9596
Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
name: Tests master
2+
3+
env:
4+
PLUGIN_NAME: redmine_datetime_custom_field
5+
REDMINE_VERSION: master
6+
RAILS_ENV: test
7+
8+
on:
9+
push:
10+
pull_request:
11+
12+
jobs:
13+
test:
14+
name: ${{ github.workflow }} ${{ matrix.db }} ruby-${{ matrix.ruby }}
15+
runs-on: ubuntu-latest
16+
17+
strategy:
18+
matrix:
19+
ruby: ['3.4']
20+
db: ['postgres']
21+
fail-fast: false
22+
23+
services:
24+
postgres:
25+
image: postgres:13
26+
env:
27+
POSTGRES_DB: redmine
28+
POSTGRES_USER: postgres
29+
POSTGRES_PASSWORD: postgres
30+
ports:
31+
- 5432:5432
32+
options: >-
33+
--health-cmd pg_isready
34+
--health-interval 10s
35+
--health-timeout 5s
36+
--health-retries 5
37+
38+
steps:
39+
- name: Checkout Redmine
40+
uses: actions/checkout@v4
41+
with:
42+
repository: redmine/redmine
43+
ref: ${{ env.REDMINE_VERSION }}
44+
path: redmine
45+
46+
- name: Update package archives
47+
run: sudo apt-get update --yes --quiet
48+
49+
- name: Install package dependencies
50+
run: >
51+
sudo apt-get update && sudo apt-get install --yes --quiet
52+
build-essential
53+
cmake
54+
libicu-dev
55+
libpq-dev
56+
ghostscript
57+
gsfonts
58+
59+
- name: Set up chromedriver
60+
uses: nanasess/setup-chromedriver@master
61+
- run: |
62+
export DISPLAY=:99
63+
chromedriver --url-base=/wd/hub &
64+
sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 & # optional
65+
66+
- name: Allow imagemagick to read PDF files
67+
run: |
68+
echo '<policymap>' > policy.xml
69+
echo '<policy domain="coder" rights="read | write" pattern="PDF" />' >> policy.xml
70+
echo '</policymap>' >> policy.xml
71+
sudo rm /etc/ImageMagick-6/policy.xml
72+
sudo mv policy.xml /etc/ImageMagick-6/policy.xml
73+
74+
- name: Setup Ruby
75+
uses: ruby/setup-ruby@v1
76+
with:
77+
ruby-version: ${{ matrix.ruby }}
78+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
79+
80+
- name: Setup Bundler
81+
run: gem install bundler -v '~> 1.0'
82+
83+
- name: Checkout dependencies - Base RSpec plugin
84+
uses: actions/checkout@v4
85+
with:
86+
repository: jbbarth/redmine_base_rspec
87+
path: redmine/plugins/redmine_base_rspec
88+
89+
- name: Prepare Redmine source
90+
working-directory: redmine
91+
run: |
92+
sed -i '/rubocop/d' Gemfile
93+
rm -f .rubocop*
94+
cp plugins/redmine_base_rspec/spec/support/database-${{ matrix.db }}.yml config/database.yml
95+
96+
- name: Install Ruby dependencies
97+
working-directory: redmine
98+
run: |
99+
bundle install --jobs=4 --retry=3 --without development
100+
101+
- name: Generate session store secret
102+
env:
103+
RAILS_ENV: test
104+
working-directory: redmine
105+
run: |
106+
bundle exec rake generate_secret_token
107+
108+
- name: Run Redmine DB and migration tasks
109+
env:
110+
RAILS_ENV: test
111+
working-directory: redmine
112+
run: |
113+
bundle exec rake db:create db:migrate
114+
bundle exec rails test:scm:setup:subversion
115+
116+
- name: Checkout dependencies - Base Deface plugin
117+
uses: actions/checkout@v4
118+
with:
119+
repository: jbbarth/redmine_base_deface
120+
path: redmine/plugins/redmine_base_deface
121+
122+
- name: Checkout dependencies - Base StimulusJS plugin
123+
uses: actions/checkout@v4
124+
with:
125+
repository: nanego/redmine_base_stimulusjs
126+
path: redmine/plugins/redmine_base_stimulusjs
127+
128+
- name: Checkout plugin
129+
uses: actions/checkout@v4
130+
with:
131+
path: redmine/plugins/${{ env.PLUGIN_NAME }}
132+
133+
- name: Install plugins dependencies and run plugins migrations
134+
env:
135+
RAILS_ENV: test
136+
working-directory: redmine
137+
run: |
138+
bundle install --jobs=4 --retry=3 --without development
139+
bundle exec rake redmine:plugins:migrate
140+
# cp -i plugins/*/spec/fixtures/*yml test/fixtures/
141+
bundle exec rails db:fixtures:load
142+
143+
- name: Run core tests
144+
env:
145+
RAILS_ENV: test
146+
working-directory: redmine
147+
run: bundle exec rails test
148+
149+
- name: Run plugin tests
150+
env:
151+
RAILS_ENV: test
152+
working-directory: redmine
153+
run: bundle exec rails redmine:plugins:test NAME=${{ env.PLUGIN_NAME }} RUBYOPT="-W0"
154+
155+
- name: Run uninstall test
156+
env:
157+
RAILS_ENV: test
158+
working-directory: redmine
159+
run: bundle exec rake redmine:plugins:migrate NAME=${{ env.PLUGIN_NAME }} VERSION=0

0 commit comments

Comments
 (0)