summaryrefslogtreecommitdiff
path: root/yarns/regression.yarn
blob: 6448aa62a1630ab890730222a79790d242ee2f8b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
"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 git server
    WHEN        the user clones definitions
    THEN        morph build the system systems/test-system.morph of the tag test-tag
    FINALLY     the git server is shut down

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 git server
    AND         a system containing only bootstrap chunks called bootstrap-system.morph
    WHEN        the user clones definitions
    AND         the user attempts to build the system bootstrap-system.morph in branch master
    THEN        the build error message includes the string "No non-bootstrap chunks found"
    FINALLY     the git server is shut down

When we started allowing multiple artifacts, a long-standing bug in
cache-key computation was discovered, it didn't include artifact names,
which would cause a collision if a morphology changed which artifacts
from a source it depended on, but not the number of artifacts from that
source it depended on.

    SCENARIO changing the artifacts a system uses
    GIVEN    a git server
    AND      system systems/test-system.morph uses core-runtime from core
    AND      stratum strata/core.morph has match rules: [{artifact: core-runtime, include: [.*-devel]}, {artifact: core-devel, include: [.*-runtime]}]
    GIVEN    a cluster called test-cluster.morph in system branch master
    AND      a system in cluster test-cluster.morph in branch master called test-system
    AND      system test-system in cluster test-cluster.morph in branch master builds systems/test-system.morph
    AND      system test-system in cluster test-cluster.morph in branch master has deployment type: tar
    WHEN     the user clones definitions
    AND      the user builds the system systems/test-system.morph in branch master
    GIVEN    stratum strata/core.morph in branch master has match rules: [{artifact: core-runtime, include: [.*-runtime]}, {artifact: core-devel, include: [.*-devel]}]
    WHEN     the user pulls definitions from origin master
    AND      the user builds the system systems/test-system.morph in branch master
    AND      the user deploys the cluster test-cluster.morph in branch master with options test-system.location="$DATADIR/test.tar"
    THEN     tarball test.tar contains baserock/test-chunk-runtime.meta
    FINALLY  the git server is shut down


Implementations
---------------

    IMPLEMENTS GIVEN a system containing only bootstrap chunks called (\S+)
    arch=$(run_morph print-architecture)
    name="$(basename "${MATCH_1%.*}")"
    install -m644 -D /dev/stdin <<EOF "$DATADIR/gits/morphs/$MATCH_1"
    name: $name
    kind: system
    arch: $arch
    strata:
    - morph: strata/bootstrap-stratum.morph
    EOF

    install -m644 -D /dev/stdin << EOF "$DATADIR/gits/morphs/strata/bootstrap-stratum.morph"
    name: bootstrap-stratum
    kind: stratum
    chunks:
    - name: bootstrap-chunk
      morph: bootstrap-chunk.morph
      repo: test:test-chunk
      unpetrify-ref: master
      ref: $(run_in "$DATADIR/gits/test-chunk" git rev-parse master)
      build-mode: bootstrap
      build-depends: []
    EOF
    sed -e 's/name: test-chunk/name: bootstrap-chunk/g' \
        "$DATADIR/gits/morphs/test-chunk.morph" \
        > "$DATADIR/gits/morphs/bootstrap-chunk.morph"

    run_in "$DATADIR/gits/morphs" git add .
    run_in "$DATADIR/gits/morphs" git commit -m "Add bootstrap-system"