Skip to content

Commit

Permalink
Enable step to run stack tests on Windows (#2173)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mrodm authored Oct 18, 2024
1 parent 2742a73 commit a39b666
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 18 deletions.
28 changes: 13 additions & 15 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,21 +74,19 @@ steps:
- step: unit-tests-linux
allow_failure: false

# Disable step due to docker errors: https://buildkite.com/elastic/elastic-package/builds/4023#0191ff3a-f18b-4e43-9219-4957da065c37/1827-1829
# Related issue: https://github.com/elastic/elastic-package/issues/2107
# - label: ":windows: Run stack tests"
# key: stack-tests-windows
# command: ".buildkite/scripts/stack_tests_windows.ps1"
# agents:
# provider: "gcp"
# image: "${WINDOWS_AGENT_IMAGE}"
# depends_on:
# - step: check-static
# allow_failure: false
# - step: unit-tests-windows
# allow_failure: false
# artifact_paths:
# - 'C:\ProgramData\chocolatey\logs\chocolatey.log'
- label: ":windows: Run stack tests"
key: stack-tests-windows
command: ".buildkite/scripts/stack_tests_windows.ps1"
agents:
provider: "gcp"
image: "${WINDOWS_AGENT_IMAGE}"
depends_on:
- step: check-static
allow_failure: false
- step: unit-tests-windows
allow_failure: false
artifact_paths:
- 'C:\ProgramData\chocolatey\logs\chocolatey.log'

- wait: ~
continue_on_failure: true
Expand Down
15 changes: 12 additions & 3 deletions .buildkite/scripts/stack_tests_windows.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function withDocker($version) {

function withDockerCompose($version) {
Write-Host "-- Install Docker Compose $version --"
choco install -y docker-compose --version $version
choco install -y docker-compose --allow-downgrade --version $version
setupChocolateyPath
}

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

# TODO: stack status checks that we can call docker-compose, but we should try a stack up.
# 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.
# stack up doesn't work because we didn't manage to enable the linux engine, and we don't have Windows native images.
go run . stack status
echo "Stack Status"
go run . stack status -v
echo "Stack up"
# running this stack up command adds the required files under ~/.elastic-package to run afterwards "elastic-package stack down" successfully
# that uses docker-compose under the hood
go run . stack up -v -d
echo "Stack Status"
go run . stack status -v
echo "Stack down"
go run . stack down -v

$EXITCODE=$LASTEXITCODE
$ErrorActionPreference = "Stop"
Expand Down

0 comments on commit a39b666

Please sign in to comment.