1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2025-01-18 05:18:24 +02:00

karmaExecuteTests: fix multi module execution (#765)

* add test case for multi module execution

* fix multi module issue
This commit is contained in:
Christopher Fenner 2019-06-24 15:29:32 +02:00 committed by GitHub
parent 36c029b344
commit 93e1796455
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 3 deletions

View File

@ -52,4 +52,22 @@ class KarmaExecuteTestsTest extends BasePiperTest {
assertThat(seleniumParams.dockerWorkspace, is('/home/node'))
assertJobStatusSuccess()
}
@Test
void testMultiModules() throws Exception {
stepRule.step.karmaExecuteTests(
script: nullScript,
juStabUtils: utils,
modules: ['./ui-trade', './ui-traderequest']
)
assertThat(shellRule.shell, hasItems(
containsString("cd './ui-trade' && npm run karma"),
containsString("cd './ui-trade' && npm install --quiet")
))
assertThat(shellRule.shell, hasItems(
containsString("cd './ui-traderequest' && npm run karma"),
containsString("cd './ui-traderequest' && npm install --quiet")
))
assertJobStatusSuccess()
}
}

View File

@ -103,10 +103,11 @@ void call(Map parameters = [:]) {
stashContent: config.stashContent
]
for(String path : config.modules){
testJobs["Karma - ${path}"] = {
String modulePath = path
testJobs["Karma - ${modulePath}"] = {
seleniumExecuteTests(options){
sh "cd '${path}' && ${config.installCommand}"
sh "cd '${path}' && ${config.runCommand}"
sh "cd '${modulePath}' && ${config.installCommand}"
sh "cd '${modulePath}' && ${config.runCommand}"
}
}
}