At time of writing, on Heroku, TAP output lines that have leading whitespace are not valid. Heroku CI's default test command on the ruby-buildpack auto-indents all test output, so the TAP output was invalid due to these auto-indents.
To workaround the auto-indent and produce valid TAP output, specify a custom test script in app.json
. Using a custom test script bypasses the ruby-buildpack's auto-indent.
Here's an example app.json
with a custom test script bin/rspec
:
{
"environments": {
"test": {
"addons": ["heroku-postgresql:in-dyno"],
"buildpacks": [
{ "url": "heroku/ruby" },
{ "url": "https://github.com/heroku/heroku-buildpack-google-chrome" }
],
"env": {
"DISABLE_SPRING": "true"
},
"scripts": {
"test": "bin/rspec"
}
}
}
}
Here's an example of valid TAP (version 12) output that Heroku CI will process to show the enhanced UI (you may need to refresh the page to see the enhanced UI if you've been watching a build in progress):
# Randomized with seed 12345
1..2
ok 1 - PayHelper#js_host returns production host as default
not ok 2 - PayHelper#js_url returns production v9 URL as default
#
# PayHelper#js_url returns production v9 URL as default
# Failure/Error: expect(helper.js_url).to eq 'https://example.com/v9/'
#
# expected: value != "https://example.com/v9/"
# got: "https://example.com/v9.0/"
#
# (compared using ==)
# # ./spec/helpers/pay_helper_spec.rb:15:in `block (3 levels) in <top (required)>'
# # -e:1:in `<main>'
1..2
# Randomized with seed 12345
Note, the above output is TAP specification version 12, though I understand Heroku also supports TAP specification version 13.