From c1af43d56fc48427d1414e84bf308004b7dee144 Mon Sep 17 00:00:00 2001 From: "Brian C. Lane" Date: Wed, 5 Feb 2020 14:38:28 -0800 Subject: [PATCH] tests: Finish switch to using example-development in composer tests These tests are fragile, order matters in some cases, and a previous patch was incomplete. The diff test was failing because the blueprint that it checks must be pushed twice in order to trigger the version bump and 'Changed Version' output from composer-cli. Related: rhbz#1785154 --- tests/composer/test_blueprints.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/composer/test_blueprints.py b/tests/composer/test_blueprints.py index 1c0e1f2c..b24daf73 100644 --- a/tests/composer/test_blueprints.py +++ b/tests/composer/test_blueprints.py @@ -175,7 +175,7 @@ class BlueprintsTest(unittest.TestCase): def test_save_0(self): """blueprints save example-development""" blueprints_save("/run/weldr/api.socket", 0, ["example-development"], show_json=False) - self.assertTrue(os.path.exists("example-http-server.toml")) + self.assertTrue(os.path.exists("example-development.toml")) @unittest.skipUnless(os.path.exists("/run/weldr/api.socket"), "Test requires a running API server") def test_save_1(self): @@ -233,7 +233,7 @@ class BlueprintsTest(unittest.TestCase): @unittest.skipUnless(os.path.exists("/run/weldr/api.socket"), "Test requires a running API server") def test_tag(self): """blueprints tag""" - rc = blueprints_tag("/run/weldr/api.socket", 0, ["glusterfs"], show_json=False) + rc = blueprints_tag("/run/weldr/api.socket", 0, ["example-development"], show_json=False) self.assertTrue(rc == 0) @unittest.skipUnless(os.path.exists("/run/weldr/api.socket"), "Test requires a running API server") @@ -253,7 +253,7 @@ class BlueprintsTest(unittest.TestCase): @unittest.skipUnless(os.path.exists("/run/weldr/api.socket"), "Test requires a running API server") def test_workspace(self): """blueprints workspace""" - rc = blueprints_push("/run/weldr/api.socket", 0, ["example-http-server.toml"], show_json=False) + rc = blueprints_push("/run/weldr/api.socket", 0, ["example-development.toml"], show_json=False) self.assertTrue(rc == 0) # XXX MUST COME LAST @@ -263,12 +263,12 @@ class BlueprintsTest(unittest.TestCase): """blueprints diff""" # Get the oldest commit, it should be 2nd to last line with captured_output() as (out, _): - rc = blueprints_changes("/run/weldr/api.socket", 0, ["example-http-server"], show_json=False) + rc = blueprints_changes("/run/weldr/api.socket", 0, ["example-development"], show_json=False) output = out.getvalue().strip().splitlines() first_commit = output[-2].split()[1] with captured_output() as (out, _): - rc = blueprints_diff("/run/weldr/api.socket", 0, ["example-http-server", first_commit, "HEAD"], show_json=False) + rc = blueprints_diff("/run/weldr/api.socket", 0, ["example-development", first_commit, "HEAD"], show_json=False) output = out.getvalue().strip() self.assertTrue(rc == 0) self.assertTrue("Changed Version" in output)