Skip to content

Commit

Permalink
Merge pull request #7221 from habitat-sh/dmcneil/fix-e2e-local-scripts
Browse files Browse the repository at this point in the history
Fix e2e_local scripts
  • Loading branch information
davidMcneil authored Nov 20, 2019
2 parents 0971eaa + 45f7875 commit ad34ee4
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 28 deletions.
5 changes: 3 additions & 2 deletions e2e_local.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Param(
[Parameter(Mandatory=$true)]
[string[]]$TestName
[string]$TestName,
[string]$Channel="dev"
)

$ErrorActionPreference="stop"
Expand All @@ -12,4 +13,4 @@ docker run `
--env-file="$(pwd)/e2e_env" `
--volume="$(pwd):c:\workdir" `
--workdir=/workdir `
chefes/buildkite-windows powershell.exe .\.expeditor\scripts\end_to_end\run_e2e_test.ps1 dev $TestName
chefes/buildkite-windows powershell.exe .\.expeditor\scripts\end_to_end\run_e2e_test.ps1 $Channel $TestName
29 changes: 3 additions & 26 deletions e2e_local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,9 @@

set -euo pipefail

if [[ ${#} == 0 ]]; then
cat <<EOF
You must supply arguments! For example:
test_name=${1:?You must specify a test name}
channel=${2:-dev}

${0} test/end-to-end/my_test.sh
EOF
exit 1
fi

# These are the commands that will be sequentially run in the
# container. The final one will be the test itself, which is supplied
# as the arguments of the script.
#
# Not every test requires `expect`, but it's not hurting anything to
# install it for everything.
#
# Note that the `ci-studio-common.sh` file is baked into the image we
# use.
commands=(". /opt/ci-studio-common/buildkite-agent-hooks/ci-studio-common.sh"
".expeditor/scripts/end_to_end/setup_environment.sh dev"
"hab pkg install --binlink --channel=stable core/expect"
"${*}")

# Add a `;` after every command, for feeding into the container. This
# allows them to run in sequence.
docker run \
--rm \
--interactive \
Expand All @@ -36,4 +13,4 @@ docker run \
--env-file="$(pwd)/e2e_env" \
--volume="$(pwd):/workdir" \
--workdir=/workdir \
chefes/buildkite /bin/bash -e -c "${commands[*]/%/;}"
chefes/buildkite bash .expeditor/scripts/end_to_end/run_e2e_test.sh "$channel" "$test_name"
39 changes: 39 additions & 0 deletions e2e_local_raw_command.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/bash

set -euo pipefail

if [[ ${#} == 0 ]]; then
cat <<EOF
You must supply arguments! For example:
${0} test/end-to-end/my_test.sh
EOF
exit 1
fi

# These are the commands that will be sequentially run in the
# container. The final one will be the test itself, which is supplied
# as the arguments of the script.
#
# Not every test requires `expect`, but it's not hurting anything to
# install it for everything.
#
# Note that the `ci-studio-common.sh` file is baked into the image we
# use.
commands=(". /opt/ci-studio-common/buildkite-agent-hooks/ci-studio-common.sh"
".expeditor/scripts/end_to_end/setup_environment.sh dev"
"hab pkg install --binlink --channel=stable core/expect"
"${*}")

# Add a `;` after every command, for feeding into the container. This
# allows them to run in sequence.
docker run \
--rm \
--interactive \
--tty \
--privileged \
--env-file="$(pwd)/e2e_env" \
--volume="$(pwd):/workdir" \
--workdir=/workdir \
chefes/buildkite /bin/bash -e -c "${commands[*]/%/;}"

0 comments on commit ad34ee4

Please sign in to comment.