Skip to content

Commit f037044

Browse files
committed
chore(generator): add local google-api-core path override to noxfile showcase tests
Injects local workspace path override for google-api-core package to allow running showcase unit tests successfully when new changes are introduced to api-core.
1 parent 7d5da69 commit f037044

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

packages/gapic-generator/noxfile.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
from os import path
3131
import shutil
3232

33+
CURRENT_DIRECTORY = Path(__file__).parent.absolute()
34+
3335

3436
nox.options.error_on_missing_interpreters = True
3537

@@ -487,6 +489,14 @@ def run_showcase_unit_tests(session, fail_under=100, rest_async_io_enabled=False
487489
# Freeze and print python environment package versions
488490
session.run("python", "-m", "pip", "freeze")
489491

492+
google_api_core_dir = next(
493+
(str(p / "packages" / "google-api-core") for p in CURRENT_DIRECTORY.parents if (p / "packages" / "google-api-core").exists()),
494+
None
495+
)
496+
if google_api_core_dir:
497+
session.run("pip", "uninstall", "google-api-core", "-y")
498+
session.install("-e", google_api_core_dir, "--no-deps")
499+
490500
# Run the tests.
491501
session.run(
492502
"py.test",

0 commit comments

Comments
 (0)