-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: tweaks following end-to-end verification (#7)
* chore: releases may be locally tested, avoid committing these * fix: BK plugin env var must be prefixed after repo * ci: run Buildkite plugin-specific tests
- Loading branch information
1 parent
b1ac70b
commit 1e4f6bc
Showing
5 changed files
with
59 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,6 @@ | |
# VIM swap files | ||
*.swp | ||
src/*.html | ||
|
||
# Go Release artifacts | ||
src/dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ services: | |
image: buildkite/plugin-tester:v4.0.0 | ||
volumes: | ||
- ".:/plugin" | ||
|
||
build: | ||
build: | ||
context: src | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#!/usr/bin/env bats | ||
|
||
load '/usr/local/lib/bats/load.bash' | ||
|
||
load '../lib/download.bash' | ||
|
||
# | ||
# Tests for top-level docker bootstrap command. The rest of the plugin runs in Go. | ||
# | ||
|
||
# Uncomment the following line to debug stub failures | ||
# export [stub_command]_STUB_DEBUG=/dev/tty | ||
#export DOCKER_STUB_DEBUG=/dev/tty | ||
|
||
#TODO: Update this to reflect what we need to test in the task runner code | ||
setup() { | ||
export BUILDKITE_PLUGIN_ECR_TASK_RUNNER_BUILDKITE_PLUGIN_MESSAGE=true | ||
} | ||
|
||
#TODO: Update this to reflect what we need to test in the task runner code | ||
teardown() { | ||
unset BUILDKITE_PLUGIN_ECR_TASK_RUNNER_BUILDKITE_PLUGIN_MESSAGE | ||
rm ./ecs-task-runner-buildkite-plugin || true | ||
} | ||
|
||
create_script() { | ||
cat > "$1" << EOM | ||
set -euo pipefail | ||
echo "executing $1:\$@" | ||
EOM | ||
} | ||
|
||
@test "Downloads and runs the command for the current architecture" { | ||
|
||
function downloader() { | ||
echo "$@"; | ||
create_script $2 | ||
} | ||
export -f downloader | ||
|
||
run download_binary_and_run | ||
|
||
unset downloader | ||
|
||
assert_success | ||
assert_line --regexp "https://github.com/cultureamp/ecs-task-runner-buildkite-plugin/releases/latest/download/ecs-task-runner-buildkite-plugin_linux_amd64 ecs-task-runner-buildkite-plugin" | ||
assert_line --regexp "executing ecs-task-runner-buildkite-plugin" | ||
} |