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

HDDS-10080. Let junit.sh fail if no tests were matched in repeated run #6036

Merged
merged 1 commit into from
Jan 22, 2024

Conversation

adoroszlai
Copy link
Contributor

What changes were proposed in this pull request?

Repeated tests in junit.sh should fail fast if no tests are executed in the first iteration. The goal is to indicate if the wrong test filter was used (e.g. abstract test class).

https://issues.apache.org/jira/browse/HDDS-10080

How was this patch tested?

Local tests

Non-existent class:

$ ITERATIONS=3 OZONE_REPO_CACHED=true \
  ./hadoop-ozone/dev-support/checks/junit.sh \
  -am -pl :hdds-config -Dtest='NoSuchTest'
...
[INFO] BUILD SUCCESS
...
Iteration 1 exit code: 1

$ cat target/unit/iteration1/summary.txt 
No tests were run

Non-existent method in existing class:

$ ITERATIONS=3 OZONE_REPO_CACHED=true \
  ./hadoop-ozone/dev-support/checks/junit.sh \
  -am -pl :hdds-config -Dtest='TestConfigFileAppender#noSuchTest'
...
[INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
...
[INFO] BUILD SUCCESS
...
Iteration 1 exit code: 1

$ cat target/unit/iteration1/summary.txt 
No tests were run

Valid test class:

$ ITERATIONS=3 OZONE_REPO_CACHED=true \
  ./hadoop-ozone/dev-support/checks/junit.sh \
  -am -pl :hdds-config -Dtest='TestConfigFileAppender'
...

$ cat target/unit/summary.txt                                                                                                                   
Iteration 1 exit code: 0
Iteration 2 exit code: 0
Iteration 3 exit code: 0

flaky-test-check

Used flaky-test-check from HDDS-10079.

Non-existent test method:
https://github.com/adoroszlai/ozone/actions/runs/7584500146/job/20658460541

Abstract test class:
https://github.com/adoroszlai/ozone/actions/runs/7584281925/job/20657631720

Specific method in abstract test class:
https://github.com/adoroszlai/ozone/actions/runs/7584288405/job/20657650841

Valid test class and method:
https://github.com/adoroszlai/ozone/actions/runs/7584274733/job/20657610659

Regular CI

https://github.com/adoroszlai/ozone/actions/runs/7584240425

Copy link
Contributor

@sadanand48 sadanand48 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @adoroszlai for the fix, LGTM

@adoroszlai adoroszlai merged commit 4195ef5 into apache:master Jan 22, 2024
14 checks passed
@adoroszlai adoroszlai deleted the HDDS-10080 branch January 22, 2024 08:30
@adoroszlai
Copy link
Contributor Author

Thanks @sadanand48 for the review.

Tejaskriya pushed a commit to Tejaskriya/ozone that referenced this pull request Jan 24, 2024
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.

2 participants