-
Notifications
You must be signed in to change notification settings - Fork 41.1k
Add out of the box Allure support #45228
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
Comments
Thanks for the suggestion, but I consider this to be out of scope for Spring Boot. I also don't think we can safely add AspectJ's weaver to Surefire's classpath for every project. For these reasons, I think it's better that using Allure remains opt-in by users making the necessary configuration changes themselves. |
Can you please tell me in more detail why Allure is outside the scope of the Spring-boot project? In my opinion Spring-boot provides a convenient configurable ecosystem for building applications, part of which is the testing stage and analysis of problems as a result of the testing. If I'm totally wrong, why not to start to provide this feature?
True, but it can be done by providing an additional maven profile with Surefire configuration disabled by default or as a part of spring-boot-initializer template. |
Reporting of test results isn't something that Spring Boot deals with. We consider that role to be fulfilled by the test framework (typically JUnit) and the build tool (typically Maven or Gradle). There are also other tools in this space such as Develocity that can analyse tests and their trends for which we also don't provide any out-of-the-box support. |
Introduction
Hi there!
I propose to add an improvement in the form of out-of-the-box support for allure-java functionality and allure-report generation.
At the moment, any project that contains a large number of unit and integration tests needs a reporting system for a clear display of execution results and troubleshooting.
Allure is one of the most popular systems for this purpose.
However, connecting Allure reports requires a fairly large number of configurations at the project builder level, which takes time and requires a bit of knowledge how surefire and javaagent works.
By the way Allure integrates perfectly with Spring-boot application projects.
Motivation
Spring-boot is objectively the best framework project for building integration tests projects that are separated from the application code, for example for rust/с++ projects. For my region this is the most common practice, because it is much easier to find a QA engineer in java rather than in the original application stack.
Also gaining popularity in the fintech sector is the practice of shift-left for Spring-boot applications, when high-level integration tests aimed at testing builded application with full Application Context and infrastructure in TestContainers. These tests are also usually writes as a module in the Spring-boot application project.
Allure is currently the nobrainer for integrate with test management systems and displaying reports on the tests you've run, so why not integrate both projects?
Allure-java in the nutshell
Allure-java is an java ecosystem for preparing data in Allure-report data model that displays all the interesting information about the tests:
Allure-java is regularly updated, and is primarily maintained by @baev and community.
The project contains excellent documentation - https://allurereport.org/docs/
Finally Allure-java integrates well by modular structure with components that are already in the spring-boot project:
etc
Allure-report in the nutshell
First of all, Allure-report is a data model describing the life cycle of a test.
Docs about data model for tests - https://allurereport.org/docs/how-it-works-test-result-file/
Also, the documentation of other sections contains descriptions of data models for other lifecycle objects.
A separate maven/gradle plugin is used to generate rich html from Allure-report data and start a local server.
https://github.com/allure-framework/allure-maven
https://github.com/allure-framework/allure-gradle
What I propose to add in the details
Add
allure-bom
tospring-boot-dependencies
independencyManagement
nodeAdd
allure.version
property version tospring-boot-dependencies
Add
allure-junit5
as dependency to thespring-boot-starter-test
Add
maven-surefire-plugin
configuration to thespring-boot-starter-parent
, becauseallure-java
usingaspectj
for working with annotations.Add
allure-maven
plugin tospring-boot-dependencies
inpluginManagement
nodeAdd
allure-maven
plugin configuration to thespring-boot-starter-parent
, because sometimes you want to generate reports locally for sure in case of troubleshootingProfit
A lot of configurations are provided out of the box, which saves time on project setup. Spring-boot projects get detailed and beautiful Allure-reports, which help to understand what the hell wrong with unit and integration tests.
The text was updated successfully, but these errors were encountered: