diff --git a/tests/functions.Tests.ps1 b/tests/functions.Tests.ps1 index 915aba478d..bdecfa23bb 100644 --- a/tests/functions.Tests.ps1 +++ b/tests/functions.Tests.ps1 @@ -21,7 +21,7 @@ Describe "[functions > $global:TEST_TAG] build image" { } # Only test on Java 21, one JDK is enough to test all versions -Describe "[functions > $global:TEST_TAG] Check-VersionLessThan" -Skip:(-not $global:TEST_TAG.StartsWith('jdk21-')) { +Describe "[functions > $global:TEST_TAG] Check-VersionLessThan" -Skip:(-not $global:TEST_TAG.Contains('jdk21-')) { It 'exit codes work' { docker run --rm $global:SUT_IMAGE "exit -1" $LastExitCode | Should -Be -1 @@ -74,7 +74,7 @@ Describe "[functions > $global:TEST_TAG] Check-VersionLessThan" -Skip:(-not $glo } # Only test on Java 21, one JDK is enough to test all versions -Describe "[functions > $global:TEST_TAG] Copy-ReferenceFile" -Skip:(-not $global:TEST_TAG.StartsWith('jdk21-')) { +Describe "[functions > $global:TEST_TAG] Copy-ReferenceFile" -Skip:(-not $global:TEST_TAG.Contains('jdk21-')) { It 'build test image' { $exitCode, $stdout, $stderr = Build-DockerChild $global:SUT_IMAGE $PSScriptRoot/functions $exitCode | Should -Be 0 diff --git a/tests/plugins-cli.Tests.ps1 b/tests/plugins-cli.Tests.ps1 index 5c760f87ef..4e9d001a4d 100644 --- a/tests/plugins-cli.Tests.ps1 +++ b/tests/plugins-cli.Tests.ps1 @@ -29,7 +29,7 @@ Describe "[plugins-cli > $global:TEST_TAG] cleanup container" { } # Only test on Java 21, one JDK is enough to test all versions -Describe "[plugins-cli > $global:TEST_TAG] plugins are installed with jenkins-plugin-cli" -Skip:(-not $global:TEST_TAG.StartsWith('jdk21-')) { +Describe "[plugins-cli > $global:TEST_TAG] plugins are installed with jenkins-plugin-cli" -Skip:(-not $global:TEST_TAG.Contains('jdk21-')) { It 'builds child image' { $exitCode, $stdout, $stderr = Build-DockerChild $global:SUT_IMAGE-plugins-cli $PSScriptRoot/plugins-cli $exitCode | Should -Be 0 @@ -64,7 +64,7 @@ Describe "[plugins-cli > $global:TEST_TAG] plugins are installed with jenkins-pl } # Only test on Java 21, one JDK is enough to test all versions -Describe "[plugins-cli > $global:TEST_TAG] plugins are installed with jenkins-plugin-cli with non-default REF" -Skip:(-not $global:TEST_TAG.StartsWith('jdk21-')) { +Describe "[plugins-cli > $global:TEST_TAG] plugins are installed with jenkins-plugin-cli with non-default REF" -Skip:(-not $global:TEST_TAG.Contains('jdk21-')) { It 'builds child image' { $exitCode, $stdout, $stderr = Build-DockerChild $global:SUT_IMAGE-plugins-cli-ref $PSScriptRoot/plugins-cli/ref $exitCode | Should -Be 0 @@ -102,7 +102,7 @@ Describe "[plugins-cli > $global:TEST_TAG] plugins are installed with jenkins-pl } # Only test on Java 21, one JDK is enough to test all versions -Describe "[plugins-cli > $global:TEST_TAG] plugins are installed with jenkins-plugin-cli from a plugins file" -Skip:(-not $global:TEST_TAG.StartsWith('jdk21-')) { +Describe "[plugins-cli > $global:TEST_TAG] plugins are installed with jenkins-plugin-cli from a plugins file" -Skip:(-not $global:TEST_TAG.Contains('jdk21-')) { It 'builds child image' { $exitCode, $stdout, $stderr = Build-DockerChild $global:SUT_IMAGE-plugins-cli $PSScriptRoot/plugins-cli $exitCode | Should -Be 0 @@ -140,7 +140,7 @@ Describe "[plugins-cli > $global:TEST_TAG] plugins are installed with jenkins-pl } # Only test on Java 21, one JDK is enough to test all versions -Describe "[plugins-cli > $global:TEST_TAG] plugins are installed with jenkins-plugin-cli even when already exist" -Skip:(-not $global:TEST_TAG.StartsWith('jdk21-')) { +Describe "[plugins-cli > $global:TEST_TAG] plugins are installed with jenkins-plugin-cli even when already exist" -Skip:(-not $global:TEST_TAG.Contains('jdk21-')) { It 'builds child image' { $exitCode, $stdout, $stderr = Build-DockerChild $global:SUT_IMAGE-plugins-cli $PSScriptRoot/plugins-cli $exitCode | Should -Be 0 @@ -167,7 +167,7 @@ Describe "[plugins-cli > $global:TEST_TAG] clean work directory" { } # Only test on Java 21, one JDK is enough to test all versions -Describe "[plugins-cli > $global:TEST_TAG] plugins are getting upgraded but not downgraded" -Skip:(-not $global:TEST_TAG.StartsWith('jdk21-')) { +Describe "[plugins-cli > $global:TEST_TAG] plugins are getting upgraded but not downgraded" -Skip:(-not $global:TEST_TAG.Contains('jdk21-')) { It 'builds child image' { # Initial execution $exitCode, $stdout, $stderr = Build-DockerChild $global:SUT_IMAGE-plugins-cli $PSScriptRoot/plugins-cli @@ -218,7 +218,7 @@ Describe "[plugins-cli > $global:TEST_TAG] clean work directory" { } # Only test on Java 21, one JDK is enough to test all versions -Describe "[plugins-cli > $global:TEST_TAG] do not upgrade if plugin has been manually updated" -Skip:(-not $global:TEST_TAG.StartsWith('jdk21-')) { +Describe "[plugins-cli > $global:TEST_TAG] do not upgrade if plugin has been manually updated" -Skip:(-not $global:TEST_TAG.Contains('jdk21-')) { It 'builds child image' { $exitCode, $stdout, $stderr = Build-DockerChild $global:SUT_IMAGE-plugins-cli $PSScriptRoot/plugins-cli @@ -268,7 +268,7 @@ Describe "[plugins-cli > $global:TEST_TAG] clean work directory" { } # Only test on Java 21, one JDK is enough to test all versions -Describe "[plugins-cli > $global:TEST_TAG] upgrade plugin even if it has been manually updated when PLUGINS_FORCE_UPGRADE=true" -Skip:(-not $global:TEST_TAG.StartsWith('jdk21-')) { +Describe "[plugins-cli > $global:TEST_TAG] upgrade plugin even if it has been manually updated when PLUGINS_FORCE_UPGRADE=true" -Skip:(-not $global:TEST_TAG.Contains('jdk21-')) { It 'builds child image' { $exitCode, $stdout, $stderr = Build-DockerChild $global:SUT_IMAGE-plugins-cli $PSScriptRoot/plugins-cli $exitCode | Should -Be 0 @@ -315,7 +315,7 @@ Describe "[plugins-cli > $global:TEST_TAG] clean work directory" { } # Only test on Java 21, one JDK is enough to test all versions -Describe "[plugins-cli > $global:TEST_TAG] plugins are installed with jenkins-plugin-cli and no war" -Skip:(-not $global:TEST_TAG.StartsWith('jdk21-')) { +Describe "[plugins-cli > $global:TEST_TAG] plugins are installed with jenkins-plugin-cli and no war" -Skip:(-not $global:TEST_TAG.Contains('jdk21-')) { It 'builds child image' { $exitCode, $stdout, $stderr = Build-DockerChild $global:SUT_IMAGE-plugins-cli-no-war $PSScriptRoot/plugins-cli/no-war $exitCode | Should -Be 0 @@ -323,7 +323,7 @@ Describe "[plugins-cli > $global:TEST_TAG] plugins are installed with jenkins-pl } # Only test on Java 21, one JDK is enough to test all versions -Describe "[plugins-cli > $global:TEST_TAG] Use a custom jenkins.war" -Skip:(-not $global:TEST_TAG.StartsWith('jdk21-')) { +Describe "[plugins-cli > $global:TEST_TAG] Use a custom jenkins.war" -Skip:(-not $global:TEST_TAG.Contains('jdk21-')) { It 'builds child image' { $exitCode, $stdout, $stderr = Build-DockerChild $global:SUT_IMAGE-plugins-cli-custom-war $PSScriptRoot/plugins-cli/custom-war --no-cache $exitCode | Should -Be 0 diff --git a/tests/runtime.Tests.ps1 b/tests/runtime.Tests.ps1 index de7e7503ec..5d4eb9d093 100644 --- a/tests/runtime.Tests.ps1 +++ b/tests/runtime.Tests.ps1 @@ -27,7 +27,7 @@ Describe "[runtime > $global:TEST_TAG] cleanup container" { } # Only test on Java 21, one JDK is enough to test all versions -Describe "[runtime > $global:TEST_TAG] test multiple JENKINS_OPTS" -Skip:(-not $global:TEST_TAG.StartsWith('jdk21-')) { +Describe "[runtime > $global:TEST_TAG] test multiple JENKINS_OPTS" -Skip:(-not $global:TEST_TAG.Contains('jdk21-')) { It '"--help --version" should return the version, not the help' { # need the last line of output $exitCode, $stdout, $stderr = Run-Program 'docker.exe' "run --rm -e JENKINS_OPTS=`"--help --version`" --name $global:SUT_CONTAINER -P $global:SUT_IMAGE" @@ -37,7 +37,7 @@ Describe "[runtime > $global:TEST_TAG] test multiple JENKINS_OPTS" -Skip:(-not $ } # Only test on Java 21, one JDK is enough to test all versions -Describe "[runtime > $global:TEST_TAG] test jenkins arguments" -Skip:(-not $global:TEST_TAG.StartsWith('jdk21-')) { +Describe "[runtime > $global:TEST_TAG] test jenkins arguments" -Skip:(-not $global:TEST_TAG.Contains('jdk21-')) { It 'running --help --version should return the version, not the help' { # need the last line of output $exitCode, $stdout, $stderr = Run-Program 'docker.exe' "run --rm --name $global:SUT_CONTAINER -P $global:SUT_IMAGE --help --version" @@ -59,7 +59,7 @@ Describe "[runtime > $global:TEST_TAG] test jenkins arguments" -Skip:(-not $glob } # Only test on Java 21, one JDK is enough to test all versions -Describe "[runtime > $global:TEST_TAG] passing JVM parameters" -Skip:(-not $global:TEST_TAG.StartsWith('jdk21-')) { +Describe "[runtime > $global:TEST_TAG] passing JVM parameters" -Skip:(-not $global:TEST_TAG.Contains('jdk21-')) { BeforeAll { $tzSetting = '-Duser.timezone=Europe/Madrid' $tzRegex = [regex]::Escape("Europe/Madrid")