bugcrowd / test-summary-buildkite-plugin

Buildkite plugin to summarise all test failures as an annotation
MIT License
68 stars 39 forks source link

Errors are not caught properly when truncating and one input fails to download #37

Closed tessereth closed 6 years ago

tessereth commented 6 years ago
$ /etc/buildkite-agent/plugins/github-com-bugcrowd-test-summary-buildkite-plugin-v1-7-0/hooks/command
Found tag v1.7.0, pulling from docker hub
v1.7.0: Pulling from tessereth/test-summary-buildkite-plugin
Digest: sha256:429443972bad9a2f3b06f14782c2d4aa4620cfdc78d9cb0c73234e2a160a553e
Status: Image is up to date for tessereth/test-summary-buildkite-plugin:v1.7.0

<truncated>

$ buildkite-agent artifact download artifacts/validate.txt tmp/test-summary
2018-10-10 00:24:24 INFO   Searching for artifacts: "artifacts/validate.txt"
2018-10-10 00:24:24 FATAL  No artifacts found for downloading

RuntimeError: Command 'buildkite-agent artifact download artifacts/validate.txt tmp/test-summary' failed (exit status: 1)

/usr/src/app/lib/test_summary_buildkite_plugin/agent.rb:27:in `run'
/usr/src/app/lib/test_summary_buildkite_plugin/input.rb:40:in `files'
/usr/src/app/lib/test_summary_buildkite_plugin/input.rb:29:in `failures'
/usr/src/app/lib/test_summary_buildkite_plugin/formatter.rb:22:in `markdown'
/usr/src/app/lib/test_summary_buildkite_plugin/truncater.rb:49:in `input_markdown'
/usr/src/app/lib/test_summary_buildkite_plugin/truncater.rb:60:in `block in markdown_with_truncation'
/usr/src/app/lib/test_summary_buildkite_plugin/truncater.rb:60:in `map'
/usr/src/app/lib/test_summary_buildkite_plugin/truncater.rb:60:in `markdown_with_truncation'
/usr/src/app/lib/test_summary_buildkite_plugin/truncater.rb:17:in `markdown'
/usr/src/app/lib/test_summary_buildkite_plugin/runner.rb:19:in `run'
/usr/src/app/lib/test_summary_buildkite_plugin.rb:19:in `run'
./bin/run:10:in `<main>'
Markdown is too large (52087 B > 50000 B), truncating
$ buildkite-agent artifact download artifacts/validate.txt tmp/test-summary
2018-10-10 00:24:24 INFO   Searching for artifacts: "artifacts/validate.txt"
2018-10-10 00:24:24 FATAL  No artifacts found for downloading
/usr/src/app/lib/test_summary_buildkite_plugin/agent.rb:27:in `run': Command 'buildkite-agent artifact download artifacts/validate.txt tmp/test-summary' failed (exit status: 1) (RuntimeError)
    from /usr/src/app/lib/test_summary_buildkite_plugin/input.rb:40:in `files'
    from /usr/src/app/lib/test_summary_buildkite_plugin/input.rb:29:in `failures'
    from /usr/src/app/lib/test_summary_buildkite_plugin/truncater.rb:64:in `map'
    from /usr/src/app/lib/test_summary_buildkite_plugin/truncater.rb:64:in `max_truncate'
    from /usr/src/app/lib/test_summary_buildkite_plugin/truncater.rb:28:in `markdown'
    from /usr/src/app/lib/test_summary_buildkite_plugin/runner.rb:19:in `run'
    from /usr/src/app/lib/test_summary_buildkite_plugin.rb:19:in `run'
    from ./bin/run:10:in `<main>'

Command failed with exit status: 1
/etc/buildkite-agent/plugins/github-com-bugcrowd-test-summary-buildkite-plugin-v1-7-0/hooks/command: line 9: BUILDKITE_PLUGIN_TEST_SUMMARY_FAIL_ON_ERROR: unbound variable
🚨 Error: The command exited with status 1