Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def RunUnitTests() {
- println("INFO: Running Unit Tests")
- def tests = [:]
- // define unit tests here
- tests["GetNodesByLabel"] = {
- assert GetNodesByLabel().collect{it.name}.size() > 0
- }
- // end of define unit tests
- tests.each {testName, testScript ->
- println("UNITTEST [${testName}]: Run...")
- testScript()
- println("UNITTEST [${testName}]: Passed")
- }
- println("INFO: End of Unit Tests, all tests should have passed")
- }
- RunUnitTests()
- if(build.buildVariableResolver.resolve("HandleUnitTests") == "TestOnly"){
- println("WARNING: Run tests only, skip running main script")
- return 0
- }
- // Put main script here
Add Comment
Please, Sign In to add comment