[
https://issues.apache.org/jira/browse/OOZIE-3148?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16307076#comment-16307076
]
Attila Sasvari commented on OOZIE-3148:
---------------------------------------
- Test does not modify or add new testcases.
[checkForTestcases|https://github.com/apache/oozie/blob/master/bin/test-patch-05-patch-raw-analysis#L115]
gives +1 because {{test-patch-20-tests}} begins with test (its output
contains a typo).
Regarding the modification:
- I checked {{xmllint}} could be used for counting the total number of test
runs. Unfortunately, surefire overwrites XML report of a test class if it needs
to re-run a test. For example:
{{core/target/surefire-reports/TEST-org.apache.oozie.action.hadoop.TestJavaActionExecutor.xml}}
contained only re-run information:
{{TestJavaActionExecutor.testCredentialsSkip}} was re-executed, and as a result
{{tests}} attribute of the testsuite element in the XML was set to "1".
It might also make sense to:
- validate the number of executed test cases - 0 passed tests should not ever
get a +1
- output information about the presence of flaky tests with different color (it
shall not be ignored/green)
> Rerun Failing Tests through Maven surefire
> ------------------------------------------
>
> Key: OOZIE-3148
> URL: https://issues.apache.org/jira/browse/OOZIE-3148
> Project: Oozie
> Issue Type: Improvement
> Components: tests
> Affects Versions: trunk
> Reporter: Attila Sasvari
> Assignee: Attila Sasvari
> Priority: Minor
> Fix For: 5.0.0
>
> Attachments: OOZIE-3148-01.patch, OOZIE-3148-02.patch,
> OOZIE-3148-03.patch, OOZIE-3148-04.patch
>
>
> OOZIE-2817 introduced rerunning of failing test cases in pre-commit builds
> (changed {{bin/test-patch-20-tests}} Bash script).
> It is no longer necessary as OOZIE-3106 upgraded surefire-plugin to 2.20.1
> and since of 2.19.1 version of the maven surefire plugin it is allowed
> rerunning failing tests via {{-Dsurefire.rerunFailingTestsCount=2}} (see
> http://maven.apache.org/surefire/maven-surefire-plugin/examples/rerun-failing-tests.html).
> For example, a test passed in its second run will output on the screen:
> {code}
> Run 1: ...
> Run 2: PASS
> Then this test will be counted as a flaky test. The build will be successful,
> but in the end of the summary of all tests run, the number of flaky tests
> will be output on the screen, for example:
> Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Flakes: 1
> {code}
> We could introduce this mechanism and update {{bin/test-patch-20-tests}}.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)