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

add environment PATH test

Adds an unit test to test that the environment PATH is set and removes
duplicate PATH assertions.
This commit is contained in:
Alejandra Ferreiro Vidal 2018-02-05 15:16:52 +01:00
parent 7f3f76a8ad
commit 5d60bc8199

View File

@ -53,6 +53,17 @@ public class MTABuildTest extends BasePipelineTest {
}
@Test
public void environmentPathTest(){
new File("${currentDir}/mta.yaml") << defaultMtaYaml()
mtaBuildScript.call(buildTarget: 'NEO')
assert jscr.shell[1].contains("PATH=./node_modules/.bin:/usr/bin")
}
@Test
public void straightForwardTest(){
@ -64,8 +75,6 @@ public class MTABuildTest extends BasePipelineTest {
assert jscr.shell[0] =~ /sed -ie "s\/\\\$\{timestamp\}\/`date \+%Y%m%d%H%M%S`\/g" ".*\/mta.yaml"$/
assert jscr.shell[1].contains("PATH=./node_modules/.bin:/usr/bin")
assert jscr.shell[1].contains(' -jar /opt/mta/mta.jar --mtar ')
assert jlr.log.contains( "[mtaBuild] MTA JAR \"/opt/mta/mta.jar\" retrieved from environment.")
@ -86,8 +95,6 @@ public class MTABuildTest extends BasePipelineTest {
assert jscr.shell[0] =~ /sed -ie "s\/\\\$\{timestamp\}\/`date \+%Y%m%d%H%M%S`\/g" ".*\/mta.yaml"$/
assert jscr.shell[1].contains("PATH=./node_modules/.bin:/usr/bin")
assert jscr.shell[1].contains(' -jar /opt/mta/mta.jar --mtar ')
assert mtarFilePath == "${currentDir}/com.mycompany.northwind.mtar"
@ -114,8 +121,6 @@ public class MTABuildTest extends BasePipelineTest {
assert jscr.shell[0] =~ /sed -ie "s\/\\\$\{timestamp\}\/`date \+%Y%m%d%H%M%S`\/g" ".*\/newDir\/mta.yaml"$/
assert jscr.shell[1].contains("PATH=./node_modules/.bin:/usr/bin")
assert jscr.shell[1].contains(' -jar /opt/mta/mta.jar --mtar ')
assert mtarFilePath == "${currentDir}/${newDirName}/com.mycompany.northwind.mtar"
@ -132,8 +137,6 @@ public class MTABuildTest extends BasePipelineTest {
assert jscr.shell[0] =~ /sed -ie "s\/\\\$\{timestamp\}\/`date \+%Y%m%d%H%M%S`\/g" ".*\/mta.yaml"$/
assert jscr.shell[1].contains("PATH=./node_modules/.bin:/usr/bin")
assert jscr.shell[1].contains(' -jar mta.jar --mtar ')
assert jlr.log.contains( "[mtaBuild] Using MTA JAR from current working directory." )
@ -149,8 +152,6 @@ public class MTABuildTest extends BasePipelineTest {
assert jscr.shell[0] =~ /sed -ie "s\/\\\$\{timestamp\}\/`date \+%Y%m%d%H%M%S`\/g" ".*\/mta.yaml"$/
assert jscr.shell[1].contains("PATH=./node_modules/.bin:/usr/bin")
assert jscr.shell[1].contains(' -jar /mylocation/mta/mta.jar --mtar ')
assert jlr.log.contains("[mtaBuild] MTA JAR \"/mylocation/mta/mta.jar\" retrieved from parameters.".toString())