-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[Bug]: Mismatched test id between onTestEnd custom reporter hook and generated HTML test report #30430
Comments
The format of the html report url is an implementation details and it doesn't have to match test ids from the reporter API. What is the use case where you need this two ids to be the same? |
I'm running the tests in ci/cd every 2 hours. After tests finish the resulting logs from onTestEnd are uploaded to ElasticSearch using my custom reporter that also generates a URL pointing to exact test case in the HTML report. The generated HTML report is uploaded to our http server to the correct directory that matches the URL sent to Elastic. Next we have a grafana dashboard that shows the test results using elastic as data source. Finally we have a team of people monitoring grafana for failures in tests and using that link with ID they can jump immediately from filtered grafana results to failed test report (this is especially useful when we sometimes have over 500 failed tests). Below is the simplified fragment of code responsible for building log for ElasticSearch:
If needed I can create a visual demo (short video) of this usecase to better show how this works in action |
I believe that this commit caused the IDs to be mismatched: d0cc587 |
Instead of the test id attribute you can construct a filter in the search query of the URL for the test/spec file that you want to highlight, see this comment for examples. Will that work for you? |
Thanks for suggestion! I will need to check if it will be possible to adapt my work flow for this, but it will still be one more click to do instead of presenting the report directly after clicking. But i still don't quite understand this change. Why the testIds needs to be different between custom reporters and built in reporters? Can you explain a little bit more why this chance was introduced? And if it's theoretically possible to revert back to previous behavior in the future updates? Thank you very much for your help and time, I really appreciate it ☺ |
Thank you very much for quick fix 😃. I will update from 1.42.1 to 1.44 as soon as it releases and test if it works in my workflow. |
Version
1.43.1
Steps to reproduce
Expected behavior
I expect to have the same test id between HTML report and custom reporter.
Actual behavior
The test id returned by custom reporter are not the same as shown in HTML reporter. This was not the case in 1.42.1.
Additional context
Screenshot showing the same IDs from 1.42.1:
Screenshot showing different IDs from 1.43.1:
Environment
The text was updated successfully, but these errors were encountered: