Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run behat tests with Redmine 5.1.4 and 5.0.10 #432

Merged
merged 3 commits into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- New class `Redmine\Http\HttpFactory` to create `Redmine\Http\Request` and `Redmine\Http\Response` instances.

### Changed

- Behaviour-driven tests are run against Redmine 5.1.4, 5.0.10 and 4.2.10.

### Deprecated

- `Redmine\Client\Client::requestGet()` is deprecated, use `\Redmine\Client\Client::request()` instead.
Expand Down
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "kbsali/redmine-api",
"version": "v2.7.0",
"type": "library",
"description": "Redmine API client",
"homepage": "https://github.com/kbsali/php-redmine-api",
Expand Down Expand Up @@ -52,8 +53,8 @@
"scripts": {
"bdt": [
"Composer\\Config::disableProcessTimeout",
"@behat --format=progress --suite=redmine_50103",
"@behat --format=progress --suite=redmine_50009",
"@behat --format=progress --suite=redmine_50104",
"@behat --format=progress --suite=redmine_50010",
"@behat --format=progress --suite=redmine_40210"
],
"behat": "behat --config tests/Behat/behat.yml",
Expand Down
18 changes: 9 additions & 9 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ services:
- ./:/var/www/project/ # Location of the project for php-fpm. Note this should be the same for NGINX.*

redmine-dev:
image: redmine:5.1.3
image: redmine:5.1.4
user: "1000:1000"
ports:
- "3000:3000"
Expand All @@ -25,29 +25,29 @@ services:
# Make sure the following services are configured in:
# - /tests/Behat/behat.yml

redmine-50103:
image: redmine:5.1.3
redmine-50104:
image: redmine:5.1.4
user: "1000:1000"
ports:
- "5103:3000"
environment:
REDMINE_SECRET_KEY_BASE: supersecretkey
REDMINE_PLUGINS_MIGRATE: true
volumes:
- ./.docker/redmine-50103_data/files:/usr/src/redmine/files
- ./.docker/redmine-50103_data/sqlite:/usr/src/redmine/sqlite
- ./.docker/redmine-50104_data/files:/usr/src/redmine/files
- ./.docker/redmine-50104_data/sqlite:/usr/src/redmine/sqlite

redmine-50009:
image: redmine:5.0.9
redmine-50010:
image: redmine:5.0.10
user: "1000:1000"
ports:
- "5009:3000"
environment:
REDMINE_SECRET_KEY_BASE: supersecretkey
REDMINE_PLUGINS_MIGRATE: true
volumes:
- ./.docker/redmine-50009_data/files:/usr/src/redmine/files
- ./.docker/redmine-50009_data/sqlite:/usr/src/redmine/sqlite
- ./.docker/redmine-50010_data/files:/usr/src/redmine/files
- ./.docker/redmine-50010_data/sqlite:/usr/src/redmine/sqlite

redmine-40210:
# Redmine 4.2.11 is not available on Docker Hub
Expand Down
6 changes: 3 additions & 3 deletions tests/Behat/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ you can use the `behat` command directly:

```bash
# test only a specific redmine version
docker compose exec php composer behat -- --suite=redmine_50103
docker compose exec php composer behat -- --suite=redmine_50104
# test only specific endpoints
docker compose exec php composer behat -- --tags=issue,group
# test only specific endpoints on a specific redmine version
docker compose exec php composer behat -- --suite=redmine_50103 --tags=issue,group
docker compose exec php composer behat -- --suite=redmine_50104 --tags=issue,group
# test only a specific redmine version and format the output as `progress` (default is `pretty`)
docker compose exec php composer behat -- --suite=redmine_50103 --format=progress
docker compose exec php composer behat -- --suite=redmine_50104 --format=progress
```

## Redmine version specific features
Expand Down
8 changes: 4 additions & 4 deletions tests/Behat/behat.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
default:
suites:
redmine_50103:
redmine_50104:
paths:
- '%paths.base%/features'
contexts:
- Redmine\Tests\Behat\Bootstrap\FeatureContext:
redmineVersion: '5.1.3'
redmine_50009:
redmineVersion: '5.1.4'
redmine_50010:
paths:
- '%paths.base%/features'
contexts:
- Redmine\Tests\Behat\Bootstrap\FeatureContext:
redmineVersion: '5.0.9'
redmineVersion: '5.0.10'
redmine_40210:
paths:
- '%paths.base%/features'
Expand Down
17 changes: 17 additions & 0 deletions tests/RedmineExtension/RedmineVersion.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@

enum RedmineVersion: string
{
/**
* Redmine 5.1.4
*
* @link https://www.redmine.org/versions/197
* @link https://www.redmine.org/projects/redmine/wiki/Changelog_5_1#514-2024-11-03
*/
case V5_1_4 = '5.1.4';

/**
* Redmine 5.1.3
*
Expand Down Expand Up @@ -47,6 +55,15 @@ enum RedmineVersion: string

case V5_0_9 = '5.0.9';

/**
* Redmine 5.0.10
*
* @link https://www.redmine.org/versions/196
* @link https://www.redmine.org/projects/redmine/wiki/Changelog_5_0#5010-2024-11-03
*/

case V5_0_10 = '5.0.10';

/**
* Redmine 5.0.8
*
Expand Down
Loading