Skip to content
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

Merged
merged 2 commits into from Jun 23, 2021
Merged

Conversation

ghiculescu
Copy link
Member

@ghiculescu ghiculescu commented Jun 16, 2021

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.

image

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

image

It's not pretty, but it's a big improvement over not seeing the results at all.

ghiculescu added a commit to ghiculescu/qunit-selenium that referenced this pull request Jun 16, 2021
This allows you to print out all the qunit output, not just the summary. See rails/rails#42513 for an example of why.
@ghiculescu ghiculescu force-pushed the ci-ujs-tests branch 3 times, most recently from 1488d18 to 94404f6 Compare June 16, 2021 19:09
@ghiculescu ghiculescu added the ready PRs ready to merge label Jun 16, 2021
ci/qunit-selenium-runner.rb Outdated Show resolved Hide resolved
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
Copy link
Member Author

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?

Copy link
Member Author

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

Copy link
Member

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.

@rafaelfranca rafaelfranca merged commit ee99c89 into rails:main Jun 23, 2021
rafaelfranca added a commit that referenced this pull request Jun 23, 2021
@ghiculescu ghiculescu deleted the ci-ujs-tests branch June 23, 2021 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants