-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4120 from open-formulieren/chore/handle-flaky-test
Deal with flaky test
- Loading branch information
Showing
14 changed files
with
205 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
|
||
name: Report flaky tests | ||
description: Parses log file for flaky tests and adds annotations for them | ||
inputs: | ||
logFile: | ||
description: Log file containing the flaky test logs | ||
required: true | ||
default: 'log/flaky.jsonl' | ||
runs: | ||
using: 'node20' | ||
main: 'report_flaky.js' |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"name": "report-flaky", | ||
"version": "1.0.0", | ||
"description": "Flaky test reporter action", | ||
"main": "report_flaky.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"author": "", | ||
"license": "MIT", | ||
"dependencies": { | ||
"@actions/core": "^1.10.1" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Taken from: https://nodejs.org/api/readline.html#readline_example_read_file_stream_line_by_line | ||
const fs = require('node:fs'); | ||
const readline = require('node:readline'); | ||
|
||
const core = require('@actions/core'); | ||
|
||
const logFilePath = core.getInput('logFile'); | ||
|
||
async function emitAnnotations() { | ||
const fileStream = fs.createReadStream(logFilePath); | ||
|
||
const rl = readline.createInterface({ | ||
input: fileStream, | ||
crlfDelay: Infinity, | ||
}); | ||
// Note: we use the crlfDelay option to recognize all instances of CR LF | ||
// ('\r\n') in input.txt as a single line break. | ||
|
||
for await (const line of rl) { | ||
// each line is expected to be valid JSON | ||
const logRecord = JSON.parse(line); | ||
core.warning(logRecord.msg, {file: logRecord.file, startLine: logRecord.line}); | ||
} | ||
} | ||
|
||
emitAnnotations(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,6 +41,7 @@ local.py | |
/static/ | ||
/mail/ | ||
/log/*.log* | ||
/log/*.jsonl | ||
/log/nginx/*.log* | ||
/.env | ||
/docker/.env | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters