3
3
4
4
"""Fixtures for github runner charm integration tests."""
5
5
import logging
6
+ import os
6
7
import random
7
8
import secrets
8
9
import string
@@ -131,7 +132,7 @@ def path(pytestconfig: pytest.Config) -> str:
131
132
@pytest .fixture (scope = "module" )
132
133
def token (pytestconfig : pytest .Config ) -> str :
133
134
"""Configured token setting."""
134
- token = pytestconfig .getoption ("--token" )
135
+ token = pytestconfig .getoption ("--token" ) or os . environ . get ( "INTEGRATION_TOKEN" )
135
136
assert token , "Please specify the --token command line option"
136
137
tokens = {token .strip () for token in token .split ("," )}
137
138
random_token = random .choice (list (tokens ))
@@ -141,7 +142,7 @@ def token(pytestconfig: pytest.Config) -> str:
141
142
@pytest .fixture (scope = "module" )
142
143
def token_alt (pytestconfig : pytest .Config , token : str ) -> str :
143
144
"""Configured token_alt setting."""
144
- token_alt = pytestconfig .getoption ("--token-alt" )
145
+ token_alt = pytestconfig .getoption ("--token-alt" ) or os . environ . get ( "INTEGRATION_TOKEN_ALT" )
145
146
assert token_alt , (
146
147
"Please specify the --token-alt command line option with GitHub Personal "
147
148
"Access Token value."
@@ -203,6 +204,7 @@ def private_endpoint_config_fixture(pytestconfig: pytest.Config) -> PrivateEndpo
203
204
"""The private endpoint configuration values."""
204
205
auth_url = pytestconfig .getoption ("--openstack-auth-url-amd64" )
205
206
password = pytestconfig .getoption ("--openstack-password-amd64" )
207
+ password = password or os .environ .get ("INTEGRATION_OPENSTACK_PASSWORD_AMD64" )
206
208
project_domain_name = pytestconfig .getoption ("--openstack-project-domain-name-amd64" )
207
209
project_name = pytestconfig .getoption ("--openstack-project-name-amd64" )
208
210
user_domain_name = pytestconfig .getoption ("--openstack-user-domain-name-amd64" )
0 commit comments