Skip to content

Commit 107a1a0

Browse files
committed
Override compute_api_version flag default instead of hardcoding
1 parent f3a5a31 commit 107a1a0

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

tests/subsetting_test.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,15 @@
1818
from absl import flags
1919
from absl import logging
2020
from absl.testing import absltest
21-
from typing_extensions import override
2221

2322
from framework import xds_k8s_testcase
2423
from framework.helpers import skips
2524

2625
flags.adopt_module_key_flags(xds_k8s_testcase)
26+
# Change the default value of --compute_api_version to v1alpha.
27+
# Subsetting test requires Compute v1alpha APIs.
28+
# Can be tested with another API version if the flag is passed to the test.
29+
flags.set_default(xds_k8s_testcase.xds_flags.COMPUTE_API_VERSION, "v1alpha")
2730

2831
# Type aliases
2932
_XdsTestServer = xds_k8s_testcase.XdsTestServer
@@ -35,14 +38,6 @@
3538

3639

3740
class SubsettingTest(xds_k8s_testcase.RegularXdsKubernetesTestCase):
38-
@classmethod
39-
@override
40-
def setUpClass(cls):
41-
# TODO(sergiitk): use when absl updated to 1.3.0+, also set
42-
# flags.set_default(xds_flags.COMPUTE_API_VERSION, 'v1alpha')
43-
super().setUpClass()
44-
cls.compute_api_version = "v1alpha"
45-
4641
@staticmethod
4742
def is_supported(config: skips.TestConfig) -> bool:
4843
# Subsetting is an experimental feature where most work is done on the

0 commit comments

Comments
 (0)