From 80029eb8a34b3f1cedec6e03b16388c04345aa27 Mon Sep 17 00:00:00 2001 From: larkee <31196561+larkee@users.noreply.github.com> Date: Wed, 24 Jun 2020 10:04:00 +1000 Subject: [PATCH] ci: add kokoro change to synth.py (#104) * ci: add kokoro change to synth.py * skip test that fails when tests are run in parallel * fix lint errors Co-authored-by: larkee --- synth.py | 8 ++++++++ tests/system/test_system.py | 3 +++ 2 files changed, 11 insertions(+) diff --git a/synth.py b/synth.py index 078a866c58..7f9540f72b 100644 --- a/synth.py +++ b/synth.py @@ -163,4 +163,12 @@ "include google/cloud/spanner_v1/gapic/transports/spanner.grpc.config\n", ) +s.replace( + ".kokoro/build.sh", + "# Remove old nox", + "# Set up creating a new instance for each system test run\n" + "export GOOGLE_CLOUD_TESTS_CREATE_SPANNER_INSTANCE=true\n" + "\n\g<0>", +) + s.shell.run(["nox", "-s", "blacken"], hide_output=False) diff --git a/tests/system/test_system.py b/tests/system/test_system.py index be6bbdb437..9fde7db0c3 100644 --- a/tests/system/test_system.py +++ b/tests/system/test_system.py @@ -143,6 +143,9 @@ def tearDown(self): for instance in self.instances_to_delete: instance.delete() + @unittest.skipIf( + CREATE_INSTANCE, "This test fails when system tests are run in parallel." + ) def test_list_instances(self): instances = list(Config.CLIENT.list_instances()) # We have added one new instance in `setUpModule`.