Skip to content

Commit a39b666

Browse files
authored
Enable step to run stack tests on Windows (#2173)
Enable windows step to run stack tests and update the test script. The test script now adds commands to test at least the stack up (with some failures) and the stack down process.
1 parent 2742a73 commit a39b666

File tree

2 files changed

+25
-18
lines changed

2 files changed

+25
-18
lines changed

.buildkite/pipeline.yml

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -74,21 +74,19 @@ steps:
7474
- step: unit-tests-linux
7575
allow_failure: false
7676

77-
# Disable step due to docker errors: https://buildkite.com/elastic/elastic-package/builds/4023#0191ff3a-f18b-4e43-9219-4957da065c37/1827-1829
78-
# Related issue: https://github.com/elastic/elastic-package/issues/2107
79-
# - label: ":windows: Run stack tests"
80-
# key: stack-tests-windows
81-
# command: ".buildkite/scripts/stack_tests_windows.ps1"
82-
# agents:
83-
# provider: "gcp"
84-
# image: "${WINDOWS_AGENT_IMAGE}"
85-
# depends_on:
86-
# - step: check-static
87-
# allow_failure: false
88-
# - step: unit-tests-windows
89-
# allow_failure: false
90-
# artifact_paths:
91-
# - 'C:\ProgramData\chocolatey\logs\chocolatey.log'
77+
- label: ":windows: Run stack tests"
78+
key: stack-tests-windows
79+
command: ".buildkite/scripts/stack_tests_windows.ps1"
80+
agents:
81+
provider: "gcp"
82+
image: "${WINDOWS_AGENT_IMAGE}"
83+
depends_on:
84+
- step: check-static
85+
allow_failure: false
86+
- step: unit-tests-windows
87+
allow_failure: false
88+
artifact_paths:
89+
- 'C:\ProgramData\chocolatey\logs\chocolatey.log'
9290

9391
- wait: ~
9492
continue_on_failure: true

.buildkite/scripts/stack_tests_windows.ps1

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ function withDocker($version) {
3030

3131
function withDockerCompose($version) {
3232
Write-Host "-- Install Docker Compose $version --"
33-
choco install -y docker-compose --version $version
33+
choco install -y docker-compose --allow-downgrade --version $version
3434
setupChocolateyPath
3535
}
3636

@@ -56,9 +56,18 @@ go mod download -x
5656
echo "--- Running stack tests"
5757
$ErrorActionPreference = "Continue" # set +e
5858

59-
# TODO: stack status checks that we can call docker-compose, but we should try a stack up.
59+
# TODO: stack status checks that we can call docker, but we should try a stack up to try also with docker-compose with a full scenario.
6060
# stack up doesn't work because we didn't manage to enable the linux engine, and we don't have Windows native images.
61-
go run . stack status
61+
echo "Stack Status"
62+
go run . stack status -v
63+
echo "Stack up"
64+
# running this stack up command adds the required files under ~/.elastic-package to run afterwards "elastic-package stack down" successfully
65+
# that uses docker-compose under the hood
66+
go run . stack up -v -d
67+
echo "Stack Status"
68+
go run . stack status -v
69+
echo "Stack down"
70+
go run . stack down -v
6271

6372
$EXITCODE=$LASTEXITCODE
6473
$ErrorActionPreference = "Stop"

0 commit comments

Comments
 (0)