summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <lars.wirzenius@codethink.co.uk>2013-11-05 15:49:22 +0000
committerLars Wirzenius <lars.wirzenius@codethink.co.uk>2013-11-05 15:49:22 +0000
commitb265218489791c6c1d3682c503609fa2a9ce030a (patch)
tree582823622c25db4b17d42a7fbeaaf008e8e422a9
parent00246636d66961cf50fea902972e828ae0890f7b (diff)
parentd3d49283aad741aab40c39cb7e54c814d8a06ea1 (diff)
downloadmorph-b265218489791c6c1d3682c503609fa2a9ce030a.tar.gz
Merge remote-tracking branch 'origin/danielfirth/language-changes'
Needed to update copyright years when merging. Don't understand why the problem didn't show up earlier, since it doesn't seem to have been caused by Dan's changes.
-rw-r--r--morphlib/remoteartifactcache.py2
-rw-r--r--morphlib/remoteartifactcache_tests.py2
-rw-r--r--yarns/architecture.yarn4
-rw-r--r--yarns/branches-workspaces.yarn120
-rw-r--r--yarns/building.yarn6
-rw-r--r--yarns/deployment.yarn4
-rw-r--r--yarns/implementations.yarn120
-rw-r--r--yarns/regression.yarn6
8 files changed, 126 insertions, 138 deletions
diff --git a/morphlib/remoteartifactcache.py b/morphlib/remoteartifactcache.py
index c2f88773..9f6bf69e 100644
--- a/morphlib/remoteartifactcache.py
+++ b/morphlib/remoteartifactcache.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2012 Codethink Limited
+# Copyright (C) 2012-2013 Codethink Limited
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/morphlib/remoteartifactcache_tests.py b/morphlib/remoteartifactcache_tests.py
index dbb094a3..e7f45f58 100644
--- a/morphlib/remoteartifactcache_tests.py
+++ b/morphlib/remoteartifactcache_tests.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2012 Codethink Limited
+# Copyright (C) 2012-2013 Codethink Limited
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/yarns/architecture.yarn b/yarns/architecture.yarn
index 66329c81..038492cd 100644
--- a/yarns/architecture.yarn
+++ b/yarns/architecture.yarn
@@ -5,7 +5,7 @@ Morph Cross-Building Tests
GIVEN a workspace
AND a git server
AND a system called base-system-testarch for architecture testarch in the git server
- WHEN checking out the master system branch
- AND attempting to build the system base-system-testarch in branch master
+ WHEN the user checks out the system branch called master
+ AND the user attempts to build the system base-system-testarch in branch master
THEN morph failed
AND the build error message includes the string "Are you trying to cross-build?"
diff --git a/yarns/branches-workspaces.yarn b/yarns/branches-workspaces.yarn
index fd2154e7..b928f628 100644
--- a/yarns/branches-workspaces.yarn
+++ b/yarns/branches-workspaces.yarn
@@ -12,14 +12,14 @@ The first thing a user needs to do is create a workspace.
SCENARIO create and initialise a new workspace
GIVEN no workspace
- WHEN morph initialises a workspace
+ WHEN the user initialises a workspace
THEN an empty workspace exists
The workspace directory may exist, if it is empty.
SCENARIO initialise an empty workspace directory
GIVEN an empty workspace directory
- WHEN morph initialises a workspace
+ WHEN the user initialises a workspace
THEN an empty workspace exists
However, the directory must really be empty. It must not be
@@ -27,8 +27,8 @@ an empty, but initialised workspace.
SCENARIO initialise an existing, empty workspace directory
GIVEN no workspace
- WHEN morph initialises a workspace
- AND morph attempts to initialise a workspace
+ WHEN the user initialises a workspace
+ AND the user attempts to initialise a workspace
THEN morph failed
Likewise, if the directory exists, and is non-empty, but isn't an
@@ -36,7 +36,7 @@ existing workspace, initialising it should fail.
SCENARIO initialise a non-empty workspace directory
GIVEN a non-empty workspace directory
- WHEN morph attempts to initialise a workspace
+ WHEN the user attempts to initialise a workspace
THEN morph failed
Checking out or branching system branches
@@ -47,7 +47,7 @@ Once we have a workspace, we can check out a system branch.
SCENARIO check out an existing system branch
GIVEN a workspace
AND a git server
- WHEN checking out the master system branch
+ WHEN the user checks out the system branch called master
THEN the system branch master is checked out
Checking out a system branch should fail, if the branch doesn't exist.
@@ -55,7 +55,7 @@ Checking out a system branch should fail, if the branch doesn't exist.
SCENARIO checking out a system branch that doesn't exist
GIVEN a workspace
AND a git server
- WHEN morph attempts to check out system branch foo
+ WHEN the user attempts to check out the system branch called foo
THEN morph failed
Checking out a system branch should also fail if the repository does
@@ -64,7 +64,7 @@ not contain any system morphologies.
SCENARIO checking out a system branch with no systems
GIVEN a workspace
AND a git server
- WHEN morph attempts to check out a repository with no systems
+ WHEN the user attempts to check out from a repository with no systems
THEN morph failed
We can, instead, create a new system branch, off master.
@@ -72,7 +72,7 @@ We can, instead, create a new system branch, off master.
SCENARIO branch off master
GIVEN a workspace
AND a git server
- WHEN user creates system branch foo
+ WHEN the user creates a system branch called foo
THEN the system branch foo is checked out
We can also branch off another system branch. However, we need to first
@@ -82,9 +82,9 @@ to check for that locally.
SCENARIO branch off non-master
GIVEN a workspace
AND a git server
- WHEN user creates system branch foo
- AND pushing system branch foo to git server
- AND creating system branch bar, based on foo
+ WHEN the user creates a system branch called foo
+ AND the user pushes the system branch called foo to the git server
+ AND the user creates a system branch called bar, based on foo
THEN the system branch bar is checked out
Query commands in workspaces
@@ -95,8 +95,8 @@ directory, regardless of where the user is. There's a few cases.
SCENARIO morph workspace works at root of empty workspace
GIVEN a workspace
- WHEN morph reports workspace in .
- THEN workspace is reported correctly
+ WHEN the user reports the workspace from the directory .
+ THEN the workspace is reported correctly
Also check it in the root of a system branch checkout, and inside
a git checkout inside that.
@@ -104,22 +104,22 @@ a git checkout inside that.
SCENARIO morph workspace works in system branch checkouts
GIVEN a workspace
AND a git server
- WHEN checking out the master system branch
- AND morph reports workspace in master
- THEN workspace is reported correctly
+ WHEN the user checks out the system branch called master
+ AND the user reports the workspace from the directory master
+ THEN the workspace is reported correctly
We leak a little bit of the implementation here, to keep things simple:
the (mocked) git server the implementation sets up has the `test:morphs`
repository, which is the system branch root repository.
- WHEN morph reports workspace in master/test:morphs
- THEN workspace is reported correctly
+ WHEN the user reports the workspace from the directory master/test:morphs
+ THEN the workspace is reported correctly
However, running it outside a workspace should fail.
SCENARIO morph fails outside workspace
GIVEN no workspace
- WHEN morph attempts to report workspace
+ WHEN the user attempts to report the workspace from a non-workspace directory
THEN morph failed
`morph show-system-branch` should report the name of the system
@@ -130,15 +130,15 @@ current working directory, it will find it and report it correctly.
SCENARIO morph reports system branch
GIVEN a workspace
AND a git server
- WHEN checking out the master system branch
- AND reporting system branch in master
- THEN system branch is reported as master
+ WHEN the user checks out the system branch called master
+ AND the user reports the system branch from the directory master
+ THEN the system branch is reported as master
- WHEN reporting system branch in master/test:morphs
- THEN system branch is reported as master
+ WHEN the user reports the system branch from the directory master/test:morphs
+ THEN the system branch is reported as master
- WHEN reporting system branch in .
- THEN system branch is reported as master
+ WHEN the user reports the system branch from the directory .
+ THEN the system branch is reported as master
However, if there's two system branches checked out below the
current directory, things should fail.
@@ -146,9 +146,9 @@ current directory, things should fail.
SCENARIO morph fails to report system branch with two checked out
GIVEN a workspace
AND a git server
- WHEN checking out the master system branch
- AND user creates system branch foo
- AND attempting to report system branch in .
+ WHEN the user checks out the system branch called master
+ AND the user creates a system branch called foo
+ AND the user attempts to report the system branch from the directory .
THEN morph failed
`morph show-branch-root` reports the URL (possibly aliases) of the
@@ -158,12 +158,12 @@ somewhere outside a checkout, where exactly one checkout exists below.
SCENARIO morph reports system branch root repository
GIVEN a workspace
AND a git server
- WHEN checking out the master system branch
- AND reporting system branch root repository in master
- THEN root repository is reported as test:morphs
+ WHEN the user checks out the system branch called master
+ AND the user reports the system branch root repository from the directory master
+ THEN the system branch root repository is reported as test:morphs
- WHEN reporting system branch root repository in .
- THEN root repository is reported as test:morphs
+ WHEN the user reports the system branch root repository from the directory .
+ THEN the system branch root repository is reported as test:morphs
However, it fails if run outside a checkout and there's no system
branches checked out.
@@ -171,7 +171,7 @@ branches checked out.
SCENARIO morph fails to report system branch with none checked out
GIVEN a workspace
AND a git server
- WHEN attempting to report system branch root repository in .
+ WHEN the user attempts to report the system branch root repository from the directory .
THEN morph failed
Editing components
@@ -186,31 +186,31 @@ all the refs are unchanged.
SCENARIO morph branch does not edit refs
GIVEN a workspace
AND a git server
- WHEN user creates system branch foo
+ WHEN the user creates a system branch called foo
THEN in branch foo, system test-system refs test-stratum in master
AND in branch foo, stratum test-stratum refs test-chunk in master
Then edit the stratum.
- WHEN editing stratum test-stratum in system test-system in branch foo
+ WHEN the user edits the stratum test-stratum in the system test-system in branch foo
THEN in branch foo, system test-system refs test-stratum in foo
Edit the chunk. We make use of special knowledge here: `test:test-chunk`
is a chunk repository created in the mocked git server, for testing
purposes.
- WHEN editing chunk test-chunk in test-stratum in test-system in branch foo
+ WHEN the user edits the chunk test-chunk in the stratum test-stratum in the system test-system in branch foo
THEN in branch foo, system test-system refs test-stratum in foo
AND in branch foo, stratum test-stratum refs test-chunk in foo
- AND edited chunk test:test-chunk has git branch foo
+ AND the edited chunk test:test-chunk has git branch foo
Morph edit should only work with a system argument.
SCENARIO morph edit errors when supplied only a stratum and chunk as arguments
GIVEN a workspace
AND a git server
- WHEN checking out the master system branch
- AND editing chunk test-chunk in stratum test-stratum with no system specified in branch master
+ WHEN the user checks out the system branch called master
+ AND the user edits the chunk test-chunk in the stratum test-stratum with no system specified in branch master
THEN morph failed
AND the edit error message includes the string "is not a system"
@@ -224,13 +224,13 @@ repositories referenced in the system branch.
SCENARIO morph status reports changes correctly
GIVEN a workspace
AND a git server
- WHEN user creates system branch foo
+ WHEN the user creates a system branch called foo
THEN morph reports no outstanding changes in foo
- WHEN editing stratum test-stratum in system test-system in branch foo
+ WHEN the user edits the stratum test-stratum in the system test-system in branch foo
THEN morph reports changes in foo in test:morphs only
- WHEN editing chunk test-chunk in test-stratum in test-system in branch foo
+ WHEN the user edits the chunk test-chunk in the stratum test-stratum in the system test-system in branch foo
THEN morph reports changes in foo in test:morphs only
WHEN creating file foo in test:test-chunk in branch foo
@@ -254,8 +254,8 @@ branch checkout.
SCENARIO morph foreach runs command in each git repo
GIVEN a workspace
AND a git server
- WHEN user creates system branch foo
- AND editing chunk test-chunk in test-stratum in test-system in branch foo
+ WHEN the user creates a system branch called foo
+ AND the user edits the chunk test-chunk in the stratum test-stratum in the system test-system in branch foo
AND running shell command in each repo in foo
THEN morph ran command in test:morphs in foo
AND morph ran command in test:test-chunk in foo
@@ -271,8 +271,8 @@ unpetrify and verify that we have all the same refs as before.
SCENARIO morph petrifies and unpetrifies
GIVEN a workspace
AND a git server
- WHEN user creates system branch foo
- AND pushing system branch foo to git server
+ WHEN the user creates a system branch called foo
+ AND the user pushes the system branch called foo to the git server
AND remembering all refs in foo
AND petrifying foo
THEN foo is petrified
@@ -289,15 +289,15 @@ system branch itself, only the tag.
SCENARIO morph tags a system branch
GIVEN a workspace
AND a git server
- WHEN user creates system branch foo
- AND tagging system branch foo as test123
+ WHEN the user creates a system branch called foo
+ AND the user tags the system branch called foo as test123
THEN morph tag test123 in foo is an annotated git tag
AND morph tag test123 in foo refers to a petrified commit
AND foo is not petrified
Creating a tag twice should fail.
- WHEN attempting to tag system branch foo as test123
+ WHEN the user attempts to tag the system branch called foo as test123
THEN morph failed
Working with null repositories and refs
@@ -313,7 +313,7 @@ These can be checked out like normal system branches.
GIVEN a workspace
AND a git server
AND null refs for local strata
- WHEN checking out the master system branch
+ WHEN the user checks out the system branch called master
THEN the system branch master is checked out
Likewise we can also create new system branches from these, and we
@@ -324,7 +324,7 @@ wouldn't need to worry about changing the system branch ref.
GIVEN a workspace
AND a git server
AND null refs for local strata
- WHEN user creates system branch foo
+ WHEN the user creates a system branch called foo
THEN the system branch foo is checked out
When we edit a morphology with null refs, they stay null.
@@ -336,20 +336,20 @@ When we edit a morphology with null refs, they stay null.
When creating the branch, the refs remain null.
- WHEN user creates system branch foo
+ WHEN the user creates a system branch called foo
THEN in branch foo, system test-system refs test-stratum in None
After editing the stratum they remain null.
- WHEN editing stratum test-stratum in system test-system in branch foo
+ WHEN the user edits the stratum test-stratum in the system test-system in branch foo
THEN in branch foo, system test-system refs test-stratum in None
Refs to chunks are still altered as usual
- WHEN editing chunk test-chunk in test-stratum in test-system in branch foo
+ WHEN the user edits the chunk test-chunk in the stratum test-stratum in the system test-system in branch foo
THEN in branch foo, system test-system refs test-stratum in None
AND in branch foo, stratum test-stratum refs test-chunk in foo
- AND edited chunk test:test-chunk has git branch foo
+ AND the edited chunk test:test-chunk has git branch foo
Petrifying also leaves null refs unmolested
@@ -357,8 +357,8 @@ Petrifying also leaves null refs unmolested
GIVEN a workspace
AND a git server
AND null refs for local strata
- WHEN user creates system branch foo
- AND pushing system branch foo to git server
+ WHEN the user creates a system branch called foo
+ AND the user pushes the system branch called foo to the git server
AND remembering all refs in foo
AND petrifying foo
THEN in branch foo, system test-system refs test-stratum in None
diff --git a/yarns/building.yarn b/yarns/building.yarn
index 2bd9b1e4..b78c69cd 100644
--- a/yarns/building.yarn
+++ b/yarns/building.yarn
@@ -4,8 +4,8 @@ Morph Building Tests
SCENARIO attempting to build a system morphology which has never been committed
GIVEN a workspace
AND a git server
- WHEN checking out the master system branch
- AND creating an uncommitted system morphology called base-system-testarch for architecture testarch in system branch master
- AND attempting to build the system base-system-testarch in branch master
+ WHEN the user checks out the system branch called master
+ AND the user creates an uncommitted system morphology called base-system-testarch for architecture testarch in system branch master
+ AND the user attempts to build the system base-system-testarch in branch master
THEN morph failed
AND the build error message includes the string "Did you forget to commit it?"
diff --git a/yarns/deployment.yarn b/yarns/deployment.yarn
index 0fb3fb72..35f933b7 100644
--- a/yarns/deployment.yarn
+++ b/yarns/deployment.yarn
@@ -4,7 +4,7 @@ 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
+ WHEN the user checks out the system branch called master
+ AND the user attempts 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 1350662d..6491b38e 100644
--- a/yarns/implementations.yarn
+++ b/yarns/implementations.yarn
@@ -20,11 +20,10 @@ We run `morph init` in two different ways: either the simple way,
letting yarn catch errors, or in a way that catches the error so
we can test it later in a THEN step.
- IMPLEMENTS WHEN morph initialises a workspace
- run_morph init "$DATADIR/workspace"
-
- IMPLEMENTS WHEN morph attempts to initialise a workspace
- attempt_morph init "$DATADIR/workspace"
+ IMPLEMENTS WHEN the user (attempts to initialise|initialises) a workspace
+ set init "$DATADIR/workspace"
+ if [ $MATCH_1 == "initialises" ]; then run_morph "$@"
+ else attempt_morph "$@"; fi
IMPLEMENTS THEN morph failed
case $(cat "$DATADIR/morph-exit") in
@@ -158,19 +157,15 @@ Implementation sections for system branch operations
Checkout out an existing system branch. We parameterise this so the
same phrase can be used to check out any system branch.
- IMPLEMENTS WHEN checking out the (\S+) system (branch|tag)
- cd "$DATADIR/workspace"
- run_morph checkout test:morphs "$MATCH_1"
-
-Attempt to check out a system branch, and remember if it failed.
-
- IMPLEMENTS WHEN morph attempts to check out system branch (\S+)
+ IMPLEMENTS WHEN the user (attempts to check|checks) out the system (branch|tag) called (\S+)
cd "$DATADIR/workspace"
- attempt_morph checkout test:morphs "$MATCH_1"
+ set checkout test:morphs "$MATCH_3"
+ if [ $MATCH_1 == "checks" ]; then run_morph "$@"
+ else attempt_morph "$@"; fi
Attempt to check out a system branch from a root that has no systems.
- IMPLEMENTS WHEN morph attempts to check out a repository with no systems
+ IMPLEMENTS WHEN the user attempts to check out from a repository with no systems
cd "$DATADIR/workspace"
attempt_morph checkout test:test-chunk master
@@ -183,109 +178,97 @@ We also need to verify that a system branch has been checked out.
We can create a new branch, off master.
- IMPLEMENTS WHEN user creates system branch (\S+)
+ IMPLEMENTS WHEN the user (attempts to create|creates) a system branch called (\S+)
cd "$DATADIR/workspace"
- run_morph branch test:morphs "$MATCH_1"
-
- IMPLEMENTS WHEN user attempts to create system branch (\S+)
- cd "$DATADIR/workspace"
- attempt_morph branch test:morphs "$MATCH_1"
+ set branch test:morphs "$MATCH_2"
+ if [ $MATCH_1 == "creates"]; then run morph "$@"
+ else attempt_morph "$@"; fi
We can create a new branch, off another system branch.
- IMPLEMENTS WHEN creating system branch (\S+), based on (\S+)
+ IMPLEMENTS WHEN the user creates a system branch called (\S+), based on (\S+)
cd "$DATADIR/workspace"
run_morph branch test:morphs "$MATCH_1" "$MATCH_2"
Attempt to branch a system branch from a root that had no systems.
- IMPLEMENTS WHEN morph attempts to branch a repository with no systems
+ IMPLEMENTS WHEN the user attempts to branch a repository with no systems
cd "$DATADIR/workspace"
attempt_morph branch test:test-chunk foo
Pushing all changes in a system branch checkout to the git server.
- IMPLEMENTS WHEN pushing system branch (\S+) to git server
+ IMPLEMENTS WHEN the user pushes the system branch called (\S+) to the git server
# FIXME: For now, this is just the morphs checkout.
run_in "$DATADIR/workspace/$MATCH_1/test:morphs" git push origin HEAD
Report workspace path.
- IMPLEMENTS WHEN morph reports workspace in (\S+)
+ IMPLEMENTS WHEN the user reports the workspace from the directory (\S+)
cd "$DATADIR/workspace/$MATCH_1"
run_morph workspace > "$DATADIR/workspace-reported"
- IMPLEMENTS THEN workspace is reported correctly
+ IMPLEMENTS THEN the workspace is reported correctly
assert_equal $(cat "$DATADIR/workspace-reported") "$DATADIR/workspace"
- IMPLEMENTS WHEN morph attempts to report workspace
+ IMPLEMENTS WHEN the user attempts to report the workspace from a non-workspace directory
cd "$DATADIR"
attempt_morph workspace
Report system branch name:
- IMPLEMENTS WHEN reporting system branch in (\S+)
- cd "$DATADIR/workspace/$MATCH_1"
- run_morph show-system-branch > "$DATADIR/system-branch.reported"
+ IMPLEMENTS WHEN the user (attempts to report|reports) the system branch from the directory (\S+)
+ cd "$DATADIR/workspace/$MATCH_2"
+ set $DATADIR/system-branch.reported
+ if [ $MATCH_1 == reports ]; then run_morph show-system-branch > "$@"
+ else attempt_morph show-system-branch > "$@"; fi
- IMPLEMENTS THEN system branch is reported as (.*)
+ IMPLEMENTS THEN the system branch is reported as (.*)
echo "$MATCH_1" > "$DATADIR/system-branch.actual"
diff -u "$DATADIR/system-branch.actual" "$DATADIR/system-branch.reported"
- IMPLEMENTS WHEN attempting to report system branch in (.*)
- cd "$DATADIR/workspace/$MATCH_1"
- attempt_morph show-system-branch
-
Report system branch root repository.
- IMPLEMENTS WHEN reporting system branch root repository in (.*)
- cd "$DATADIR/workspace/$MATCH_1"
- run_morph show-branch-root > "$DATADIR/branch-root.reported"
+ IMPLEMENTS WHEN the user (attempts to report|reports) the system branch root repository from the directory (.*)
+ cd "$DATADIR/workspace/$MATCH_2"
+ set $DATADIR/branch-root.reported
+ if [ $MATCH_1 == "reports" ]; then run_morph show-branch-root > "$@"
+ else attempt_morph show-branch-root > "$@"; fi
- IMPLEMENTS THEN root repository is reported as (.*)
+ IMPLEMENTS THEN the system branch root repository is reported as (.*)
echo "$MATCH_1" > "$DATADIR/branch-root.actual"
diff -u "$DATADIR/branch-root.actual" "$DATADIR/branch-root.reported"
- IMPLEMENTS WHEN attempting to report system branch root repository in (.*)
- cd "$DATADIR/workspace/$MATCH_1"
- attempt_morph show-branch-root
-
Editing morphologies with `morph edit`.
- IMPLEMENTS THEN in branch (\S+), system (\S+) refs (\S+) in (\S+)
- "$SRCDIR/scripts/yaml-extract" \
- "$DATADIR/workspace/$MATCH_1/test:morphs/$MATCH_2.morph" \
- strata name="$MATCH_3" ref > "$DATADIR/ref.actual"
- echo "$MATCH_4" > "$DATADIR/ref.wanted"
- diff -u "$DATADIR/ref.wanted" "$DATADIR/ref.actual"
-
- IMPLEMENTS THEN in branch (\S+), stratum (\S+) refs (\S+) in (\S+)
+ IMPLEMENTS THEN in branch (\S+), (system|stratum) (\S+) refs (\S+) in (\S+)
+ if [ $MATCH_2 == system ]; then set strata; else set chunks; fi
"$SRCDIR/scripts/yaml-extract" \
- "$DATADIR/workspace/$MATCH_1/test:morphs/$MATCH_2.morph" \
- chunks name="$MATCH_3" ref > "$DATADIR/ref.actual"
- echo "$MATCH_4" > "$DATADIR/ref.wanted"
+ "$DATADIR/workspace/$MATCH_1/test:morphs/$MATCH_3.morph" \
+ $@ name="$MATCH_4" ref > "$DATADIR/ref.actual"
+ echo "$MATCH_5" > "$DATADIR/ref.wanted"
diff -u "$DATADIR/ref.wanted" "$DATADIR/ref.actual"
- IMPLEMENTS WHEN editing stratum (\S+) in system (\S+) in branch (\S+)
+ IMPLEMENTS WHEN the user edits the stratum (\S+) in the system (\S+) in branch (\S+)
cd "$DATADIR/workspace/$MATCH_3/test:morphs"
run_morph edit "$MATCH_2" "$MATCH_1"
- IMPLEMENTS WHEN editing chunk (\S+) in (\S+) in (\S+) in branch (\S+)
+ IMPLEMENTS WHEN the user edits the chunk (\S+) in the stratum (\S+) in the system (\S+) in branch (\S+)
cd "$DATADIR/workspace/$MATCH_4/test:morphs"
run_morph edit "$MATCH_3" "$MATCH_2" "$MATCH_1"
- IMPLEMENTS THEN edited chunk (\S+) has git branch (\S+)
+ IMPLEMENTS THEN the edited chunk (\S+) has git branch (\S+)
ls -l "$DATADIR/workspace/$MATCH_2"
cd "$DATADIR/workspace/$MATCH_2/$MATCH_1"
git branch | awk '$1 == "*" { print $2 }' > "$DATADIR/git-branch.actual"
echo "$MATCH_2" > "$DATADIR/git-branch.wanted"
diff -u "$DATADIR/git-branch.wanted" "$DATADIR/git-branch.actual"
- IMPLEMENTS WHEN editing chunk (\S+) in stratum (\S+) with no system specified in branch (\S+)
+ IMPLEMENTS WHEN the user edits the chunk (\S+) in the stratum (\S+) with no system specified in branch (\S+)
cd "$DATADIR/workspace/$MATCH_3"
attempt_morph edit "$MATCH_2" "$MATCH_1"
- IMPLEMENTS WHEN creating an uncommitted system morphology called (\S+) for architecture (\S+) in system branch (\S+)
+ IMPLEMENTS WHEN the user creates an uncommitted system morphology called (\S+) for architecture (\S+) in system branch (\S+)
cat << EOF > "$DATADIR/workspace/$MATCH_3/test:morphs/$MATCH_1.morph"
arch: $MATCH_2
configuration-extensions: []
@@ -401,11 +384,12 @@ Petrification and unpetrification:
Tagging.
- IMPLEMENTS WHEN tagging system branch (\S+) as (\S+)
+ IMPLEMENTS WHEN the user tags the system branch called (\S+) as (\S+)
cd "$DATADIR/workspace/$MATCH_1/test:morphs"
+ set tag "$MATCH_2" -- -m "testing morph tagging"
run_morph tag "$MATCH_2" -- -m "testing morph tagging"
- IMPLEMENTS WHEN attempting to tag system branch (\S+) as (\S+)
+ IMPLEMENTS WHEN the user attempts to tag the system branch called (\S+) as (\S+)
cd "$DATADIR/workspace/$MATCH_1/test:morphs"
attempt_morph tag "$MATCH_2" -- -m "testing morph tagging"
@@ -467,16 +451,20 @@ Generating a manifest.
Implementation sections for building
====================================
- IMPLEMENTS WHEN attempting to build the system (\S+) in branch (\S+)
- cd "$DATADIR/workspace/$MATCH_2"
- attempt_morph build "$MATCH_1"
+ IMPLEMENTS WHEN the user (attempts to build|builds) the system (\S+) in branch (\S+)
+ cd "$DATADIR/workspace/$MATCH_3"
+ set build "$MATCH_2"
+ if [ $MATCH_1 == "builds" ]; then run_morph "$@"
+ else attempt_morph "$@"; fi
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"
+ IMPLEMENTS WHEN the user (attempts to deploy|deploys) the (system|cluster) (\S+) in branch (\S+)
+ cd "$DATADIR/workspace/$MATCH_4"
+ set build "$MATCH_3"
+ if [ $MATCH_1 == "deploys" ]; then run_morph "$@"
+ else attempt_morph deploy "$MATCH_3"; fi
Implementations sections for reading error messages
===================================================
diff --git a/yarns/regression.yarn b/yarns/regression.yarn
index 7480655d..a17d2f87 100644
--- a/yarns/regression.yarn
+++ b/yarns/regression.yarn
@@ -9,7 +9,7 @@ Testing if we can build after checking out from a tag.
SCENARIO morph build works after checkout from a tag
GIVEN a workspace
AND a git server
- WHEN checking out the test-tag system tag
+ WHEN the user checks out the system tag called test-tag
THEN morph build the system simple-system of the tag test-tag of the repo test:morphs
@@ -19,13 +19,13 @@ remove the existing directory.
SCENARIO re-running 'morph branch' fails, original branch untouched
GIVEN a workspace
AND a git server
- WHEN user creates system branch foo
+ WHEN the user creates a system branch called foo
THEN the system branch foo is checked out
The branch is checked out correctly, now it should fail if the user executes
`morph branch` with the same branch name.
- WHEN user attempts to create system branch foo
+ WHEN the user attempts to create a system branch called foo
THEN morph failed
AND the branch error message includes the string "File exists"