Skip to content

Commit dc5143a

Browse files
committed
Revert "test: fix for system tests"
This reverts commit f8b74d2.
1 parent f8b74d2 commit dc5143a

File tree

1 file changed

+1
-50
lines changed

1 file changed

+1
-50
lines changed

packages/google-auth/system_tests/noxfile.py

Lines changed: 1 addition & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -29,55 +29,6 @@
2929

3030
import nox
3131

32-
import os
33-
import subprocess
34-
35-
import os
36-
import subprocess
37-
38-
def _provision_kokoro_secrets():
39-
"""Downloads CI secrets directly from GCS and formats them for the tests."""
40-
if not os.environ.get("KOKORO_GFILE_DIR"):
41-
return # We are not running in Kokoro, skip.
42-
43-
dest_dir = os.path.join(os.path.dirname(__file__), "data")
44-
os.makedirs(dest_dir, exist_ok=True)
45-
46-
print("\n--- DEBUG: Fetching secrets from GCS ---")
47-
try:
48-
subprocess.run(
49-
["gsutil", "cp", "gs://cloud-devrel-kokoro-resources/google-auth-library-python/*", dest_dir],
50-
check=True,
51-
capture_output=True,
52-
text=True
53-
)
54-
55-
# 1. Rename the hyphen file to an underscore
56-
downloaded_sa = os.path.join(dest_dir, "service-account.json")
57-
expected_sa = os.path.join(dest_dir, "service_account.json")
58-
if os.path.exists(downloaded_sa):
59-
os.rename(downloaded_sa, expected_sa)
60-
61-
# 2. Fake the authorized_user file if it's missing (using the service account)
62-
expected_au = os.path.join(dest_dir, "authorized_user.json")
63-
if os.path.exists(expected_sa) and not os.path.exists(expected_au):
64-
import shutil
65-
shutil.copy(expected_sa, expected_au)
66-
67-
print("--- DEBUG: Successfully downloaded and formatted secrets. ---")
68-
print(f"--- DEBUG: Final files ready for testing: {os.listdir(dest_dir)} ---")
69-
70-
except subprocess.CalledProcessError as e:
71-
print(f"--- DEBUG: Failed to download from GCS. stderr: {e.stderr} ---")
72-
except FileNotFoundError:
73-
print("--- DEBUG: gsutil not found in path ---")
74-
75-
print("-" * 40 + "\n")
76-
77-
# Execute this immediately when Nox loads the file
78-
_provision_kokoro_secrets()
79-
80-
8132
HERE = os.path.abspath(os.path.dirname(__file__))
8233
LIBRARY_DIR = os.path.abspath(os.path.dirname(HERE))
8334
DATA_DIR = os.path.join(HERE, "data")
@@ -320,7 +271,7 @@ def compute_engine(session):
320271
session.install(*TEST_DEPENDENCIES_SYNC)
321272
# unset Application Default Credentials so
322273
# credentials are detected from environment
323-
session.virtualenv.env.pop("GOOGLE_APPLICATION_CREDENTIALS", None)
274+
del session.virtualenv.env["GOOGLE_APPLICATION_CREDENTIALS"]
324275
session.install(LIBRARY_DIR)
325276
default(
326277
session,

0 commit comments

Comments
 (0)