Skip to content

Update rerun-failed-tests.adoc #9363

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
39 changes: 39 additions & 0 deletions jekyll/_cci2/rerun-failed-tests.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,45 @@ gem 'minitest-ci'
path: test/reports
```

[#configure-a-job-running-codeception-tests]
=== Configure a job running Codeception tests

Codeception doesn't support providing paths to multiple files in a single `codecept run` command execution directly. We can circumvent this by creating a dynamic group. Add the following to your `codeception.yml` file:

[,yml]
----
groups:
circleci: tests/_output/circleci
----

In your `.circleci/config.yml` file, we can use `circleci tests glob` to get the Cest files from the path we need. `circleci tests run` will then sift through the Cest files and put the necessary ones into `tests/_output/circleci` file. Before running the tests with the `circleci` group, we ensure the `tests/_output/circleci` file exists. The `--xml` option is required for the rerun tests feature to work. The `--html` option is optional, but useful for easy debugging through artifacts.

[,yml]
----
jobs:
my_test_job:
parallelism: 2
docker:
- image: codeception/codeception:5.1.2
steps:
- checkout
- run:
name: Run the acceptance tests
command: |
circleci tests glob ${CIRCLE_WORKING_DIRECTORY}/tests/Acceptance/**/*Cest.php | circleci tests run --command="xargs -I{} echo {} >> tests/_output/circleci" --verbose --split-by=timings
if [ -f tests/_output/circleci ]; then
codecept run -g circleci --xml --html
else
exit 0
fi
- store_test_results:
name: Store test results (junit xml file).
path: tests/_output
- store_artifacts:
name: Store test results (html and image files).
path: tests/_output
----

[#output-test-files-only]
=== Output test files only

Expand Down