Skip to content
Snippets Groups Projects
Commit 2bb2a2b2 authored by Timo Furrer's avatar Timo Furrer
Browse files

Merge branch 'fix-server-host-unit-test' into 'main'

Mock CI_SERVER_HOST predefined env variable for unit test

See merge request components/opentofu!65
parents 0007fb13 1e5b1e3c
No related branches found
No related tags found
No related merge requests found
......@@ -160,10 +160,13 @@ gitlab-tofu-init-with-prepared-registry-token:
- |
cat <<'EOF' > test.sh
set -x
export TF_TOKEN_gitlab_com=mysecrettoken
# NOTE: as part of the tst fixture, we need to overwrite the CI_SERVER_HOST,
# so that this test also properly works on GitLab self-managed.
export CI_SERVER_HOST=gitlab.example.com
export TF_TOKEN_gitlab_example_com=mysecrettoken
. $(which gitlab-tofu)
terraform_authenticate_private_registry
test "$TF_TOKEN_gitlab_com" = "mysecrettoken"
test "$TF_TOKEN_gitlab_example_com" = "mysecrettoken"
EOF
- $SHELL test.sh
parallel:
......@@ -186,9 +189,12 @@ gitlab-tofu-init-without-prepared-registry-token:
- |
cat <<'EOF' > test.sh
set -x
# NOTE: as part of the tst fixture, we need to overwrite the CI_SERVER_HOST,
# so that this test also properly works on GitLab self-managed.
export CI_SERVER_HOST=gitlab.example.com
. $(which gitlab-tofu)
terraform_authenticate_private_registry
test -n "$TF_TOKEN_gitlab_com"
test -n "$TF_TOKEN_gitlab_example_com"
EOF
- $SHELL test.sh
parallel:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment