Skip to content

Commit

Permalink
[PATCH] Merge pull request jenkinsci/docker-inbound-agent#286 from dd…
Browse files Browse the repository at this point in the history
…uportal/fix/jenkinscigh-285-review

chore(test) fix build argument tests by using an old version
  • Loading branch information
dduportal authored and lemeurherve committed Nov 28, 2023
1 parent 858dfe2 commit 6ffe1ac
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/inboundAgent.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -128,15 +128,16 @@ Describe "[$global:JDK $global:FLAVOR] image starts jenkins-agent.ps1 correctly
Describe "[$global:JDK $global:FLAVOR] build args" {
BeforeAll {
Push-Location -StackName 'agent' -Path "$PSScriptRoot/.."
# an old jdk11 image version
$TEST_VERSION="3063.v26e24490f041"
# Old version used to test overriding the build arguments.
# This old version must have the same tag suffixes as the current 4 windows images (`-jdk11-nanoserver` etc.)
$TEST_VERSION="3046.v38db_38a_b_7a_86"
$DOCKER_AGENT_VERSION_SUFFIX="1"
$TEST_USER="foo"
$ARG_TEST_VERSION="${TEST_VERSION}-${DOCKER_AGENT_VERSION_SUFFIX}"
}

It 'builds image with arguments' {
$exitCode, $stdout, $stderr = Run-Program 'docker.exe' "build --build-arg VERSION=${ARG_TEST_VERSION} --build-arg user=$TEST_USER -t $global:AGENT_IMAGE $global:FOLDER"
$exitCode, $stdout, $stderr = Run-Program 'docker.exe' "build --build-arg version=${ARG_TEST_VERSION} --build-arg user=$TEST_USER -t $global:AGENT_IMAGE $global:FOLDER"
$exitCode | Should -Be 0

$exitCode, $stdout, $stderr = Run-Program 'docker.exe' "run -dit --name $global:AGENT_CONTAINER -P $global:AGENT_IMAGE -Cmd $global:SHELL"
Expand Down

0 comments on commit 6ffe1ac

Please sign in to comment.