Skip to content

Commit 4ebca33

Browse files
committed
Update docker services, improve tests
1 parent e352a69 commit 4ebca33

File tree

8 files changed

+40
-38
lines changed

8 files changed

+40
-38
lines changed

.github/workflows/tests.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ jobs:
4343
# runs-on: ubuntu-latest
4444

4545
# services:
46-
# redmine-60005:
47-
# image: redmine:6.0.5
46+
# redmine-6-0:
47+
# image: redmine:6.0.7
4848
# ports:
4949
# - "5060:3000"
5050
# env:
@@ -53,8 +53,8 @@ jobs:
5353
# # REDMINE_SECRET_KEY_BASE: supersecretkey
5454
# REDMINE_PLUGINS_MIGRATE: true
5555
# volumes:
56-
# - /home/runner/work/_temp/redmine-60005_data/files:/usr/src/redmine/files
57-
# - /home/runner/work/_temp/redmine-60005_data/sqlite:/usr/src/redmine/sqlite
56+
# - /home/runner/work/_temp/redmine-60007_data/files:/usr/src/redmine/files
57+
# - /home/runner/work/_temp/redmine-60007_data/sqlite:/usr/src/redmine/sqlite
5858
# options: --health-cmd="wget -O /dev/null http://localhost:3000" --health-start-period=30s --health-interval=30s --health-timeout=30s --health-retries=3
5959

6060
# strategy:
@@ -83,7 +83,7 @@ jobs:
8383
# uses: "ramsey/composer-install@v2"
8484

8585
# - name: Run behat
86-
# run: vendor/bin/behat --config tests/Behat/behat.yml --profile=github-actions --suite=redmine_60005
86+
# run: vendor/bin/behat --config tests/Behat/behat.yml --profile=github-actions --suite=redmine_60007
8787

8888
code-quality:
8989
name: Check ${{ matrix.tool }} (PHP ${{ matrix.php }})

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@
5353
"scripts": {
5454
"bdt": [
5555
"Composer\\Config::disableProcessTimeout",
56-
"@behat --format=progress --suite=redmine_60005",
57-
"@behat --format=progress --suite=redmine_50108",
58-
"@behat --format=progress --suite=redmine_50012"
56+
"@behat --format=progress --suite=redmine_6_0",
57+
"@behat --format=progress --suite=redmine_5_1",
58+
"@behat --format=progress --suite=redmine_5_0"
5959
],
6060
"behat": "behat --config tests/Behat/behat.yml",
6161
"codestyle": "php-cs-fixer fix",

docker-compose.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ services:
1111
- ./:/var/www/project/ # Location of the project for php-fpm. Note this should be the same for NGINX.*
1212

1313
redmine-dev:
14-
image: redmine:6.0.5
14+
image: redmine:6.0.7
1515
ports:
1616
- "3000:3000"
1717
environment:
@@ -26,8 +26,8 @@ services:
2626
# Make sure the following services are configured in:
2727
# - /tests/Behat/behat.yml
2828

29-
redmine-60005:
30-
image: redmine:6.0.5
29+
redmine-6-0:
30+
image: redmine:6.0.7
3131
ports:
3232
- "5060:3000"
3333
environment:
@@ -36,29 +36,29 @@ services:
3636
# REDMINE_SECRET_KEY_BASE: supersecretkey
3737
REDMINE_PLUGINS_MIGRATE: true
3838
volumes:
39-
- ./.docker/redmine-60005_data/files:/usr/src/redmine/files
40-
- ./.docker/redmine-60005_data/sqlite:/usr/src/redmine/sqlite
39+
- ./.docker/redmine-60007_data/files:/usr/src/redmine/files
40+
- ./.docker/redmine-60007_data/sqlite:/usr/src/redmine/sqlite
4141

42-
redmine-50108:
43-
image: redmine:5.1.8
42+
redmine-5-1:
43+
image: redmine:5.1.10
4444
user: "1000:1000"
4545
ports:
4646
- "5051:3000"
4747
environment:
4848
REDMINE_SECRET_KEY_BASE: supersecretkey
4949
REDMINE_PLUGINS_MIGRATE: true
5050
volumes:
51-
- ./.docker/redmine-50108_data/files:/usr/src/redmine/files
52-
- ./.docker/redmine-50108_data/sqlite:/usr/src/redmine/sqlite
51+
- ./.docker/redmine-50110_data/files:/usr/src/redmine/files
52+
- ./.docker/redmine-50110_data/sqlite:/usr/src/redmine/sqlite
5353

54-
redmine-50012:
55-
image: redmine:5.0.12
54+
redmine-5-0:
55+
image: redmine:5.0.12 # There is no tag for 5.0.14 on Docker hub
5656
user: "1000:1000"
5757
ports:
5858
- "5050:3000"
5959
environment:
6060
REDMINE_SECRET_KEY_BASE: supersecretkey
6161
REDMINE_PLUGINS_MIGRATE: true
6262
volumes:
63-
- ./.docker/redmine-50012_data/files:/usr/src/redmine/files
64-
- ./.docker/redmine-50012_data/sqlite:/usr/src/redmine/sqlite
63+
- ./.docker/redmine-50014_data/files:/usr/src/redmine/files
64+
- ./.docker/redmine-50014_data/sqlite:/usr/src/redmine/sqlite

tests/Behat/Bootstrap/FeatureContext.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -431,9 +431,9 @@ private function assertTableNodeIsSameAsArray(TableNode $table, array $data)
431431
$expected = false;
432432
}
433433

