From e0bfd1a900fa0945a707ac219c282e95ca8527df Mon Sep 17 00:00:00 2001 From: Richard Maw Date: Fri, 23 Aug 2013 13:22:14 +0000 Subject: tests: Make dummy strata pass validation They were missing build depends or were empty. Now that edit does validation, this is not permitted. --- .../edit-updates-stratum-build-depends.stdout | 5 +- tests.branching/edit-updates-stratum.stdout | 5 +- tests.branching/petrify-no-double-petrify.stdout | 1 + tests.branching/petrify.stdout | 4 + tests.branching/setup | 1 + tests.branching/setup-second-chunk | 2 + tests.branching/tag-creates-commit-and-tag.stdout | 12 +-- tests.branching/tag-tag-works-as-expected.stdout | 12 +-- .../tag-works-with-multiple-morphs-repos.script | 59 ++++++----- .../tag-works-with-multiple-morphs-repos.stdout | 116 ++++++++++++++------- 10 files changed, 139 insertions(+), 78 deletions(-) (limited to 'tests.branching') diff --git a/tests.branching/edit-updates-stratum-build-depends.stdout b/tests.branching/edit-updates-stratum-build-depends.stdout index c6dec93f..5b556e3c 100644 --- a/tests.branching/edit-updates-stratum-build-depends.stdout +++ b/tests.branching/edit-updates-stratum-build-depends.stdout @@ -1,11 +1,12 @@ diff --git a/hello-stratum.morph b/hello-stratum.morph -index 53e76f3..8417659 100644 +index 73ed482..b3f27b4 100644 --- a/hello-stratum.morph +++ b/hello-stratum.morph -@@ -1,7 +1,10 @@ +@@ -1,8 +1,11 @@ +build-depends: [] chunks: - build-depends: [] + build-mode: test + morph: hello name: hello - ref: master diff --git a/tests.branching/edit-updates-stratum.stdout b/tests.branching/edit-updates-stratum.stdout index 2a4f3fd1..f6a1587c 100644 --- a/tests.branching/edit-updates-stratum.stdout +++ b/tests.branching/edit-updates-stratum.stdout @@ -1,11 +1,12 @@ diff --git a/hello-stratum.morph b/hello-stratum.morph -index 53e76f3..8417659 100644 +index 73ed482..b3f27b4 100644 --- a/hello-stratum.morph +++ b/hello-stratum.morph -@@ -1,7 +1,10 @@ +@@ -1,8 +1,11 @@ +build-depends: [] chunks: - build-depends: [] + build-mode: test + morph: hello name: hello - ref: master diff --git a/tests.branching/petrify-no-double-petrify.stdout b/tests.branching/petrify-no-double-petrify.stdout index d060579d..2218f632 100644 --- a/tests.branching/petrify-no-double-petrify.stdout +++ b/tests.branching/petrify-no-double-petrify.stdout @@ -1,5 +1,6 @@ chunks: - build-depends: [] + build-mode: test name: hello ref: 6c7ddb7a9c0c5bf4ee02a8de030f0892a399c6bb repo: test:hello diff --git a/tests.branching/petrify.stdout b/tests.branching/petrify.stdout index 96c73f43..e41c2f02 100644 --- a/tests.branching/petrify.stdout +++ b/tests.branching/petrify.stdout @@ -2,12 +2,14 @@ Petrified: build-depends: [] chunks: - build-depends: [] + build-mode: test morph: hello name: hello ref: 6c7ddb7a9c0c5bf4ee02a8de030f0892a399c6bb repo: test:hello unpetrify-ref: master - build-depends: [] + build-mode: test morph: goodbye name: goodbye ref: d34c96a9f07c2efd1faabc3b44f77c25580a276e @@ -21,11 +23,13 @@ Unpetrified: build-depends: [] chunks: - build-depends: [] + build-mode: test morph: hello name: hello ref: master repo: test:hello - build-depends: [] + build-mode: test morph: goodbye name: goodbye ref: test/petrify diff --git a/tests.branching/setup b/tests.branching/setup index 89fb392b..589f19ed 100755 --- a/tests.branching/setup +++ b/tests.branching/setup @@ -61,6 +61,7 @@ EOF cat < "$DATADIR/morphs/hello-stratum.morph" chunks: - build-depends: [] + build-mode: test name: hello ref: master repo: test:hello diff --git a/tests.branching/setup-second-chunk b/tests.branching/setup-second-chunk index 985db1dc..9ea09612 100755 --- a/tests.branching/setup-second-chunk +++ b/tests.branching/setup-second-chunk @@ -46,10 +46,12 @@ name: hello-stratum kind: stratum chunks: - build-depends: [] + build-mode: test name: hello ref: master repo: test:hello - build-depends: [] + build-mode: test name: goodbye ref: master repo: test:goodbye diff --git a/tests.branching/tag-creates-commit-and-tag.stdout b/tests.branching/tag-creates-commit-and-tag.stdout index cc4efccb..68623be7 100644 --- a/tests.branching/tag-creates-commit-and-tag.stdout +++ b/tests.branching/tag-creates-commit-and-tag.stdout @@ -5,19 +5,19 @@ Date: Tue Jul 31 16:51:54 2012 +0000 Message -commit 30b54ed7d893f5cafff0313e276b393e35ebfb36 +commit 9509c9c379f8ba643b2ad9a6ec50ecf96993cbb5 Author: developer Date: Tue Jul 31 16:51:54 2012 +0000 Message diff --git a/hello-stratum.morph b/hello-stratum.morph -index 53e76f3..d060579 100644 +index 73ed482..2218f63 100644 --- a/hello-stratum.morph +++ b/hello-stratum.morph -@@ -1,7 +1,8 @@ - chunks: +@@ -2,7 +2,8 @@ chunks: - build-depends: [] + build-mode: test name: hello - ref: master + ref: 6c7ddb7a9c0c5bf4ee02a8de030f0892a399c6bb @@ -39,7 +39,7 @@ index b0fed3b..4c4ee3e 100644 + unpetrify-ref: master system-kind: rootfs-tarball test:morphs -commit 30b54ed7d893f5cafff0313e276b393e35ebfb36 +commit 9509c9c379f8ba643b2ad9a6ec50ecf96993cbb5 Author: developer AuthorDate: Tue Jul 31 16:51:54 2012 +0000 Commit: developer @@ -47,7 +47,7 @@ CommitDate: Tue Jul 31 16:51:54 2012 +0000 Message -commit 0d291d7caa82fb6535172189f579435471ad6dc6 +commit 1fe013ee284724848d65096d4d88f612fae56fc6 Author: developer AuthorDate: Tue Jul 31 16:51:54 2012 +0000 Commit: developer diff --git a/tests.branching/tag-tag-works-as-expected.stdout b/tests.branching/tag-tag-works-as-expected.stdout index 8969cf30..878eefc1 100644 --- a/tests.branching/tag-tag-works-as-expected.stdout +++ b/tests.branching/tag-tag-works-as-expected.stdout @@ -8,19 +8,19 @@ Date: Tue Jul 31 16:51:54 2012 +0000 Second -commit 6f4900b857108ae696ef90d09417cdf6040353e4 +commit ca7594f436da55bda2cfff2c6484d11aa0ea4cbc Author: developer Date: Tue Jul 31 16:51:54 2012 +0000 Second diff --git a/hello-stratum.morph b/hello-stratum.morph -index 53e76f3..d060579 100644 +index 73ed482..2218f63 100644 --- a/hello-stratum.morph +++ b/hello-stratum.morph -@@ -1,7 +1,8 @@ - chunks: +@@ -2,7 +2,8 @@ chunks: - build-depends: [] + build-mode: test name: hello - ref: master + ref: 6c7ddb7a9c0c5bf4ee02a8de030f0892a399c6bb @@ -42,7 +42,7 @@ index b0fed3b..875d73a 100644 + unpetrify-ref: master system-kind: rootfs-tarball test:morphs -commit 6f4900b857108ae696ef90d09417cdf6040353e4 +commit ca7594f436da55bda2cfff2c6484d11aa0ea4cbc Author: developer AuthorDate: Tue Jul 31 16:51:54 2012 +0000 Commit: developer @@ -50,7 +50,7 @@ CommitDate: Tue Jul 31 16:51:54 2012 +0000 Second -commit 0d291d7caa82fb6535172189f579435471ad6dc6 +commit 1fe013ee284724848d65096d4d88f612fae56fc6 Author: developer AuthorDate: Tue Jul 31 16:51:54 2012 +0000 Commit: developer diff --git a/tests.branching/tag-works-with-multiple-morphs-repos.script b/tests.branching/tag-works-with-multiple-morphs-repos.script index 87c72d8e..38d73852 100755 --- a/tests.branching/tag-works-with-multiple-morphs-repos.script +++ b/tests.branching/tag-works-with-multiple-morphs-repos.script @@ -25,14 +25,11 @@ set -eu # Make sure the commits always have the same SHA1s. . "$SRCDIR/scripts/fix-committer-info" -# Create new directory for repos used in this test. -mkdir -p "$DATADIR/repos" - # Create the first morphs repository. -mkdir "$DATADIR/repos/morphs1" +mkdir "$DATADIR/morphs1" # Create system morphology in first morphs repository. -cat < "$DATADIR/repos/morphs1/test-system.morph" +cat < "$DATADIR/morphs1/test-system.morph" name: test-system kind: system system-kind: rootfs-tarball @@ -41,64 +38,78 @@ disk-size: 1G strata: - morph: stratum1 ref: master - repo: repos:morphs1 + repo: test:morphs1 - morph: stratum2 ref: master - repo: repos:morphs2 + repo: test:morphs2 EOF # Create stratum that depends on another stratum. -cat < "$DATADIR/repos/morphs1/stratum1.morph" +cat < "$DATADIR/morphs1/stratum1.morph" name: stratum1 kind: stratum build-depends: - morph: stratum3 ref: master - repo: repos:morphs2 + repo: test:morphs2 +chunks: +- build-depends: [] + name: hello + ref: master + repo: test:hello EOF # Commit all files to the first repository. -scripts/run-git-in "$DATADIR/repos/morphs1" init -q -scripts/run-git-in "$DATADIR/repos/morphs1" add . -scripts/run-git-in "$DATADIR/repos/morphs1" commit -q -m initial +scripts/run-git-in "$DATADIR/morphs1" init -q +scripts/run-git-in "$DATADIR/morphs1" add . +scripts/run-git-in "$DATADIR/morphs1" commit -q -m initial # Create second morphs repository. -mkdir "$DATADIR/repos/morphs2" +mkdir "$DATADIR/morphs2" # Create two strata in the second repository. -cat < "$DATADIR/repos/morphs2/stratum2.morph" +cat < "$DATADIR/morphs2/stratum2.morph" name: stratum2 kind: stratum build-depends: - morph: stratum3 - repo: repos:morphs2 + repo: test:morphs2 ref: master +chunks: +- build-depends: [] + name: hello + ref: master + repo: test:hello EOF -cat < "$DATADIR/repos/morphs2/stratum3.morph" +cat < "$DATADIR/morphs2/stratum3.morph" kind: stratum name: stratum3 +chunks: +- build-depends: [] + build-mode: test + name: hello + ref: master + repo: test:hello EOF # Commit all files to the second repository. -"$SRCDIR/scripts/run-git-in" "$DATADIR/repos/morphs2" init -q -"$SRCDIR/scripts/run-git-in" "$DATADIR/repos/morphs2" add . -"$SRCDIR/scripts/run-git-in" "$DATADIR/repos/morphs2" commit -q -m initial +"$SRCDIR/scripts/run-git-in" "$DATADIR/morphs2" init -q +"$SRCDIR/scripts/run-git-in" "$DATADIR/morphs2" add . +"$SRCDIR/scripts/run-git-in" "$DATADIR/morphs2" commit -q -m initial cd "$DATADIR/workspace" "$SRCDIR/scripts/test-morph" init # Check out the master system branch. "$SRCDIR/scripts/test-morph" \ - --repo-alias=repos="file://$DATADIR/repos/%s#file://$DATADIR/%s" \ - checkout repos:morphs1 master + checkout test:morphs1 master # Tag the master system branch. "$SRCDIR/scripts/test-morph" \ - --repo-alias=repos="file://$DATADIR/repos/%s#file://$DATADIR/%s" \ tag tag-across-multiple-repos -- -m "create tag" # Show the tag. -GIT_DIR="$DATADIR/workspace/master/repos:morphs1/.git" \ +GIT_DIR="$DATADIR/workspace/master/test:morphs1/.git" \ git show tag-across-multiple-repos -GIT_DIR="$DATADIR/workspace/master/repos:morphs1/.git" \ +GIT_DIR="$DATADIR/workspace/master/test:morphs1/.git" \ git log --format=fuller -n1 -p --stat tag-across-multiple-repos diff --git a/tests.branching/tag-works-with-multiple-morphs-repos.stdout b/tests.branching/tag-works-with-multiple-morphs-repos.stdout index 38328c6d..938e41ff 100644 --- a/tests.branching/tag-works-with-multiple-morphs-repos.stdout +++ b/tests.branching/tag-works-with-multiple-morphs-repos.stdout @@ -4,50 +4,70 @@ Date: Tue Jul 31 16:51:54 2012 +0000 create tag -commit ede2d4bc8b9a806720d195cb5611c576a055adfd +commit 7253f9b1471f1983e07823d2b84582dde9fb108d Author: developer Date: Tue Jul 31 16:51:54 2012 +0000 create tag diff --git a/stratum1.morph b/stratum1.morph -index c1ef125..3c18ae5 100644 +index 6d439df..074a838 100644 --- a/stratum1.morph +++ b/stratum1.morph -@@ -2,5 +2,7 @@ name: stratum1 +@@ -2,10 +2,13 @@ name: stratum1 kind: stratum build-depends: - morph: stratum3 - ref: master -- repo: repos:morphs2 +- repo: test:morphs2 + ref: tag-across-multiple-repos -+ repo: repos:morphs1 ++ repo: test:morphs1 ++ unpetrify-ref: master ++ unpetrify-repo: test:morphs2 + chunks: + - build-depends: [] + name: hello +- ref: master ++ ref: 6c7ddb7a9c0c5bf4ee02a8de030f0892a399c6bb + repo: test:hello + unpetrify-ref: master -+ unpetrify-repo: repos:morphs2 diff --git a/stratum2.morph b/stratum2.morph new file mode 100644 -index 0000000..2546465 +index 0000000..0b421ab --- /dev/null +++ b/stratum2.morph -@@ -0,0 +1,8 @@ +@@ -0,0 +1,14 @@ +name: stratum2 +kind: stratum +build-depends: +- morph: stratum3 -+ repo: repos:morphs1 ++ repo: test:morphs1 + ref: tag-across-multiple-repos + unpetrify-ref: master -+ unpetrify-repo: repos:morphs2 ++ unpetrify-repo: test:morphs2 ++chunks: ++- build-depends: [] ++ name: hello ++ ref: 6c7ddb7a9c0c5bf4ee02a8de030f0892a399c6bb ++ repo: test:hello ++ unpetrify-ref: master diff --git a/stratum3.morph b/stratum3.morph new file mode 100644 -index 0000000..d510d1b +index 0000000..610fae6 --- /dev/null +++ b/stratum3.morph -@@ -0,0 +1,2 @@ +@@ -0,0 +1,9 @@ +kind: stratum +name: stratum3 ++chunks: ++- build-depends: [] ++ build-mode: test ++ name: hello ++ ref: 6c7ddb7a9c0c5bf4ee02a8de030f0892a399c6bb ++ repo: test:hello ++ unpetrify-ref: master diff --git a/test-system.morph b/test-system.morph -index cdd8d64..b86854a 100644 +index 44d5ae5..08f9adc 100644 --- a/test-system.morph +++ b/test-system.morph @@ -5,8 +5,11 @@ arch: x86_64 @@ -56,16 +76,16 @@ index cdd8d64..b86854a 100644 - morph: stratum1 - ref: master + ref: tag-across-multiple-repos - repo: repos:morphs1 + repo: test:morphs1 + unpetrify-ref: master - morph: stratum2 - ref: master -- repo: repos:morphs2 +- repo: test:morphs2 + ref: tag-across-multiple-repos -+ repo: repos:morphs1 ++ repo: test:morphs1 + unpetrify-ref: master -+ unpetrify-repo: repos:morphs2 -commit ede2d4bc8b9a806720d195cb5611c576a055adfd ++ unpetrify-repo: test:morphs2 +commit 7253f9b1471f1983e07823d2b84582dde9fb108d Author: developer AuthorDate: Tue Jul 31 16:51:54 2012 +0000 Commit: developer @@ -73,50 +93,70 @@ CommitDate: Tue Jul 31 16:51:54 2012 +0000 create tag --- - stratum1.morph | 6 ++++-- - stratum2.morph | 8 ++++++++ - stratum3.morph | 2 ++ + stratum1.morph | 9 ++++++--- + stratum2.morph | 14 ++++++++++++++ + stratum3.morph | 9 +++++++++ test-system.morph | 9 ++++++--- - 4 files changed, 20 insertions(+), 5 deletions(-) + 4 files changed, 35 insertions(+), 6 deletions(-) diff --git a/stratum1.morph b/stratum1.morph -index c1ef125..3c18ae5 100644 +index 6d439df..074a838 100644 --- a/stratum1.morph +++ b/stratum1.morph -@@ -2,5 +2,7 @@ name: stratum1 +@@ -2,10 +2,13 @@ name: stratum1 kind: stratum build-depends: - morph: stratum3 - ref: master -- repo: repos:morphs2 +- repo: test:morphs2 + ref: tag-across-multiple-repos -+ repo: repos:morphs1 ++ repo: test:morphs1 ++ unpetrify-ref: master ++ unpetrify-repo: test:morphs2 + chunks: + - build-depends: [] + name: hello +- ref: master ++ ref: 6c7ddb7a9c0c5bf4ee02a8de030f0892a399c6bb + repo: test:hello + unpetrify-ref: master -+ unpetrify-repo: repos:morphs2 diff --git a/stratum2.morph b/stratum2.morph new file mode 100644 -index 0000000..2546465 +index 0000000..0b421ab --- /dev/null +++ b/stratum2.morph -@@ -0,0 +1,8 @@ +@@ -0,0 +1,14 @@ +name: stratum2 +kind: stratum +build-depends: +- morph: stratum3 -+ repo: repos:morphs1 ++ repo: test:morphs1 + ref: tag-across-multiple-repos + unpetrify-ref: master -+ unpetrify-repo: repos:morphs2 ++ unpetrify-repo: test:morphs2 ++chunks: ++- build-depends: [] ++ name: hello ++ ref: 6c7ddb7a9c0c5bf4ee02a8de030f0892a399c6bb ++ repo: test:hello ++ unpetrify-ref: master diff --git a/stratum3.morph b/stratum3.morph new file mode 100644 -index 0000000..d510d1b +index 0000000..610fae6 --- /dev/null +++ b/stratum3.morph -@@ -0,0 +1,2 @@ +@@ -0,0 +1,9 @@ +kind: stratum +name: stratum3 ++chunks: ++- build-depends: [] ++ build-mode: test ++ name: hello ++ ref: 6c7ddb7a9c0c5bf4ee02a8de030f0892a399c6bb ++ repo: test:hello ++ unpetrify-ref: master diff --git a/test-system.morph b/test-system.morph -index cdd8d64..b86854a 100644 +index 44d5ae5..08f9adc 100644 --- a/test-system.morph +++ b/test-system.morph @@ -5,8 +5,11 @@ arch: x86_64 @@ -125,12 +165,12 @@ index cdd8d64..b86854a 100644 - morph: stratum1 - ref: master + ref: tag-across-multiple-repos - repo: repos:morphs1 + repo: test:morphs1 + unpetrify-ref: master - morph: stratum2 - ref: master -- repo: repos:morphs2 +- repo: test:morphs2 + ref: tag-across-multiple-repos -+ repo: repos:morphs1 ++ repo: test:morphs1 + unpetrify-ref: master -+ unpetrify-repo: repos:morphs2 ++ unpetrify-repo: test:morphs2 -- cgit v1.2.1