diff --git a/packages/google-cloud-secret-manager/noxfile.py b/packages/google-cloud-secret-manager/noxfile.py index 68d01578433b..608e1ee6345b 100644 --- a/packages/google-cloud-secret-manager/noxfile.py +++ b/packages/google-cloud-secret-manager/noxfile.py @@ -264,15 +264,25 @@ def install_unittest_dependencies(session, *constraints): @nox.session(python=ALL_PYTHON) @nox.parametrize( - "protobuf_implementation", - ["python", "upb"], + ["protobuf_implementation", "install_otel"], + [ + ("python", True), + ("python", False), + ("upb", True), + ("upb", False), + ], ) -def unit(session, protobuf_implementation): +def unit(session, protobuf_implementation, install_otel): # Install all test dependencies, then install this package in-place. constraints_path = str( CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt" ) + if install_otel: + session.install("google-api-core[tracing,testing]") + + pytest_path = os.path.join("tests", "unit") + install_unittest_dependencies(session, "-c", constraints_path) # Run py.test against the unit tests. @@ -286,7 +296,7 @@ def unit(session, protobuf_implementation): "--cov-config=.coveragerc", "--cov-report=", "--cov-fail-under=0", - os.path.join("tests", "unit"), + pytest_path, *session.posargs, env={ "PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation, @@ -367,12 +377,7 @@ def system(session): ) -@nox.session(python=DEFAULT_PYTHON_VERSION) -def integration(session): - """Run integration tests with OpenTelemetry.""" - session.install("-e", ".") - session.install("pytest", "opentelemetry-sdk", "opentelemetry-instrumentation-grpc") - session.run("py.test", "tests/integration", *session.posargs) + @nox.session(python=DEFAULT_PYTHON_VERSION)