From 85526ccee61b0ffc58c9b03350a0c5652dbff9bf Mon Sep 17 00:00:00 2001 From: Matt Rendina Date: Thu, 29 Nov 2018 14:18:39 -0500 Subject: Update docs to reflect test_cmds behavior change. --- README.md | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index f449238..aa4675e 100644 --- a/README.md +++ b/README.md @@ -114,7 +114,7 @@ It has the following properties: | `conda_ver` | string | no | The version of conda to use when creating environments to host the build. If not supplied, a recent version of conda will be obtained. | | `env_vars` | list of strings | no | Allow configuration of the shell environment in which build and test commands are run. Of note: | | `build_cmds` | list of strings | yes | These commands are run in their order of appearance in this list with the default shell environment and any modifications to that environment provided by the `env_vars` list described above. | -| `test_cmds` | list of strings | no | These commands are run in their order of appearance in this list with the default shell environment plus any modifications to that environment provided by the `env_vars` list described above. | +| `test_cmds` | list of strings | no | These commands are run in their order of appearance in this list with the default shell environment plus any modifications to that environment provided by the `env_vars` list described above. | | `failedFailureNewThresh` | integer | no | (Default is no threshold set.) The threshold for the number of newly appearing test failures that will cause the build to be flagged as "FAILED". | | `failedFailureThresh` | integer | no | (Default is no threshold set.) The threshold for the number of test failures that will cause the build to be flagged as "FAILED". | | `failedUnstableNewThresh` | integer | no | (Default is no threshold set.) The threshold for the number of newly appearing test failures that will cause the build to be flagged as "UNSTABLE". | @@ -127,26 +127,9 @@ It has the following properties: ### Test Results Customization -Under certain circumstances it might be desirable force a job to produce a PASSING status even if a certain number of tests are failing. - -This approach may be seen in the following documentation for the xUnit plugin which is used to provide the test report functionality in the CI system. The heading "Accept a Baseline". https://jenkins.io/blog/2016/10/31/xunit-reporting/ describes the scenario and how to set the appropriate thresholds. - -Two things need to be done to allow this type of build/test classification. - -* The test reporting thresholds must be set correctly to allow a certain number of 'expected failures'. -* No stages in the build may return a failure status - * The implication of this requirement is that any commands run, in the test_cmds list in particular, must not return an error code. Tools such as pytest return an error status if any tests in the suite fail and so will cause that stage in the Jenkins job to show a failure status. NOTE: The most severe failure status in any build stage is always propagated up to be reflected in the overall job status. - * To prevent the test execution command in this case from causing the entire job to return a FAILURE status, the command may be adjusted to use the following construction. - - ``` || true``` - - i.e. in following the example job definition from above: - - ```"pytest tests --basetemp=tests_output --junitxml results.xml --remote-data || true"``` - - This will cause the command to always return a success status, even if the pytest invocation itself returns and error code. - -WARNING: Adding `|| true` to arbitrary commands will mask problems and make diagnosing failures more difficult than necessary. Only use this approach in specific instances where it is required to suppress unnecessary failure return values from testing tools that cannot be suppressed in any other way. +The following documentation for the xUnit plugin which is used to provide the test report functionality in the CI system may be useful when customizing test thresholds. The heading "Accept a Baseline". https://jenkins.io/blog/2016/10/31/xunit-reporting/ describes the scenario and how to set the appropriate thresholds. + +The return code of all commands specified in the `test_cmds` list are explicitly ignored and do not affect the overall job status (Success/Unstable/Failure) in Jenkins. ### Build Sequence -- cgit