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

test report shows incorrect statistics #83

Open
SiKing opened this issue Jan 8, 2021 · 6 comments
Open

test report shows incorrect statistics #83

SiKing opened this issue Jan 8, 2021 · 6 comments

Comments

@SiKing
Copy link

SiKing commented Jan 8, 2021

My test reports are showing incorrect statistics. Here are the relevant things from my Jenkins log:

<===[JENKINS REMOTING CAPACITY]===>channel started
Executing Maven:  -B -f /var/lib/jenkins/jobs/QA/jobs/...../workspace/pom.xml clean verify
.....
[INFO] --- maven-failsafe-plugin:2.22.2:integration-test (default) @ ..... ---
[INFO] 
[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
.....
[INFO] Results:
[INFO] 
[ERROR] Failures: 
[ERROR]   ......
[ERROR] Errors: 
[ERROR]   ......
[ERROR]   ......
[INFO] 
[ERROR] Tests run: 240, Failures: 1, Errors: 2, Skipped: 8
[INFO] 
[JENKINS] Recording test results
[INFO] 
[INFO] --- serenity-maven-plugin:2.3.9:aggregate (default) @ ..... ---
[INFO] Test results for 240 tests generated in 4 secs in directory: file:/var/lib/jenkins/jobs/QA/jobs/...../workspace/target/site/serenity/
[INFO] -----------------------------------------
[INFO]  SERENITY TESTS : ERROR
[INFO] -----------------------------------------
[INFO] | Tests executed         | 240
[INFO] | Tests passed           | 213
[INFO] | Tests failed           | 18
[INFO] | Tests with errors      | 1
[INFO] | Tests compromised      | 0
[INFO] | Tests pending          | 0
[INFO] | Tests ignored/skipped  | 8

The summary report shows the correct values for failing and broken tests, but in the "Full Failure List" it lists 7 tests.

The full report shows all correct information.

The summary report is what gets mailed to management, and they have questions that I have no answers for. :(

@wakaleo
Copy link
Member

wakaleo commented Jan 8, 2021

Are there data-driven tests in the test suite?

@SiKing
Copy link
Author

SiKing commented Jan 8, 2021

Yes. I have two classes that are @RunWith(SerenityParameterizedRunner.class).

@wakaleo
Copy link
Member

wakaleo commented Jan 8, 2021

Each row in a data-driven test counts as an individual test result.

@SiKing
Copy link
Author

SiKing commented Jan 8, 2021

None of my data-driven tests failed.

Although they are named in the "Full Failure List".

@wakaleo
Copy link
Member

wakaleo commented Jan 9, 2021

The Full Failure List comes from the serenity-summary-report.html template, which is assigned in the SinglePageHtmlReporter.kt class, which in turn uses the FailuresByFeature.kt class. Put a breakpoint here and see if you can see why it is not giving the results you expect for your tests.

@SiKing
Copy link
Author

SiKing commented Jan 11, 2021

I found the culprit!

The tests that are being incorrectly reported are indeed in a class that is @RunWith(SerenityParameterizedRunner.class). I have a couple of tests that expect an exception - a "negative" test. They are decorated something like this:

@Test(expected = UpdateNotFound.class)
public void verify_unpublished_update_is_not_shown() {
    // test body
}

The test passes, that is: the correct exception is thrown. I even see this in the full report:

Expected exception thrown : tasks.update.UpdateNotFound     SUCCESS

However, because the test threw an exception - I guess - it is counted as a failure in the statistics.

Note that I also have similar negative tests in a class that is @RunWith(SerenityRunner.class), and those all report correctly!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants