Skip to content

Commit

Permalink
feat: flaky and retries
Browse files Browse the repository at this point in the history
  • Loading branch information
Ma11hewThomas committed Apr 20, 2024
1 parent 0cbcdb0 commit 718165f
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ jobs:
run: npx github-actions-ctrf summary ctrf/ctrf-report.json
- name: Publish CTRF Failed Test Summary Results
run: npx github-actions-ctrf failed ctrf/ctrf-report.json
- name: Publish CTRF Flake Test Summary Results
run: npx github-actions-ctrf flake ctrf/ctrf-report.json
- name: Publish CTRF Flaky Test Summary Results
run: npx github-actions-ctrf flaky ctrf/ctrf-report.json
- name: Publish CTRF Detailed Test Summary Results
run: npx github-actions-ctrf tests ctrf/ctrf-report.json
- name: Annotate failed tests
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,11 @@ The test object in the report includes the following [CTRF properties](https://c
| `duration` | Number | Required | The time taken for the test execution, in milliseconds. |
| `message` | String | Optional | The failure message if the test failed. |
| `trace` | String | Optional | The stack trace captured if the test failed. |
| `rawStatus` | String | Optional | The original playwright status of the test before mapping to CTRF status. |
| `rawStatus` | String | Optional | The original cypress status of the test before mapping to CTRF status. |
| `type` | String | Optional | The type of test (e.g., `api`, `e2e`). |
| `filepath` | String | Optional | The file path where the test is located in the project. |
| `retry` | Number | Optional | The number of retries attempted for the test. |
| `flake` | Boolean | Optional | Indicates whether the test result is flaky. |
| `retries` | Number | Optional | The number of retries attempted for the test. |
| `flaky` | Boolean | Optional | Indicates whether the test result is flaky. |
| `browser` | String | Optional | The browser used for the test. |

## Support Us
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cypress-ctrf-json-reporter",
"version": "0.0.5",
"version": "0.0.6",
"description": "",
"main": "dist/index.js",
"scripts": {
Expand All @@ -11,6 +11,7 @@
"format": "prettier --write .",
"format-check": "prettier --check ."
},
"repository": "github:ctrf-io/cypress-ctrf-json-report",
"files": [
"dist/",
"README.md"
Expand Down
4 changes: 2 additions & 2 deletions src/generate-report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,8 @@ export class GenerateCtrfReport {
ctrfTest.rawStatus = test.state
ctrfTest.type = this.reporterConfigOptions.testType ?? 'e2e'
ctrfTest.filePath = cypressResults.spec?.relative
ctrfTest.retry = attemptsLength - 1
ctrfTest.flake = isFlaky
ctrfTest.retries = attemptsLength - 1
ctrfTest.flaky = isFlaky
ctrfTest.browser = this.browser
}
this.ctrfReport.results.tests.push(ctrfTest)
Expand Down
4 changes: 2 additions & 2 deletions types/ctrf.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ export interface CtrfTest {
tags?: string[]
type?: string
filePath?: string
retry?: number
flake?: boolean
retries?: number
flaky?: boolean
attempts?: CtrfTest[]
browser?: string
device?: string
Expand Down

0 comments on commit 718165f

Please sign in to comment.