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

Misc cucumber tweaks #239

Merged
merged 1 commit into from
Dec 19, 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
20 changes: 11 additions & 9 deletions cucumber.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
let cmd = `--format-options '{"snippetInterface": "synchronous"}'`;
// https://github.com/cucumber/cucumber-js/blob/main/docs/configuration.md

if (process.env.TAGS) {
// @see https://cucumber.io/docs/cucumber/api/?lang=javascript#tags
cmd += ` --tags '${process.env.TAGS}'`;
}

console.log(cmd);

export default cmd;
export default {
backtrace: true,
format: ['progress'],
formatOptions: {
snippetInterface: 'synchronous',
},
failFast: true,
// @see https://github.com/cucumber/cucumber-js/blob/main/docs/filtering.md#tags
tags: process.env.TAGS,
};
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ services:
- MYSQL_DATABASE=activitypub
- NODE_ENV=testing
- TAGS
command: yarn run cucumber-js
command: /opt/activitypub/node_modules/.bin/cucumber-js
depends_on:
fake-ghost-activitypub:
condition: service_started
Expand Down
5 changes: 4 additions & 1 deletion docker/cucumber-tests
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/usr/bin/env bash

# Export the input provided to the script as the TAGS environment variable. This
# will then be used by the cucumber-tests container to run only the scenarios
# matching the provided tags expression
export TAGS=$1

docker compose run --rm migrate-testing up && docker compose up cucumber-tests --exit-code-from cucumber-tests
docker compose run --rm migrate-testing up && docker compose run --rm cucumber-tests
Loading