https://github.com/quipper/datadog-test-report-action
Send test reports to Datadog in GitHub Actions
https://github.com/quipper/datadog-test-report-action
datadog github-actions junit-xml-reports
Last synced: 8 months ago
JSON representation
Send test reports to Datadog in GitHub Actions
- Host: GitHub
- URL: https://github.com/quipper/datadog-test-report-action
- Owner: quipper
- License: apache-2.0
- Created: 2024-01-21T09:11:41.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-02-25T00:58:39.000Z (8 months ago)
- Last Synced: 2025-02-25T01:32:13.934Z (8 months ago)
- Topics: datadog, github-actions, junit-xml-reports
- Language: TypeScript
- Homepage:
- Size: 15.3 MB
- Stars: 1
- Watchers: 5
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# datadog-test-report-action [](https://github.com/quipper/datadog-test-report-action/actions/workflows/ts.yaml)
This is an action to send test report to Datadog.
It supports the JUnit XML format.
## Getting Started
To send the test report to Datadog,
```yaml
jobs:
test:
runs-on: ubuntu-latest
steps:
- run: yarn test
- uses: quipper/datadog-test-report-action@v1
with:
junit-xml-path: '**/junit.xml'
```
## Metrics
All metrics have the following tags:
- `repository_owner`
- `repository_name`
- `workflow_name`
### `testreport.testsuite.count` (count)
This metric represents the number of test suites.
It has the following tags:
- `testsuite_name`
### `testreport.testsuite.duration` (distribution)
This metric represents the duration of test suites in seconds.
It has the following tags:
- `testsuite_name`
### `testreport.testcase.success_count` (count)
This metric represents the number of succeeded test cases.
It has the following tags:
- `testcase_name`
- `testcase_classname`
- `testcase_file`
This actions sends **only failed test cases by default**.
You can set `send-test-case-success` to send all test cases.
:warning: It may increase the custom metrics cost.
```yaml
- uses: quipper/datadog-test-report-action@v1
with:
junit-xml-path: '**/junit.xml'
send-test-case-success: true
```
### `testreport.testcase.failure_count` (count)
This metric represents the number of failed test cases.
It has the following tags:
- `testcase_name`
- `testcase_classname`
- `testcase_file`
### `testreport.testcase.duration` (distribution)
This metric represents the duration of test cases in seconds.
It has the following tags:
- `testcase_name`
- `testcase_conclusion` (`success` or `failure`)
- `testcase_classname`
- `testcase_file`
This action sends test cases **slower than 1 second by default**.
You can set `filter-test-case-slower-than` to send all test cases.
:warning: It may increase the custom metrics cost.
```yaml
- uses: quipper/datadog-test-report-action@v1
with:
junit-xml-path: '**/junit.xml'
filter-test-case-slower-than: 0
```
## Specification
### Inputs
| Name | Default | Description |
| ------------------------------ | ------------ | -------------------------------------------------------- |
| `junit-xml-path` | (required) | Glob pattern to the JUnit XML file(s) |
| `metric-name-prefix` | `testreport` | Prefix of the name of metrics |
| `filter-test-case-slower-than` | 1 | Filter test cases slower than the threshold (in seconds) |
| `enable-metrics` | true | If false, do not send the metrics to Datadog |
| `send-test-case-success` | false | Send succeeded test cases |
| `send-test-case-failure` | true | Send failed test cases |
| `datadog-api-key` | - | Datadog API key |
| `datadog-site` | - | Datadog site |
| `datadog-tags` | - | Datadog tags |
### Outputs
None.