Better error reporting when missing setup for E2E tests (#1985)
This commit is contained in:
parent
1c99bae649
commit
a34cdd5597
|
@ -296,10 +296,18 @@ def plan_validator_fixture(request):
|
|||
|
||||
def get_tfvars_for_e2e():
|
||||
_variables = [
|
||||
"billing_account", "group_email", "organization_id", "parent", "prefix",
|
||||
"region"
|
||||
'billing_account', 'group_email', 'organization_id', 'parent', 'prefix',
|
||||
'region'
|
||||
]
|
||||
tf_vars = {k: os.environ.get(f"TFTEST_E2E_{k}") for k in _variables}
|
||||
missing_vars = set([f'TFTEST_E2E_{k}' for k in _variables]) - set(
|
||||
os.environ.keys())
|
||||
if missing_vars:
|
||||
raise RuntimeError(
|
||||
f'Missing environment variables: {missing_vars} required to run E2E tests. '
|
||||
f'Consult CONTRIBUTING.md to understand how to set them up. '
|
||||
f'If you want to skip E2E tests add -k "not examples_e2e" to your pytest call'
|
||||
)
|
||||
tf_vars = {k: os.environ.get(f'TFTEST_E2E_{k}') for k in _variables}
|
||||
return tf_vars
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue