fix: temporarily disable code coverage in showcase_unit tests by software-dov · Pull Request #925 · googleapis/gapic-generator-python · GitHub
Skip to content
This repository was archived by the owner on Mar 26, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
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
20 changes: 13 additions & 7 deletions .github/workflows/tests.yaml
23 changes: 6 additions & 17 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import shutil


showcase_version = "0.11.0"
showcase_version = os.environ.get("SHOWCASE_VERSION", "0.16.0")
ADS_TEMPLATES = path.join(path.dirname(__file__), "gapic", "ads-templates")


Expand All @@ -34,7 +34,7 @@ def unit(session):
"""Run the unit test suite."""

session.install(
"coverage", "pytest", "pytest-cov", "pytest-xdist", "pyfakefs",
"pytest", "pytest-xdist", "pyfakefs",
)
session.install("-e", ".")

Expand All @@ -45,10 +45,6 @@ def unit(session):
or [
"-vv",
"-n=auto",
"--cov=gapic",
"--cov-config=.coveragerc",
"--cov-report=term",
"--cov-report=html",
path.join("tests", "unit"),
]
),
Expand Down Expand Up @@ -185,9 +181,7 @@ def showcase_mtls_alternative_templates(session):

def run_showcase_unit_tests(session, fail_under=100):
session.install(
"coverage",
"pytest",
"pytest-cov",
"pytest-xdist",
"asyncmock",
"pytest-asyncio",
Expand All @@ -198,9 +192,6 @@ def run_showcase_unit_tests(session, fail_under=100):
"py.test",
"-n=auto",
"--quiet",
"--cov=google",
"--cov-append",
f"--cov-fail-under={str(fail_under)}",
*(session.posargs or [path.join("tests", "unit")]),
)

Expand All @@ -226,12 +217,11 @@ def showcase_unit(
# google-auth is a transitive dependency so it isn't in the
# lower bound constraints file produced above.
session.install("google-auth==1.21.1")
run_showcase_unit_tests(session, fail_under=0)
run_showcase_unit_tests(session)

# 2. Run the tests again with latest version of dependencies
session.install(".", "--upgrade", "--force-reinstall")
# This time aggregate coverage should reach 100%
run_showcase_unit_tests(session, fail_under=100)
run_showcase_unit_tests(session)


@nox.session(python=["3.7", "3.8", "3.9"])
Expand All @@ -258,12 +248,11 @@ def showcase_unit_add_iam_methods(session):
# google-auth is a transitive dependency so it isn't in the
# lower bound constraints file produced above.
session.install("google-auth==1.21.1")
run_showcase_unit_tests(session, fail_under=0)
run_showcase_unit_tests(session)

# 2. Run the tests again with latest version of dependencies
session.install(".", "--upgrade", "--force-reinstall")
# This time aggregate coverage should reach 100%
run_showcase_unit_tests(session, fail_under=100)
run_showcase_unit_tests(session)


@nox.session(python="3.8")
Expand Down
8 changes: 4 additions & 4 deletions tests/system/test_resource_crud.py