Skip to content

Commit

Permalink
test: add logs on non-passing tests (#3516)
Browse files Browse the repository at this point in the history
Description
---
Change the test to add logs from `=== 'failed'` to `!== 'passed'`. 

Motivation and Context
---
When a step would timeout, it would not trigger the step to add logs

How Has This Been Tested?
---
Checking on ci
  • Loading branch information
stringhandler authored Oct 31, 2021
1 parent beacb9e commit e5bf571
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,15 @@ commands:
- run:
name: Run cucumber scenarios
no_output_timeout: 20m
command: cd integration_tests && mkdir -p cucumber_output && node_modules/.bin/cucumber-js --profile "ci" --tags "not @long-running and not @broken and not @wallet-ffi" --format json:cucumber_output/tests.cucumber --exit --retry 2 --retryTagFilter "@flaky and not @broken"
command: cd integration_tests && mkdir -p cucumber_output && node_modules/.bin/cucumber-js --profile "ci" --tags "not @long-running and not @broken and not @wallet-ffi" --format json:cucumber_output/tests.cucumber --exit --retry 3 --retry-tag-filter "@flaky and not @broken"
- run:
name: Generate report
command: cd integration_tests && node ./generate_report.js
when: always
# Below step requires NodeJS v12 to run correctly, see explanation in WalletFFI.feature
- run:
name: Run FFI wallet library cucumber scenarios
command: cd integration_tests && mkdir -p cucumber_output && node_modules/.bin/cucumber-js --profile "ci" --tags "not @long-running and not @broken and not @flaky and @wallet-ffi" --format json:cucumber_output/tests_ffi.cucumber --exit
command: cd integration_tests && mkdir -p cucumber_output && node_modules/.bin/cucumber-js --profile "ci" --tags "not @long-running and not @broken and @wallet-ffi" --format json:cucumber_output/tests_ffi.cucumber --exit --retry 3 --retry-tag-filter "@flaky and not @broken"
when: always
- run:
name: Generate report (ffi)
Expand Down
11 changes: 8 additions & 3 deletions integration_tests/features/support/world.js
Original file line number Diff line number Diff line change
Expand Up @@ -432,10 +432,15 @@ After(async function (testCase) {

async function stopAndHandleLogs(objects, testCase, context) {
for (const key in objects) {
if (testCase.result.status === "failed") {
await attachLogs(`${objects[key].baseDir}`, context);
try {
if (testCase.result.status !== "passed") {
await attachLogs(`${objects[key].baseDir}`, context);
}
await objects[key].stop();
} catch (e) {
console.log(e);
// Continue with others
}
await objects[key].stop();
}
}

Expand Down

0 comments on commit e5bf571

Please sign in to comment.