From 585d50f2e0d2e7a8eaee2272c06094cce1d6df00 Mon Sep 17 00:00:00 2001 From: Richard Maw Date: Mon, 20 Jan 2014 13:39:10 +0000 Subject: yarns: Add test for not building unnecessary chunks It's an unintended, but possibly not unwelcome feature, that if you have a system that includes stratum artifacts that don't require building the whole stratum, that those chunks are not built. It's debatable whether the confusion of being able to have chunks defined that aren't built outweighs reduced build-times, indeed the test works by having a chunk that can never successfully build, which shows that one pitfall is the possibility of not noticing some chunks fail to build. However, whether it's a good thing or not, we should document this behaviour with a test, so that we don't accidentally break behaviour that someone depends on. --- yarns/splitting.yarn | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) (limited to 'yarns') diff --git a/yarns/splitting.yarn b/yarns/splitting.yarn index af7f73ba..e55d5ed0 100644 --- a/yarns/splitting.yarn +++ b/yarns/splitting.yarn @@ -62,6 +62,23 @@ 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 --------------- @@ -163,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" <"$DATADIR/gits/morphs/$MATCH_1.morph" <