diff options
author | Richard Maw <richard.maw@codethink.co.uk> | 2014-01-22 11:35:36 +0000 |
---|---|---|
committer | Richard Maw <richard.maw@codethink.co.uk> | 2014-01-22 11:35:36 +0000 |
commit | 28196991ede6bd5ed561fc7dc4a2b0084019df19 (patch) | |
tree | d069ffb1c48a46fa6f404a63e9613da86aa3e9ec /yarns | |
parent | 2a702ed211532e277ecbeaff3f0bc345a34cbfe6 (diff) | |
parent | 4c1acc88e81971172f6dc5b0d31f1eb8471cd0d2 (diff) | |
download | morph-28196991ede6bd5ed561fc7dc4a2b0084019df19.tar.gz |
Merge branch 'baserock/richardmaw/S10135/fixups-v2' of git://git.baserock.org/baserock/baserock/morph
Reviewed-by: Sam Thursfield
Diffstat (limited to 'yarns')
-rw-r--r-- | yarns/splitting.yarn | 91 |
1 files changed, 91 insertions, 0 deletions
diff --git a/yarns/splitting.yarn b/yarns/splitting.yarn index e3324190..e55d5ed0 100644 --- a/yarns/splitting.yarn +++ b/yarns/splitting.yarn @@ -1,32 +1,85 @@ Artifact splitting tests ======================== +Parsing and validation +---------------------- + +To verify that the products fields are parsed correctly, we have a +scenario that uses all of them, not relying on the default rules. + SCENARIO building a system with morphologies that have splitting rules GIVEN a workspace AND a git server +To test that all the fields are recognised, we set the new fields to +their default values. + AND chunk test-chunk includes the default splitting rules AND stratum test-stratum includes the default splitting rules AND system test-system includes the default splitting rules +The default rules produce a system that is identical to not providing +them, and since this test is about validation, we don't care about the +result, so much as it succeeding to build something. + WHEN the user checks out the system branch called master THEN morph build the system test-system of the branch master +Smaller systems +--------------- +An example use-case for splitting is to only include the runtime +strata for a target system, rather than including all the development +information, such as the documentation, C library headers and C static +libraries. SCENARIO building a system only using runtime strata GIVEN a workspace AND a git server + +The only change we need to make is to add a field to the system morphology +to select which artifact to use in the system. + AND system test-system only uses test-stratum-runtime from test-stratum WHEN the user checks out the system branch called master + +The best way to test that only using some stratum artifacts works is +to check which files the output has, so we deploy a tarball and inspect +its contents. + GIVEN a cluster called test-cluster for deploying only the test-system system as type tar in system branch master WHEN the user builds the system test-system in branch master AND the user attempts to deploy the cluster test-cluster in branch master with options system.location="$DATADIR/test.tar" + +The -runtime artifacts include executables and shared libraries. + THEN tarball test.tar contains bin/test AND tarball test.tar contains lib/libtest.so + +The -devel artifacts include static libraries and documentation, so if +we've successfully excluded it, we won't have those files. + AND tarball test.tar doesn't contain lib/libtest.a AND tarball test.tar doesn't contain man/man3/test.3.gz +As a consequence of how dependencies are generated, if we select strata +to go into our system, such that there are chunk artifacts that are not +needed, then they don't get built. + + SCENARIO building a system that has unused chunks + GIVEN a workspace + AND a git server + +This GIVEN has a chunk in the stratum that never successfully builds, +so we know that if the system successfully builds, then we only built +chunks that were needed. + + AND stratum test-stratum has chunks that aren't used in test-stratum-minimal + AND system test-system only uses test-stratum-minimal from test-stratum + WHEN the user checks out the system branch called master + THEN morph build the system test-system of the branch master + + Implementations --------------- @@ -127,3 +180,41 @@ Implementations ' "$DATADIR/gits/morphs/$MATCH_1.morph" "$MATCH_2" "$MATCH_3" run_in "$DATADIR/gits/morphs" git add "$MATCH_1.morph" run_in "$DATADIR/gits/morphs" git commit -m "Make $MATCH_1 only use $MATCH_2" + + IMPLEMENTS GIVEN stratum (\S+) has chunks that aren't used in (\1-\S+) + # Create an extra chunk that will never successfully build + cat >"$DATADIR/gits/test-chunk/unbuildable-chunk.morph" <<EOF + name: unbuildable-chunk + kind: chunk + install-commands: + - "false" + EOF + run_in "$DATADIR/gits/test-chunk" git add unbuildable-chunk.morph + run_in "$DATADIR/gits/test-chunk" git commit -m 'Add unbuildable chunk' + + # Create a stratum that has an artifact that doesn't include any + # artifacts from unbuildable-chunk + cat >"$DATADIR/gits/morphs/$MATCH_1.morph" <<EOF + name: $MATCH_1 + kind: stratum + products: + - artifact: $MATCH_2 + include: + - test-chunk-.* + chunks: + - name: test-chunk + repo: test:test-chunk + ref: master + morph: test-chunk + build-mode: test + build-depends: [] + - name: unbuildable-chunk + repo: test:test-chunk + ref: refs/heads/master + morph: unbuildable-chunk + build-mode: test + build-depends: + - test-chunk + EOF + run_in "$DATADIR/gits/morphs" git add "$MATCH_1.morph" + run_in "$DATADIR/gits/morphs" git commit -m "add -$MATCH_2 to stratum" |