diff options
author | Richard Maw <richard.maw@codethink.co.uk> | 2013-11-22 18:28:12 +0000 |
---|---|---|
committer | Richard Maw <richard.maw@codethink.co.uk> | 2013-11-29 16:11:31 +0000 |
commit | f5c1a50c9f35450801846a0309aa571e9893946a (patch) | |
tree | 2a5ed1e3c5145ac89893eadbb539ffaefe54899a /yarns | |
parent | 6e30db8033160fedbf864db08e98fd18b92a0d08 (diff) | |
download | morph-f5c1a50c9f35450801846a0309aa571e9893946a.tar.gz |
morphloader: Require systems have at least one stratum
It doesn't currently make sense to build a system which contains no
strata. We may later add other fields, such as initramfs to contribute
to the system's artifact, but until then it's another bug to trip over.
This uses collections.Sequence for checking the type of the systems entry
in the morphology as a style choice, though it allows more flexibility
if the types in the parsed morphology change.
Diffstat (limited to 'yarns')
-rw-r--r-- | yarns/implementations.yarn | 25 | ||||
-rw-r--r-- | yarns/regression.yarn | 4 |
2 files changed, 15 insertions, 14 deletions
diff --git a/yarns/implementations.yarn b/yarns/implementations.yarn index 6491b38e..98955f48 100644 --- a/yarns/implementations.yarn +++ b/yarns/implementations.yarn @@ -75,13 +75,6 @@ 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 @@ -134,7 +127,11 @@ another to hold a chunk. description: A system called $MATCH_1 for architectures $MATCH_2 kind: system name: $MATCH_1 - strata: [] + strata: + - name: test-stratum + repo: test:morphs + ref: master + morph: test-stratum EOF run_in "$DATADIR/gits/morphs" git add "$MATCH_1.morph" run_in "$DATADIR/gits/morphs" git commit -m "Added $MATCH_1 morphology." @@ -275,7 +272,11 @@ Editing morphologies with `morph edit`. description: A system called $MATCH_1 for architectures $MATCH_2 kind: system name: $MATCH_1 - strata: [] + strata: + - name: test-stratum + repo: test:morphs + ref: master + morph: test-stratum EOF Reporting status of checked out repositories: @@ -425,7 +426,7 @@ Generating a manifest. > "$DATADIR/baserock/hello_world.meta" { "artifact-name": "hello_world", - "cache-key": + "cache-key": "ab8d00a80298a842446ce23507cea6b4d0e34c7ddfa05c67f460318b04d21308", "kind": "chunk", "morphology": "hello_world.morph", @@ -440,7 +441,7 @@ Generating a manifest. IMPLEMENTS WHEN morph generates a manifest run_morph generate-manifest "$DATADIR/artifact.tar" > "$DATADIR/manifest" - + IMPLEMENTS THEN the manifest is generated # Generated manifest should contain the name of the repository @@ -554,4 +555,4 @@ 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" + run_morph build "$MATCH_1" diff --git a/yarns/regression.yarn b/yarns/regression.yarn index a17d2f87..582ebb08 100644 --- a/yarns/regression.yarn +++ b/yarns/regression.yarn @@ -10,13 +10,13 @@ Testing if we can build after checking out from a tag. GIVEN a workspace AND a git server 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 + THEN morph build the system test-system of the tag test-tag of the repo test:morphs Running `morph branch` when the branch directory exists doesn't remove the existing directory. - SCENARIO re-running 'morph branch' fails, original branch untouched + SCENARIO re-running 'morph branch' fails, original branch untouched GIVEN a workspace AND a git server WHEN the user creates a system branch called foo |