diff options
author | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2013-08-13 16:40:37 +0000 |
---|---|---|
committer | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2013-08-14 16:59:36 +0000 |
commit | 5374f53985d357255126a917b107ce78ece5941d (patch) | |
tree | 1ca7fe5a228c1d89a4d8e19f3885bd00966e98ad /tests.branching/edit-updates-stratum-build-depends.script | |
parent | 1c44afdafb32a803e2578ace2545c2fe36373538 (diff) | |
download | morph-5374f53985d357255126a917b107ce78ece5941d.tar.gz |
Fix test suite to patch YAML instead of JSON
I shouldn't be doing this in the middle of refactoring, but trying to
get the new code to emit exactly the right kind of JSON is too much pain,
and these tests need to be rewritten to use YAML in the near future anyway
(we'll drop JSON support eventually), so I don't want to spend more time
on this than necessary.
The changes in this commit convert morphologies in JSON to YAML, and
fix test code that modifies the morphologies to work with the YAML.
There is probably more JSON lurking about.
Diffstat (limited to 'tests.branching/edit-updates-stratum-build-depends.script')
-rwxr-xr-x | tests.branching/edit-updates-stratum-build-depends.script | 55 |
1 files changed, 25 insertions, 30 deletions
diff --git a/tests.branching/edit-updates-stratum-build-depends.script b/tests.branching/edit-updates-stratum-build-depends.script index 83d5e2a4..a108ce8a 100755 --- a/tests.branching/edit-updates-stratum-build-depends.script +++ b/tests.branching/edit-updates-stratum-build-depends.script @@ -25,39 +25,34 @@ set -eu cd "$DATADIR/morphs" cat <<EOF > xyzzy-stratum.morph -{ - "name": "xyzzy-stratum", - "kind": "stratum", - "build-depends": [ - { - "morph": "hello-stratum", - "repo": "test:morphs", - "ref": "master" - } - ], - "chunks": [ - { - "name": "hello", - "repo": "test:hello", - "ref": "master", - "build-depends": [] - } - ] -} +build-depends: +- morph: hello-stratum + ref: master + repo: test:morphs +chunks: +- build-depends: [] + name: hello + ref: master + repo: test:hello +kind: stratum +name: xyzzy-stratum EOF -cat hello-system.morph | head -n $(expr $(wc -l < hello-system.morph) - 3) \ - > hello-system.morph -cat <<EOF >> hello-system.morph - }, - { - "morph": "xyzzy-stratum", - "repo": "test:morphs", - "ref": "master" - } - ] + +# Add the xyzzy-stratum to hello-system. +awk ' +flag == 0 { print } +/^strata:/ { flag=1; next } +flag == 1 && /^[ -]/ { print; next } +flag == 1 { + print "- morph: xyzzy-stratum" + print " ref: master" + print " repo: test:morphs" + print $0 + flag = 0 } -EOF +' hello-system.morph > temp +mv temp hello-system.morph git add xyzzy-stratum.morph hello-system.morph git commit -q -m "Add 2nd stratum with a build dependency" |