[DO NOT MERGE] Try out allure for test reporting#1183
Draft
Conversation
1 task
2bafa60 to
2c56dc5
Compare
2c56dc5 to
3b88681
Compare
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
Previously we enabled test reporting using dorny/test-reporter. This updates the job summary of the Github actions job. However, this is not shown to users who are not logged into github, which defeats the point, as we wanted this to make the test results visible outside of the team.
This branch uses Allure - a tool that generates HTML reports, and uploads to Github Pages.
This tool supports tests written in multiple languages including python and javascript.
The resulting report is available at https://nhsdigital.github.io/dtos-manage-breast-screening/
To keep things simple, I've restricted this to the UI tests only, since (I assume) granular reporting of unit tests is not useful to anyone who is not a developer on this team. We also have Sonar which can report on test coverage.
The reporting is currently triggered by the CI job, but in practice we could run it from either the main CI/CD, or from a manually triggered workflow (in the latter case we could provide additional metadata identifying a logical "release" we are about to do, e.g. switching on a feature flag)
Running allure
allure run <test command>allure generateis another way to generate the report, assuming you have previously run the test commandallure openopens the reportLinking to Jira tickets
I've annotated the tests with links to Jira tickets. This only shows up when you drill down into the test though.
In order to make the Jira ticket visible at the top level, I've included it in the "epic" name.
Issues with deploying to github pages from github actions
Alternatives to hosting a static site
The output above is what we get using the default "awesome" plugin.
There is also a jira plugin which I haven't tested, that would upload the reports directly to Jira.
Other configuration options
Firstly, we can add arbitrary metadata to improve readability.
The hierarchy of the tests is also customisable - I've gone with epic / feature / story.
We can attach screenshots and files to tests. This could potentially include playwright traces as well. See the allure playwright guide for more info.
There is also a configuration file, currently allurerc.json. The default 'awesome' plugin has these options.
Note: I noticed when I installed allure globally, it didn't pick up my configuration, but after I installed it to node_modules it does.
Jira link
Review notes
TODO:
Review checklist