Guest User

Untitled

a guest
Oct 23rd, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. def RunUnitTests() {
  2. println("INFO: Running Unit Tests")
  3.  
  4. def tests = [:]
  5.  
  6. // define unit tests here
  7. tests["GetNodesByLabel"] = {
  8. assert GetNodesByLabel().collect{it.name}.size() > 0
  9. }
  10.  
  11. // end of define unit tests
  12.  
  13.  
  14. tests.each {testName, testScript ->
  15. println("UNITTEST [${testName}]: Run...")
  16. testScript()
  17. println("UNITTEST [${testName}]: Passed")
  18. }
  19.  
  20. println("INFO: End of Unit Tests, all tests should have passed")
  21. }
  22.  
  23. RunUnitTests()
  24.  
  25.  
  26.  
  27. if(build.buildVariableResolver.resolve("HandleUnitTests") == "TestOnly"){
  28. println("WARNING: Run tests only, skip running main script")
  29. return 0
  30. }
  31.  
  32.  
  33. // Put main script here
Add Comment
Please, Sign In to add comment