Skip to content
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 16 additions & 10 deletions packages/google-cloud-secret-manager/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,15 +264,26 @@ 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("opentelemetry-sdk", "opentelemetry-instrumentation-grpc")
pytest_path = "tests"
else:
pytest_path = os.path.join("tests", "unit")
Comment thread
chalmerlowe marked this conversation as resolved.
Outdated

install_unittest_dependencies(session, "-c", constraints_path)

# Run py.test against the unit tests.
Expand All @@ -286,7 +297,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,
Expand Down Expand Up @@ -367,12 +378,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)
Expand Down
Loading