New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Output UJs test failures in CI #42513
Conversation
This allows you to print out all the qunit output, not just the summary. See rails/rails#42513 for an example of why.
1488d18
to
94404f6
Compare
ci/qunit-selenium-runner.rb
Outdated
require "webdrivers" | ||
# This class based on https://github.com/smontanari/qunit-selenium, with a few tweaks to make it easier to read output. | ||
# Copyright (c) 2014 Silvio Montanari | ||
# License: MIT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rafaelfranca is this okay, or do we need the full text?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the most similar scenario to this that I could find: https://github.com/rails/rails/blob/main/guides/rails_guides/levenshtein.rb#L6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reading the license I believe it needs to be the full text.
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
Output UJs test failures in CI
Found out in #42512 that the test failures from UJs tests don't print out in CI, or when you run the tests locally. The number of assertions shows, but not which individual ones broke.
Currently we use https://github.com/smontanari/qunit-selenium which is a thin wrapper over
::Selenium::WebDriver
that parses the results. I have taken the relevant code from that gem and brought it in house, then added some extra methods to read the raw output from the test results, and print it out when tests fail. I've also offered the changes upstream (smontanari/qunit-selenium#3), but as the gem hasn't been updated in 7 years I thought it would be better to include them directly in here.Here's an example of the output you'll now get when tests fail: https://gist.github.com/ghiculescu/3cdaf74b051b8ce022f79f39285ac4f8
Here's an example in CI: https://buildkite.com/rails/rails/builds/78360#87935aa0-3d6c-44cb-b7f4-384bc59117db
It's not pretty, but it's a big improvement over not seeing the results at all.