-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update new testing framework driver stub
- Loading branch information
William McLendon
committed
Nov 13, 2020
1 parent
2dc49f7
commit 321c7c9
Showing
7 changed files
with
334 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
#!/usr/bin/env groovy | ||
/* | ||
* SEMS Pipeline Framework Infrastructure (SPiFI) | ||
* | ||
* Copyright 2020 National Technology & Engineering Solutions of Sandia, LLC (NTESS). | ||
* Under the terms of Contract DE-NA0003525 with NTESS, the U.S. Government retains | ||
* certain rights in this software. | ||
* | ||
* LICENSE (3-Clause BSD) | ||
* ---------------------- | ||
* Copyright 2020 National Technology & Engineering Solutions of Sandia, LLC (NTESS). | ||
* Under the terms of Contract DE-NA0003525 with NTESS, the U.S. Government retains | ||
* certain rights in this software. | ||
* | ||
* Redistribution and use in source and binary forms, with or without modification, | ||
* are permitted provided that the following conditions are met: | ||
* | ||
* 1. Redistributions of source code must retain the above copyright notice, this | ||
* list of conditions and the following disclaimer. | ||
* | ||
* 2. Redistributions in binary form must reproduce the above copyright notice, | ||
* this list of conditions and the following disclaimer in the documentation | ||
* and/or other materials provided with the distribution. | ||
* | ||
* 3. Neither the name of the copyright holder nor the names of its contributors | ||
* may be used to endorse or promote products derived from this software without | ||
* specific prior written permission. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR | ||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
* | ||
* Contact | ||
* ------- | ||
* William C. McLendon III (wcmclen@sandia.gov) | ||
*/ | ||
|
||
/** | ||
* This test loads SPiFI using a specific version and accesses / prints out | ||
* the version number. | ||
*/ | ||
properties([ | ||
parameters([ | ||
string(name: 'SPiFI_VERSION', | ||
defaultValue: 'SPiFI@master', | ||
trim: true, | ||
description: 'The SPiFI version to load') | ||
]), | ||
]) | ||
|
||
|
||
// Fail if required parameters are missing. | ||
assert params.containsKey("SPiFI_VERSION"), "Missing required parameter: SPiFI_VERSION" | ||
|
||
// Grab a handle to all of SPiFI | ||
def libspifi = library(params.SPiFI_VERSION).gov.sandia.sems.spifi | ||
|
||
|
||
node("master || RHEL6 || RHEL7 || OS_RHEL6 || OS_RHEL7") | ||
{ | ||
stage("Get Version") | ||
{ | ||
// Print out full version inside a println | ||
println "Loaded SPiFI version : ${libspifi.Info.version()}" | ||
|
||
// Grab individual version components | ||
Integer version_major = libspifi.Info.version_major() | ||
Integer version_minor = libspifi.Info.version_minor() | ||
Integer version_patch = libspifi.Info.version_patch() | ||
|
||
// Multi-line print | ||
println "Version breakdown:\n" + | ||
"- major: ${version_major}\n" + | ||
"- minor: ${version_minor}\n" + | ||
"- patch: ${version_patch}" | ||
} // End Stage | ||
|
||
} // End Node | ||
|
||
|
||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,159 @@ | ||
#!/usr/bin/env groovy | ||
/* | ||
* SEMS Pipeline Framework Infrastructure (SPiFI) | ||
* | ||
* Copyright 2020 National Technology & Engineering Solutions of Sandia, LLC (NTESS). | ||
* Under the terms of Contract DE-NA0003525 with NTESS, the U.S. Government retains | ||
* certain rights in this software. | ||
* | ||
* LICENSE (3-Clause BSD) | ||
* ---------------------- | ||
* Copyright 2020 National Technology & Engineering Solutions of Sandia, LLC (NTESS). | ||
* Under the terms of Contract DE-NA0003525 with NTESS, the U.S. Government retains | ||
* certain rights in this software. | ||
* | ||
* Redistribution and use in source and binary forms, with or without modification, | ||
* are permitted provided that the following conditions are met: | ||
* | ||
* 1. Redistributions of source code must retain the above copyright notice, this | ||
* list of conditions and the following disclaimer. | ||
* | ||
* 2. Redistributions in binary form must reproduce the above copyright notice, | ||
* this list of conditions and the following disclaimer in the documentation | ||
* and/or other materials provided with the distribution. | ||
* | ||
* 3. Neither the name of the copyright holder nor the names of its contributors | ||
* may be used to endorse or promote products derived from this software without | ||
* specific prior written permission. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR | ||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
* | ||
* Contact | ||
* ------- | ||
* William C. McLendon III (wcmclen@sandia.gov) | ||
*/ | ||
|
||
/** | ||
* Unittest: SPiFI_test_driver_version | ||
* | ||
* This test is the main driver test for a specified VERSION of SPiFI | ||
* - This test will load in and use the JobLauncher as part of | ||
* its core work, but will use minimal features from this tool. If | ||
* something is broken with the minimal JobLauncher class we'll see | ||
* this evidenced by just about everything failing. | ||
* | ||
*/ | ||
properties([ | ||
parameters([ | ||
string(name: 'SPiFI_VERSION', | ||
defaultValue: 'SPiFI-DEV@master', | ||
trim: true, | ||
description: 'The SPiFI version to load') | ||
]), | ||
]) | ||
|
||
String param_spifi_version = "SPiFI@master" | ||
if( params.containsKey("SPiFI_VERSION") ) | ||
{ | ||
param_spifi_version = params.SPiFI_VERSION | ||
} | ||
|
||
|
||
// Grab a handle to all of SPiFI | ||
def libspifi = library(param_spifi_version).gov.sandia.sems.spifi | ||
|
||
|
||
// Print timestamps to console log | ||
timestamps() | ||
{ | ||
|
||
|
||
node() | ||
{ | ||
|
||
/** | ||
* Executes 'helpers' | ||
* | ||
*/ | ||
stage("Test Helpers") | ||
{ | ||
// Note: the `build` command returns a RunWrapper object. Information on RunWrapper's API | ||
// is here: https://javadoc.jenkins.io/plugin/workflow-support/org/jenkinsci/plugins/workflow/support/steps/build/RunWrapper.html | ||
|
||
// Test the selectable_status helper. | ||
def rval = null | ||
rval = run_simple_job("SPiFI_test_helper_sample_job") | ||
rval = run_simple_job("SPiFI_test_helper_selectable_status") | ||
|
||
rval = run_simple_job("SPiFI_test_helper_pass_every_third") | ||
rval = run_simple_job("SPiFI_test_helper_pass_every_third") | ||
rval = run_simple_job("SPiFI_test_helper_pass_every_third") | ||
|
||
} // End Stage | ||
|
||
|
||
stage("Test SPiFI Core") | ||
{ | ||
} // End Stage | ||
|
||
|
||
stage("Test Examples") | ||
{ | ||
} // End Stage | ||
|
||
|
||
stage("Test Experimental") | ||
{ | ||
} // End Stage | ||
|
||
|
||
stage("Reporting") | ||
{ | ||
} // End Stage | ||
|
||
} // End Node | ||
} // End Timestamps | ||
|
||
|
||
|
||
//////////////////////////////////////////////////////////////////////////////// | ||
// | ||
// H E L P E R F U N C T I O N S | ||
// | ||
//////////////////////////////////////////////////////////////////////////////// | ||
|
||
|
||
/** | ||
* | ||
* | ||
*/ | ||
Map run_simple_job(String job_name) | ||
{ | ||
Map output = [:] | ||
output.raw = build(job: job_name, propagate: false, wait: true) | ||
|
||
if( "SUCCESS" == output.raw.getResult() ) | ||
{ | ||
// TODO: handle job success | ||
output.body = "Job `${job_name}` was successful (${output.raw.getResult()})" | ||
} | ||
else | ||
{ | ||
// TODO: handle job failure | ||
output.body = "Job `${job_name}` did not succeed (${output.raw.getResult()})" | ||
} | ||
|
||
return output | ||
} | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
#!/usr/bin/env groovy | ||
/* | ||
* SEMS Pipeline Framework Infrastructure (SPiFI) | ||
* | ||
* Copyright 2020 National Technology & Engineering Solutions of Sandia, LLC (NTESS). | ||
* Under the terms of Contract DE-NA0003525 with NTESS, the U.S. Government retains | ||
* certain rights in this software. | ||
* | ||
* LICENSE (3-Clause BSD) | ||
* ---------------------- | ||
* Copyright 2020 National Technology & Engineering Solutions of Sandia, LLC (NTESS). | ||
* Under the terms of Contract DE-NA0003525 with NTESS, the U.S. Government retains | ||
* certain rights in this software. | ||
* | ||
* Redistribution and use in source and binary forms, with or without modification, | ||
* are permitted provided that the following conditions are met: | ||
* | ||
* 1. Redistributions of source code must retain the above copyright notice, this | ||
* list of conditions and the following disclaimer. | ||
* | ||
* 2. Redistributions in binary form must reproduce the above copyright notice, | ||
* this list of conditions and the following disclaimer in the documentation | ||
* and/or other materials provided with the distribution. | ||
* | ||
* 3. Neither the name of the copyright holder nor the names of its contributors | ||
* may be used to endorse or promote products derived from this software without | ||
* specific prior written permission. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR | ||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
* | ||
* Contact | ||
* ------- | ||
* William C. McLendon III (wcmclen@sandia.gov) | ||
*/ | ||
|
||
/** | ||
* SPiFI_test_helper_sample_job | ||
* | ||
* This is a sample job that can be launched by the testing infrastructure. | ||
* We would use this to test the Job Launcher or Examples | ||
* | ||
*/ | ||
timestamps() | ||
{ | ||
|
||
node() | ||
{ | ||
|
||
stage("A") | ||
{ | ||
println("Stage A executed") | ||
} | ||
|
||
} // End stage node | ||
|
||
} // End stage timestamps | ||
|
File renamed without changes.
Oops, something went wrong.