Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tests/functions.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
18 changes: 9 additions & 9 deletions tests/plugins-cli.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -315,15 +315,15 @@ 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
}
}

# 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
Expand Down
6 changes: 3 additions & 3 deletions tests/runtime.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand All @@ -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")
Expand Down