Skip to content

Commit 49c208d

Browse files
committed
Fix tofu ci env
1 parent f84b7f0 commit 49c208d

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

tofu/tests/setup-and-run-ci-env.sh

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,22 +122,29 @@ echo "Running additional tests..."
122122

123123
# Set up some variables
124124
CONTENT_TYPE="Content-Type: application/json"
125-
TF_VAR_coral_uri=http://$SITE:$PORT
125+
export TF_VAR_coral_uri=http://$SITE:$PORT
126126

127127
# Get a token
128128
echo "Getting an auth token:"
129-
TF_VAR_auth_token=$(curl -s -X POST -H "$CONTENT_TYPE" -d \
129+
export TF_VAR_auth_token=$(curl -s -X POST -H "$CONTENT_TYPE" -d \
130130
"{
131131
\"username\": \"admin\",
132132
\"password\": \"$TEST_PASSWORD\"
133133
}" \
134134
${TF_VAR_coral_uri}/api-token-auth/ | jq -r '.token')
135135
echo "Auth Token: $TF_VAR_auth_token"
136136

137-
python -m venv venv
138-
source venv/bin/active
137+
# Install OpenTofu
138+
curl --proto '=https' --tlsv1.2 -fsSL https://get.opentofu.org/install-opentofu.sh -o install-opentofu.sh
139+
chmod +x install-opentofu.sh
140+
./install-opentofu.sh --install-method deb
141+
rm -f install-opentofu.sh
142+
143+
# Install python dependencies
139144
pip install -r ${SCRIPT_DIR}/../../requirements.txt
145+
pip install -r ${SCRIPT_DIR}/../../test-requirements.txt
140146

147+
# Run tests
141148
pytest ${SCRIPT_DIR}/tofu_tests.py
142149

143150
# Scrape prometheus metrics:

tools/functional_test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ RESPONSE=$(curl -s -w "%{http_code}" -X POST -H "$AUTH_HEADER" -H "$CONTENT_TYPE
230230
}
231231
}
232232
}" \
233-
http://$SITE:$PORT/consumer/create/)
233+
http://$SITE:$PORT/consumer/create)
234234

235235
if [ "$RESPONSE" -eq 204 ]; then
236236
echo "All tests completed."

0 commit comments

Comments
 (0)