Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
Signed-off-by: Sayali Gaikawad <gaiksaya@amazon.com>
  • Loading branch information
gaiksaya committed Feb 15, 2025
1 parent ca18267 commit bb33b36
Showing 1 changed file with 21 additions and 22 deletions.
43 changes: 21 additions & 22 deletions tests/jenkins/TestReleaseChores.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -45,27 +45,26 @@ class TestReleaseChores extends BuildPipelineTest {
super.testPipeline('jenkins/release-workflows/release-chores.jenkinsfile', 'tests/jenkins/jenkinsjob-regression-files/integ-test-notification.jenkinsfile')
}

// @Test
// public void testVerifyParameters() {
// binding.setVariable('RELEASE_VERSION', "")
// binding.setVariable('RELEASE_CHORE', "")
// runScript('jenkins/release-workflows/release-chores.jenkinsfile')
// assertThat(getCommandExecutions('error', ''), hasItem('Required parameters are missing. Please provide the mandatory arguments RELEASE_VERSION and RELEASE_CHORE'))
// }

// def getCommandExecutions(methodName, command) {
// def shCommands = helper.callStack.findAll {
// call ->
// call.methodName == methodName
// }.
// collect {
// call ->
// callArgsToString(call)
// }.findAll {
// shCommand ->
// shCommand.contains(command)
// }
@Test
public void testVerifyParameters() {
binding.setVariable('RELEASE_VERSION', "")
binding.setVariable('RELEASE_CHORE', "")
runScript('jenkins/release-workflows/release-chores.jenkinsfile')
assertThat(getCommandExecutions('error', ''), hasItem('Required parameters are missing. Please provide the mandatory arguments RELEASE_VERSION and RELEASE_CHORE'))
}

// return shCommands
// }
def getCommandExecutions(methodName, command) {
def shCommands = helper.callStack.findAll {
call ->
call.methodName == methodName
}.
collect {
call ->
callArgsToString(call)
}.findAll {
shCommand ->
shCommand.contains(command)
}
return shCommands
}
}

0 comments on commit bb33b36

Please sign in to comment.