|
19 | 19 |
|
20 | 20 | import nox
|
21 | 21 |
|
| 22 | +# WARNING - WARNING - WARNING - WARNING - WARNING |
| 23 | +# WARNING - WARNING - WARNING - WARNING - WARNING |
| 24 | +# DO NOT EDIT THIS FILE EVER! |
| 25 | +# WARNING - WARNING - WARNING - WARNING - WARNING |
| 26 | +# WARNING - WARNING - WARNING - WARNING - WARNING |
| 27 | + |
| 28 | +# Copy `noxfile_config.py` to your directory and modify it instead. |
| 29 | + |
22 | 30 |
|
23 | 31 | # `TEST_CONFIG` dict is a configuration hook that allows users to
|
24 | 32 | # modify the test configurations. The values here should be in sync
|
25 |
| -# with `test_config.py`. Users will copy `test_config.py` into their |
26 |
| -# directory and modify it. |
| 33 | +# with `noxfile_config.py`. Users will copy `noxfile_config.py` into |
| 34 | +# their directory and modify it. |
27 | 35 |
|
28 | 36 | TEST_CONFIG = {
|
29 | 37 | # You can opt out from the test for specific Python versions.
|
|
38 | 46 | # names for your e2e test.
|
39 | 47 | 'cloud_run_e2e_test_files': ['e2e_test.py'],
|
40 | 48 |
|
41 |
| - # If set to True, the test will install the library from the root |
42 |
| - # of the repository. |
43 |
| - 'install_library_from_source': False, |
44 |
| - |
45 |
| - # Set to True if you want to use the Cloud Project configured for each |
46 |
| - # build. |
47 |
| - 'use_build_specific_project': False, |
48 |
| - |
49 |
| - # An envvar key for determining the build specific project. Normally you |
50 |
| - # don't have to modify this. |
51 |
| - 'build_specific_project_env': 'BUILD_SPECIFIC_GCLOUD_PROJECT', |
| 49 | + # An envvar key for determining the project id to use. Change it |
| 50 | + # to 'BUILD_SPECIFIC_GCLOUD_PROJECT' if you want to opt in using |
| 51 | + # a build specific Cloud project. |
| 52 | + 'gcloud_project_env': 'GCLOUD_PROJECT', |
| 53 | + # 'gcloud_project_env': 'BUILD_SPECIFIC_GCLOUD_PROJECT', |
52 | 54 |
|
53 | 55 | # A dictionary you want to inject into your test. Don't put any
|
54 | 56 | # secrets here. These values will override predefined values.
|
55 | 57 | 'envs': {},
|
56 | 58 | }
|
57 | 59 |
|
58 | 60 | try:
|
59 |
| - from test_config import TEST_CONFIG_OVERRIDE |
| 61 | + from noxfile_config import TEST_CONFIG_OVERRIDE |
60 | 62 | except ImportError:
|
61 | 63 | TEST_CONFIG_OVERRIDE = {}
|
62 | 64 |
|
63 |
| -# Update the TEST_CONFIG with user supplied values. |
| 65 | +# Update the TEST_CONFIG with the user supplied values. |
64 | 66 | TEST_CONFIG.update(TEST_CONFIG_OVERRIDE)
|
65 | 67 |
|
66 | 68 |
|
67 | 69 | def get_pytest_env_vars():
|
68 | 70 | """Returns a dict for pytest invocation."""
|
69 | 71 | ret = {}
|
70 | 72 |
|
71 |
| - # Override the GCLOUD_PROJECT |
72 |
| - if TEST_CONFIG['use_build_specific_project']: |
73 |
| - env_key = TEST_CONFIG['build_specific_project_env'] |
74 |
| - # This should error out if not set. |
75 |
| - ret['GOOGLE_CLOUD_PROJECT'] = os.environ[env_key] |
76 |
| - ret['GCLOUD_PROJECT'] = os.environ[env_key] |
| 73 | + # Override the GCLOUD_PROJECT and the alias. |
| 74 | + env_key = TEST_CONFIG['gcloud_project_env'] |
| 75 | + # This should error out if not set. |
| 76 | + ret['GOOGLE_CLOUD_PROJECT'] = os.environ[env_key] |
| 77 | + ret['GCLOUD_PROJECT'] = os.environ[env_key] |
77 | 78 |
|
78 | 79 | # Apply user supplied envs.
|
79 | 80 | ret.update(TEST_CONFIG['envs'])
|
@@ -204,9 +205,6 @@ def cloud_run(session):
|
204 | 205 |
|
205 | 206 | # Only update gcloud on Kokoro.
|
206 | 207 | if os.environ.get("KOKORO_JOB_NAME"):
|
207 |
| - # Update gcloud |
208 |
| - session.run("gcloud", "components", "update", "--quiet") |
209 |
| - |
210 | 208 | # Activate service account
|
211 | 209 | key_file = os.environ['GOOGLE_APPLICATION_CREDENTIALS']
|
212 | 210 | session.run(
|
|
0 commit comments