From e9b3dbbe18d9a465148cc8df494971054b87654a Mon Sep 17 00:00:00 2001 From: Daniel Firth Date: Tue, 15 Oct 2013 11:47:47 +0000 Subject: Deploying a non-cluster morphology now displays an error message --- morphlib/plugins/deploy_plugin.py | 4 ++++ yarns/deployment.yarn | 10 ++++++++++ yarns/implementations.yarn | 9 ++++++++- 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 yarns/deployment.yarn diff --git a/morphlib/plugins/deploy_plugin.py b/morphlib/plugins/deploy_plugin.py index 35bb2b6e..825b0124 100644 --- a/morphlib/plugins/deploy_plugin.py +++ b/morphlib/plugins/deploy_plugin.py @@ -274,6 +274,10 @@ class DeployPlugin(cliapp.Plugin): root_repo_dir = self.other.find_repository(branch_dir, root_repo) data = self.other.load_morphology(root_repo_dir, cluster) + if data['kind'] != 'cluster': + raise cliapp.AppException( + "Error: morph deploy is only supported for cluster" + " morphologies.") for system in data['systems']: self.deploy_system(system, env_vars) diff --git a/yarns/deployment.yarn b/yarns/deployment.yarn new file mode 100644 index 00000000..0fb3fb72 --- /dev/null +++ b/yarns/deployment.yarn @@ -0,0 +1,10 @@ +Morph Deployment Tests +====================== + + SCENARIO deploying a non-cluster morphology + GIVEN a workspace + AND a git server + WHEN checking out the master system branch + AND attempting to deploy the system test-system in branch master + THEN morph failed + AND the deploy error message includes the string "morph deploy is only supported for cluster morphologies" diff --git a/yarns/implementations.yarn b/yarns/implementations.yarn index 7efff54e..22120130 100644 --- a/yarns/implementations.yarn +++ b/yarns/implementations.yarn @@ -453,10 +453,17 @@ Implementation sections for building cd "$DATADIR/workspace/$MATCH_2" attempt_morph build "$MATCH_1" +Implementation sections for deployment +====================================== + + IMPLEMENTS WHEN attempting to deploy the (system|cluster) (\S+) in branch (\S+) + cd "$DATADIR/workspace/$MATCH_3" + attempt_morph deploy "$MATCH_2" + Implementations sections for reading error messages =================================================== - IMPLEMENTS THEN the (init|build|checkout|branch) error message includes the string "(.*)" + IMPLEMENTS THEN the (init|build|checkout|branch|deploy) error message includes the string "(.*)" grep "$MATCH_2" "$DATADIR/result-$MATCH_1" IMPLEMENTS for test file and directory handling -- cgit v1.2.1