Skip to content

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
@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