Skip to content
This repository has been archived by the owner on Dec 31, 2023. It is now read-only.

Commit

Permalink
Monitoring: Fix environment variables for VPC tests. (#8302)
Browse files Browse the repository at this point in the history
  • Loading branch information
busunkim96 authored Aug 22, 2019
1 parent 0cf4029 commit 5597542
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
13 changes: 7 additions & 6 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,13 @@ def system(session):
session.install("-e", ".")

# Additional setup for VPCSC system tests
env = {
"PROJECT_ID": "secure-gcp-test-project-4",
"GOOGLE_CLOUD_TESTS_VPCSC_OUTSIDE_PERIMETER_PROJECT": os.environ.get(
"PROJECT_ID"
),
}
if os.environ.get("GOOGLE_CLOUD_TESTS_IN_VPCSC") != "true":
# Unset PROJECT_ID, since VPCSC system tests expect this to be a project
# within the VPCSC perimeter.
env = {
"PROJECT_ID": "",
"GOOGLE_CLOUD_TESTS_VPCSC_OUTSIDE_PERIMETER_PROJECT": os.environ.get("PROJECT_ID"),
}

# Run py.test against the system tests.
if system_test_exists:
Expand Down
2 changes: 2 additions & 0 deletions tests/system/test_vpcsc.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
from google.cloud.monitoring_v3 import enums

PROJECT_INSIDE = os.environ.get("PROJECT_ID", None)
if not PROJECT_INSIDE:
PROJECT_INSIDE = None
PROJECT_OUTSIDE = os.environ.get(
"GOOGLE_CLOUD_TESTS_VPCSC_OUTSIDE_PERIMETER_PROJECT", None
)
Expand Down

0 comments on commit 5597542

Please sign in to comment.