Skip to content

Commit

Permalink
Adding time to the test log
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsonrw82 committed Sep 30, 2023
1 parent 75b84e7 commit e45ebec
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
4 changes: 3 additions & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion src/testParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,10 @@ async function parseSuite(
// optionally attach the prefix to the path
resolvedPath = testFilesPrefix ? pathHelper.join(testFilesPrefix, resolvedPath) : resolvedPath

core.info(`${resolvedPath}:${pos.line} | ${message.replace(/\n/g, ' ')}`)
// fish the time-taken out of the test case attributes, if present
const testTime = testcase._attributes.time === undefined ? '' : ` (${testcase._attributes.time}s)`

core.info(`${resolvedPath}:${pos.line} | ${message.replace(/\n/g, ' ')}${testTime}`)

annotations.push({
path: resolvedPath,
Expand Down

0 comments on commit e45ebec

Please sign in to comment.