Skip to content

Commit

Permalink
post review updates
Browse files Browse the repository at this point in the history
Signed-off-by: Benjamin Ash <bash@intelerad.com>
  • Loading branch information
Benjamin Ash committed Oct 26, 2020
1 parent 23f4709 commit a041ddd
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
13 changes: 8 additions & 5 deletions hack/integration-tests-local.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env bash
set -x -e -uo pipefail
set -e -uo pipefail

[ -n "${DEBUG:-}" ] && set -x

## Set up

Expand All @@ -12,21 +14,21 @@ export AWS_DISABLE_SSL=true
DOCKER_NAME='helm-s3-minio'

cleanup() {
if $(docker container ls | grep -q "${DOCKER_NAME}\$") ; then
docker container rm --force --volumes "${DOCKER_NAME}" || :
if docker container ls | grep -q "${DOCKER_NAME}$" ; then
docker container rm --force --volumes "${DOCKER_NAME}" &>/dev/null || :
fi
}

cleanup

on_exit() {
if [ -z "${SKIP_CLEANUP}" ]; then
if [ -z "${SKIP_CLEANUP:-}" ]; then
cleanup
fi
}
trap on_exit EXIT

docker container run -d --rm --name helm-s3-minio \
docker container run -d --rm --name "${DOCKER_NAME}" \
-p 9000:9000 \
-e MINIO_ACCESS_KEY=$AWS_ACCESS_KEY_ID \
-e MINIO_SECRET_KEY=$AWS_SECRET_ACCESS_KEY \
Expand All @@ -39,6 +41,7 @@ if [ ! -x "$(which mc 2>/dev/null)" ]; then
popd > /dev/null
fi

# give minio time to become service available.
sleep 3
mc config host add helm-s3-minio http://localhost:9000 $AWS_ACCESS_KEY_ID $AWS_SECRET_ACCESS_KEY
mc mb helm-s3-minio/test-bucket
Expand Down
2 changes: 1 addition & 1 deletion hack/integration-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ if [ "${IT_HELM_VERSION:0:1}" == "3" ]; then
search_arg="repo"
fi

set -x
[ -n "${DEBUG:-}" ] && set -x

#
# Set up
Expand Down
7 changes: 6 additions & 1 deletion tests/e2e/push_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,12 @@ func TestPushRelative(t *testing.T) {
t.Errorf("mismatch (-want +got):\n%s", diff)
}

os.Chdir(tmpdir)
wd, _ := os.Getwd()
if err := os.Chdir(tmpdir); err != nil {
t.Fatalf("Unexpected error: %v", err)
}
defer os.Chdir(wd)

cmd, stdout, stderr = command(fmt.Sprintf("helm fetch %s/%s --version %s", name, chartName, chartVer))
if err := cmd.Run(); err != nil {
t.Errorf("Unexpected error: %v", err)
Expand Down

0 comments on commit a041ddd

Please sign in to comment.