mirror of
https://github.com/SAP/jenkins-library.git
synced 2025-01-30 05:59:39 +02:00
karmaExecuteTests: fix multi module execution (#765)
* add test case for multi module execution * fix multi module issue
This commit is contained in:
parent
36c029b344
commit
93e1796455
@ -52,4 +52,22 @@ class KarmaExecuteTestsTest extends BasePiperTest {
|
|||||||
assertThat(seleniumParams.dockerWorkspace, is('/home/node'))
|
assertThat(seleniumParams.dockerWorkspace, is('/home/node'))
|
||||||
assertJobStatusSuccess()
|
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()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -103,10 +103,11 @@ void call(Map parameters = [:]) {
|
|||||||
stashContent: config.stashContent
|
stashContent: config.stashContent
|
||||||
]
|
]
|
||||||
for(String path : config.modules){
|
for(String path : config.modules){
|
||||||
testJobs["Karma - ${path}"] = {
|
String modulePath = path
|
||||||
|
testJobs["Karma - ${modulePath}"] = {
|
||||||
seleniumExecuteTests(options){
|
seleniumExecuteTests(options){
|
||||||
sh "cd '${path}' && ${config.installCommand}"
|
sh "cd '${modulePath}' && ${config.installCommand}"
|
||||||
sh "cd '${path}' && ${config.runCommand}"
|
sh "cd '${modulePath}' && ${config.runCommand}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user