diff options
author | Richard Maw <richard.maw@codethink.co.uk> | 2013-11-28 12:49:41 +0000 |
---|---|---|
committer | Richard Maw <richard.maw@codethink.co.uk> | 2013-11-29 16:11:31 +0000 |
commit | 03e724f1fb690e9ef95b082e4f1ad96799ec18c1 (patch) | |
tree | debabe9d6cc1f6d23c497ece8c5f72f363a32500 /yarns | |
parent | f5c1a50c9f35450801846a0309aa571e9893946a (diff) | |
download | morph-03e724f1fb690e9ef95b082e4f1ad96799ec18c1.tar.gz |
validation: Require there be non-bootstrap chunks in systems
Bootstrap chunks don't make it into the final system, so there needs to
be an extra check for empty systems after the sources have been collected.
This was complicated slightly by the fact that if you try to build a chunk
directly you will have no strata in your sources, hence no non-bootstrap
chunks, but validation for having been told to build a chunk is best
handled later.
This amends the old yarns that depended on building a bootstrap chunk
and adds a new one that explicitly builds a system with bootstrap
chunks.
Diffstat (limited to 'yarns')
-rw-r--r-- | yarns/implementations.yarn | 2 | ||||
-rw-r--r-- | yarns/regression.yarn | 46 |
2 files changed, 46 insertions, 2 deletions
diff --git a/yarns/implementations.yarn b/yarns/implementations.yarn index 98955f48..65ac1283 100644 --- a/yarns/implementations.yarn +++ b/yarns/implementations.yarn @@ -83,7 +83,7 @@ another to hold a chunk. repo: test:test-chunk ref: master morph: test-chunk - build-mode: bootstrap + build-mode: test build-depends: [] EOF diff --git a/yarns/regression.yarn b/yarns/regression.yarn index 582ebb08..eae01343 100644 --- a/yarns/regression.yarn +++ b/yarns/regression.yarn @@ -27,8 +27,52 @@ The branch is checked out correctly, now it should fail if the user executes WHEN the user attempts to create a system branch called foo THEN morph failed - AND the branch error message includes the string "File exists" + AND the branch error message includes the string "File exists" The branch still checked out. AND the system branch foo is checked out + + +It doesn't make much sense to be able to build a system with only +bootstrap chunks, since they will have been constructed without a staging +area, hence their results cannot be trusted. + + SCENARIO building a system with only bootstrap chunks fails + GIVEN a workspace + AND a git server + AND a system containing only bootstrap chunks called bootstrap-system + WHEN the user checks out the system branch called master + AND the user attempts to build the system bootstrap-system in branch master + THEN the build error message includes the string "No non-bootstrap chunks found" + + +Implementations +--------------- + + IMPLEMENTS GIVEN a system containing only bootstrap chunks called (\S+) + arch=$(run_morph print-architecture) + cat <<EOF >"$DATADIR/gits/morphs/$MATCH_1.morph" + name: $MATCH_1 + kind: system + arch: $arch + strata: + - morph: bootstrap-stratum + repo: test:morphs + ref: master + EOF + + cat << EOF > "$DATADIR/gits/morphs/bootstrap-stratum.morph" + name: bootstrap-stratum + kind: stratum + chunks: + - name: bootstrap-chunk + repo: test:test-chunk + ref: master + morph: test-chunk + build-mode: bootstrap + build-depends: [] + EOF + + run_in "$DATADIR/gits/morphs" git add . + run_in "$DATADIR/gits/morphs" git commit -m "Add bootstrap-system" |