434-
// Handle placeholder %redmine_id%
434+
// Handle placeholder %redmine_base_url%
435435
if (is_string($expected)) {
436-
$expected = str_replace('%redmine_id%', strval($this->redmine->getVersionId()), $expected);
436+
$expected = str_replace('%redmine_base_url%', $this->redmine->getRedmineUrl(), $expected);
437437
}
438438

439439
TestCase::assertSame($expected, $value, 'Error with property "' . $row['property'] . '"');

tests/Behat/behat.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,36 +3,36 @@ default:
33
default:
44
paths:
55
- '%paths.base%/features'
6-
redmine_60005:
6+
redmine_6_0:
77
contexts:
88
- Redmine\Tests\Behat\Bootstrap\FeatureContext:
9-
redmineVersion: '6.0.5'
9+
redmineVersion: '6.0.7'
1010
rootPath: '%paths.base%/../../.docker'
11-
redmine_50108:
11+
redmine_5_1:
1212
contexts:
1313
- Redmine\Tests\Behat\Bootstrap\FeatureContext:
14-
redmineVersion: '5.1.8'
14+
redmineVersion: '5.1.10'
1515
rootPath: '%paths.base%/../../.docker'
16-
redmine_50012:
16+
redmine_5_0:
1717
contexts:
1818
- Redmine\Tests\Behat\Bootstrap\FeatureContext:
19-
redmineVersion: '5.0.12'
19+
redmineVersion: '5.0.14'
2020
rootPath: '%paths.base%/../../.docker'
2121

2222
github-actions:
2323
suites:
24-
redmine_60005:
24+
redmine_6_0:
2525
contexts:
2626
- Redmine\Tests\Behat\Bootstrap\FeatureContext:
27-
redmineVersion: '6.0.5'
27+
redmineVersion: '6.0.7'
2828
rootPath: '/home/runner/work/_temp'
29-
redmine_50108:
29+
redmine_5_1:
3030
contexts:
3131
- Redmine\Tests\Behat\Bootstrap\FeatureContext:
32-
redmineVersion: '5.1.8'
32+
redmineVersion: '5.1.10'
3333
rootPath: '/home/runner/work/_temp'
34-
redmine_50012:
34+
redmine_5_0:
3535
contexts:
3636
- Redmine\Tests\Behat\Bootstrap\FeatureContext:
37-
redmineVersion: '5.0.12'
37+
redmineVersion: '5.0.14'
3838
rootPath: '/home/runner/work/_temp'

tests/Behat/features/attachments.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ Feature: Interacting with the REST API for attachments
7171
| filesize | 65 |
7272
| content_type | text/plain |
7373
| description | null |
74-
| content_url | http://redmine-%redmine_id%:3000/attachments/download/1/testfile.txt |
74+
| content_url | %redmine_base_url%/attachments/download/1/testfile.txt |
7575
And the returned data "attachment.author" property is an array
7676
And the returned data "attachment.author" property contains the following data
7777
| property | value |

tests/Behat/features/wiki.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ Feature: Interacting with the REST API for wikis
205205
| filesize | 65 |
206206
| content_type | text/plain |
207207
| description | |
208-
| content_url | http://redmine-%redmine_id%:3000/attachments/download/1/filename.txt |
208+
| content_url | %redmine_base_url%/attachments/download/1/filename.txt |
209209
And the returned data "wiki_page.attachments.0.author" property is an array
210210
And the returned data "wiki_page.attachments.0.author" property has only the following properties
211211
"""

tests/RedmineExtension/RedmineInstance.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ private function __construct(InstanceRegistration $tracer, RedmineVersion $versi
6363
$this->migratedFiles = 'files-migrated/';
6464
$this->backupFiles = 'files-bak/';
6565

66-
$this->redmineUrl = 'http://redmine-' . $versionId . ':3000';
66+
$parts = explode('.', $version->asString());
67+
68+
$this->redmineUrl = 'http://redmine-' . intval($parts[0]) . '-' . intval($parts[1]) . ':3000';
6769
$this->apiKey = sha1($versionId . (string) time());
6870

6971
$this->runHealthChecks($version);

0 commit comments

Comments
 (0)