From b1a2622dc91df0476208479cfaed9464bc261bc3 Mon Sep 17 00:00:00 2001 From: Matt Rendina Date: Tue, 20 Nov 2018 11:54:19 -0500 Subject: Update README.md --- README.md | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e66be4d..ce182f3 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,14 @@ An example job that builds three parallel combinations and runs tests on one of ```groovy // Obtain files from source control system. if (utils.scm_checkout()) return - + + +// Allow modification of the job configuration, affects all relevant build configs. +// Pass this object in the argument list to the`run()` function below to apply these settings to the job's execution. +jobconfig = new JobConfig() +jobconfig.post_test_summary = true + + // Config data to share between builds. CFLAGS = 'CFLAGS="-m64"' LDFLAGS = 'LDFLAGS="-m64"' @@ -56,7 +63,8 @@ bc2.build_cmds[0] = "${configure_cmd} --O3" // Iterate over configurations that define the (distibuted) build matrix. // Spawn a host of the given nodetype for each combination and run in parallel. -utils.run([bc0, bc1, bc2]) +// Also apply the job configuration defined in `jobconfig` above. +utils.run([bc0, bc1, bc2, jobconfig]) ``` ### Utils Library @@ -71,10 +79,20 @@ The `utils` library provides several functions: | `utils.copy()` | Accepts: | | `utils.run(config_list, concurrent=true)` | Accepts: +#### JobConfig Class +This class contains properties that may be adjusted to control the behavior of the overall Jenkins job. +A JobConfig object must be created as shown in the example above and then passed in to the `run()` function in the list of BuildConfig objects for the customizations to be honored. + +It has the following properties: + +| Member | Type | Required | Purpose | +| --- | --- | --- | --- | +| `post_test_summary` | boolean | no | When `true`, will cause the creation of a Github issue on the project's repository containing a summary of test results produced by all build configurations hosted in the the job if any tests returned a `failure` or `error` status. Default is false, meaning no summary issues will be created upon test failures or errors. When set to `true`, if no test failures or errors occur, a summary post will not be generated. | + #### BuildConfig Class The utils library also provides the definition of a class called BuildConfig that may be used to create build configuration objects used to define build tasks to be run on various hosts. -It has the following members: +It has the following properties: | Member | Type | Required | Purpose | | --- | --- | --- | --- | @@ -96,6 +114,7 @@ It has the following members: | `skippedUnstableNewThresh` | integer | no | (Default is no threshold set.) The threshold for the number of newly appearing skipped tests that will cause the build to be flagged as "UNSTABLE". | | `skippedUnstableThresh` | integer | no | (Default is no threshold set.) The threshold for the number of skipped tests that will cause the build to be flagged as "UNSTABLE". | + ### 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. -- cgit