Skip to content

Commit dc6fffe

Browse files
authored
fix: Addressed travis failures (#172)
dependency: none Signed-off-by: jkalanda <[email protected]>
1 parent f6247c5 commit dc6fffe

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-3
lines changed

.travis.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,15 @@ matrix:
1818
&& openssl aes-256-cbc -K $encrypted_27cb64608ff6_key -iv $encrypted_27cb64608ff6_iv -in dl.env.enc -out dl.env -d || true
1919
&& openssl aes-256-cbc -K $encrypted_fc092b9428d6_key -iv $encrypted_fc092b9428d6_iv -in cis.env.enc -out cis.env -d || true
2020
&& openssl aes-256-cbc -K $encrypted_89a9eb4f9417_key -iv $encrypted_89a9eb4f9417_iv -in dns.env.enc -out dns.env -d || true
21+
# force prod IAM inside the file so dotenv can't override you
22+
- sed -i 's#^CIS_SERVICES_AUTH_URL=.*#CIS_SERVICES_AUTH_URL=https://iam.cloud.ibm.com/identity/token#g' cis.env || true
23+
- 'grep -q "^CIS_SERVICES_AUTH_URL=" cis.env || echo "CIS_SERVICES_AUTH_URL=https://iam.cloud.ibm.com/identity/token" >> cis.env'
24+
# also export for safety
25+
- export CIS_SERVICES_AUTH_URL="https://iam.cloud.ibm.com/identity/token"
26+
- python - <<'PY'
27+
import os
28+
print("PYDEBUG before tox: CIS_SERVICES_AUTH_URL =", os.getenv("CIS_SERVICES_AUTH_URL"))
29+
PY
2130
- python: 3.11
2231
- python: 3.12
2332

@@ -28,7 +37,7 @@ before_install:
2837
- echo -e "machine github.ibm.com\n login $GH_TOKEN" > ~/.netrc
2938

3039
install:
31-
- sudo rm /etc/apt/sources.list.d/mongodb-4.4.list
40+
- sudo rm -f /etc/apt/sources.list.d/mongodb-4.4.list || true
3241
- wget -O- https://pgp.mongodb.com/server-4.4.asc | sudo gpg --dearmor -o /usr/share/keyrings/mongodb-4.4.gpg
3342
- echo "deb [signed-by=/usr/share/keyrings/mongodb-4.4.gpg] http://repo.mongodb.org/apt/ubuntu $(lsb_release -cs)/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-4.4.list
3443
- pip install tox-travis

tox.ini

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,22 @@ deps = pre-commit
77
commands = pre-commit run
88

99
[testenv]
10-
passenv = TOXENV CI TRAVIS*
10+
passenv =
11+
TOXENV
12+
CI
13+
TRAVIS*
14+
CIS_SERVICES_*
15+
CRN
16+
ZONE_ID
17+
API_ENDPOINT
1118
commands =
1219
py.test --reruns 2 --cov=ibm_cloud_networking_services {posargs}
1320
deps =
1421
-r{toxinidir}/requirements.txt
1522
-r{toxinidir}/requirements-dev.txt
1623
usedevelop = True
17-
exclude = .venv,.git,.tox,docs
24+
exclude = .venv,.git,.tox,docs
25+
26+
[testenv:py310]
27+
setenv =
28+
CIS_SERVICES_AUTH_URL = https://iam.cloud.ibm.com/identity/token

0 commit comments

Comments
 (0)