Skip to content

Commit

Permalink
DLP: Add vpcsc tests (#9249)
Browse files Browse the repository at this point in the history
* add vpcsc tests for dlp
  • Loading branch information
maximus12793 authored and crwilcox committed Sep 20, 2019
1 parent 598d9bd commit 9023477
Show file tree
Hide file tree
Showing 2 changed files with 536 additions and 2 deletions.
17 changes: 15 additions & 2 deletions dlp/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,24 @@ def system(session):
session.install("-e", "../test_utils/")
session.install("-e", ".")

# Additional setup for VPCSC system tests
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:
session.run("py.test", "--quiet", system_test_path, *session.posargs)
session.run("py.test", "--quiet", system_test_path, env=env, *session.posargs)
if system_test_folder_exists:
session.run("py.test", "--quiet", system_test_folder_path, *session.posargs)
session.run(
"py.test", "--quiet", system_test_folder_path, env=env, *session.posargs
)


@nox.session(python="3.7")
Expand Down
Loading

0 comments on commit 9023477

Please sign in to comment.