summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <lars.wirzenius@codethink.co.uk>2013-10-28 19:38:13 +0000
committerLars Wirzenius <lars.wirzenius@codethink.co.uk>2013-10-28 19:38:13 +0000
commit644d71bae111c7d2f3dc23cdccf68941d66505ff (patch)
treec999485a5811df95c052d627c4a8d1aa65344dc6
parent42cee6d2590959cc64edb3cd037a3cdd201c1974 (diff)
parente5ae2aba5c0eed9562e34e9398af9989f9a12de7 (diff)
downloadmorph-644d71bae111c7d2f3dc23cdccf68941d66505ff.tar.gz
Merge remote-tracking branch 'origin/pedroalvarez/S9240'
Reviewed-by: Lars Wirzenius Reviewed-by: Dan Firth
-rw-r--r--morphlib/plugins/branch_and_merge_plugin.py5
-rw-r--r--yarns/implementations.yarn23
-rw-r--r--yarns/regression.yarn14
3 files changed, 39 insertions, 3 deletions
diff --git a/morphlib/plugins/branch_and_merge_plugin.py b/morphlib/plugins/branch_and_merge_plugin.py
index 9961fcf3..260c0e48 100644
--- a/morphlib/plugins/branch_and_merge_plugin.py
+++ b/morphlib/plugins/branch_and_merge_plugin.py
@@ -1718,8 +1718,9 @@ class BranchAndMergePlugin(cliapp.Plugin):
# Obtain parent SHA1 for the temporary ref tree to be committed.
# This will either be the current commit of the temporary ref or
# HEAD in case the temporary ref does not exist yet.
- system_branch_sha1 = self.resolve_ref(repo_dir, system_branch)
- parent_sha1 = self.resolve_ref(repo_dir, build_ref)
+ system_branch_sha1 = self.resolve_ref(
+ repo_dir, '%s^{commit}' % system_branch)
+ parent_sha1 = self.resolve_ref(repo_dir, '%s^{commit}' % build_ref)
if not parent_sha1:
parent_sha1 = system_branch_sha1
diff --git a/yarns/implementations.yarn b/yarns/implementations.yarn
index 3d403f30..d03e7ae0 100644
--- a/yarns/implementations.yarn
+++ b/yarns/implementations.yarn
@@ -76,6 +76,13 @@ another to hold a chunk.
morph: test-stratum
EOF
+ cat << EOF > "$DATADIR/gits/morphs/simple-system.morph"
+ name: simple-system
+ kind: system
+ arch: $arch
+ strata: []
+ EOF
+
cat << EOF > "$DATADIR/gits/morphs/test-stratum.morph"
name: test-stratum
kind: stratum
@@ -91,6 +98,7 @@ another to hold a chunk.
run_in "$DATADIR/gits/morphs" git init .
run_in "$DATADIR/gits/morphs" git add .
run_in "$DATADIR/gits/morphs" git commit -m Initial.
+ run_in "$DATADIR/gits/morphs" git tag -a "test-tag" -m "Tagging test-tag"
# Create the chunk repository.
@@ -112,8 +120,14 @@ another to hold a chunk.
cat << EOF > "$DATADIR/morph.conf"
[config]
repo-alias = test=file://$DATADIR/gits/%s#file://$DATADIR/gits/%s
+ cachedir = $DATADIR/cache
+ tempdir = $DATADIR/tmp
+ trove-host= []
EOF
+ mkdir "$DATADIR/cache"
+ mkdir "$DATADIR/tmp"
+
Morphologies need to support having a null ref, which means look for the
stratum in the same repository and ref. Testing this requires different
morphologies.
@@ -132,7 +146,7 @@ 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
+ IMPLEMENTS WHEN checking out the (\S+) system (branch|tag)
cd "$DATADIR/workspace"
run_morph checkout test:morphs "$MATCH_1"
@@ -496,3 +510,10 @@ variables in `$DATADIR/env`. We treat the value as a format string for
IMPLEMENTS GIVEN an environment variable (\S+) containing "(.*)"
printf "export $MATCH_1=$MATCH_2" >> "$DATADIR/env"
+
+Implementations for building systems
+------------------------------------
+
+ IMPLEMENTS THEN morph build the system (\S+) of the (branch|tag) (\S+) of the repo (\S+)
+ cd "$DATADIR/workspace/$MATCH_3/$MATCH_4"
+ run_morph build "$MATCH_1"
diff --git a/yarns/regression.yarn b/yarns/regression.yarn
new file mode 100644
index 00000000..d1cc8e79
--- /dev/null
+++ b/yarns/regression.yarn
@@ -0,0 +1,14 @@
+"regression" tests
+==================
+
+Tests for check we don't introduce some bugs again.
+
+
+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
+ THEN morph build the system simple-system of the tag test-tag of the repo test:morphs
+