mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 01:13:23 -04:00
[Security Solution] Fix a build step when there are no tests to execute (#165929)
## Summary Fixes failed build steps when there are no tests to execute and hence no reports. ## Details Despite this [PR](https://github.com/elastic/kibana/pull/165824) fixes tests failure when there are no reports but `yarn junit:merge` tries to convert them to junit format the problem is partially stays as `Failed Test Reporter` runs for every build step meaning also for successful build steps. We don't need to handle failed test reports for successful build steps. There are cases when there are no tests to run so Cypress doesn't produce reports and nothing is converted to junit format so `Failed Test Reporter` fails and causes a build step to fails. It could be solved by defining an environment variable `DISABLE_MISSING_TEST_REPORT_ERRORS=true` but we need to make sure reports exist for failed tests. Taking this into account we can rely on `BUILDKITE_COMMAND_EXIT_STATUS` to avoid running `Failed Test Reporter` if the build step successed. One may ask why don't skip `Upload Artifacts` too. We may need some build artifacts for successful build steps. --------- Co-authored-by: Tiago Costa <tiago.costa@elastic.co>
This commit is contained in:
parent
62911d2bc9
commit
369d2fe367
1 changed files with 4 additions and 2 deletions
|
@ -31,8 +31,10 @@ if [[ "$IS_TEST_EXECUTION_STEP" == "true" ]]; then
|
|||
buildkite-agent artifact upload '.es/**/*.hprof'
|
||||
buildkite-agent artifact upload 'data/es_debug_*.tar.gz'
|
||||
|
||||
echo "--- Run Failed Test Reporter"
|
||||
node scripts/report_failed_tests --build-url="${BUILDKITE_BUILD_URL}#${BUILDKITE_JOB_ID}" 'target/junit/**/*.xml'
|
||||
if [[ $BUILDKITE_COMMAND_EXIT_STATUS -ne 0 ]]; then
|
||||
echo "--- Run Failed Test Reporter"
|
||||
node scripts/report_failed_tests --build-url="${BUILDKITE_BUILD_URL}#${BUILDKITE_JOB_ID}" 'target/junit/**/*.xml'
|
||||
fi
|
||||
|
||||
if [[ -d 'target/test_failures' ]]; then
|
||||
buildkite-agent artifact upload 'target/test_failures/**/*'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue