@@ -87,6 +87,37 @@ def unit(session):
8787 default (session )
8888
8989
90+ @nox .session (python = "3.8" )
91+ def system (session ):
92+ """Run the system test suite."""
93+ system_test_path = os .path .join ("tests" , "system.py" )
94+ system_test_folder_path = os .path .join ("tests" , "system" )
95+
96+ # Sanity check: Only run tests if the environment variable is set.
97+ if not os .environ .get ("GOOGLE_APPLICATION_CREDENTIALS" , "" ):
98+ session .skip ("Credentials must be set via environment variable" )
99+
100+ system_test_exists = os .path .exists (system_test_path )
101+ system_test_folder_exists = os .path .exists (system_test_folder_path )
102+
103+ # Sanity check: only run tests if found.
104+ if not system_test_exists and not system_test_folder_exists :
105+ session .skip ("System tests were not found" )
106+
107+ # Install all test dependencies, then install this package into the
108+ # virtualenv's dist-packages.
109+ session .install ("mock" , "pytest" , "google-cloud-testutils" )
110+ session .install ("-e" , "." )
111+
112+ # Run py.test against the system tests.
113+ if system_test_exists :
114+ session .run ("py.test" , "--quiet" , system_test_path , * session .posargs )
115+ if system_test_folder_exists :
116+ session .run (
117+ "py.test" , "--quiet" , system_test_folder_path , * session .posargs
118+ )
119+
120+
90121@nox .session (python = "3.8" )
91122def cover (session ):
92123 """Run the final coverage report.
0 commit comments