Commit 9a2d5688 authored by Evan Read's avatar Evan Read

Merge branch 'master' into 'master'

Added PHPUnit example for generating junit output

See merge request gitlab-org/gitlab!58753
parents 3d2765f7 070e8829
...@@ -307,6 +307,25 @@ test: ...@@ -307,6 +307,25 @@ test:
- report.xml - report.xml
``` ```
### PHP example
This example uses [PHPUnit](https://phpunit.de/) with the `--log-junit` flag.
You can also add this option using
[XML](https://phpunit.readthedocs.io/en/stable/configuration.html#the-junit-element)
in the `phpunit.xml` configuration file.
```yaml
phpunit:
stage: test
script:
- composer install
- vendor/bin/phpunit --log-junit report.xml
artifacts:
when: always
reports:
junit: report.xml
```
## Viewing Unit test reports on GitLab ## Viewing Unit test reports on GitLab
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/24792) in GitLab 12.5 behind a feature flag (`junit_pipeline_view`), disabled by default. > - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/24792) in GitLab 12.5 behind a feature flag (`junit_pipeline_view`), disabled by default.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment