diff options
-rwxr-xr-x | scripts/nullify-local-refs | 18 | ||||
-rwxr-xr-x | tests.build/build-system-with-null-refs.script | 24 | ||||
-rwxr-xr-x | tests.build/build-system-with-null-refs.setup | 23 | ||||
-rwxr-xr-x | tests.deploy/deploy-with-null-refs.script | 35 | ||||
-rw-r--r-- | yarns/branches-workspaces.yarn | 63 | ||||
-rw-r--r-- | yarns/implementations.yarn | 11 | ||||
-rw-r--r-- | yarns/morph.shell-lib | 7 |
7 files changed, 1 insertions, 180 deletions
diff --git a/scripts/nullify-local-refs b/scripts/nullify-local-refs deleted file mode 100755 index 5db5c587..00000000 --- a/scripts/nullify-local-refs +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/python - -import yaml, sys -repo = sys.argv[1] -ref = sys.argv[2] -for filename in sys.argv[3:]: - with open(filename, "r") as f: - d = yaml.load(f) - if "strata" in d: - for spec in d["strata"]: - if spec["repo"] == repo and spec["ref"] == ref: - spec["repo"] = spec["ref"] = None - if "build-depends" in d: - for spec in d["build-depends"]: - if spec["repo"] == repo and spec["ref"] == ref: - spec["repo"] = spec["ref"] = None - with open(filename, "w") as f: - yaml.dump(d, f) diff --git a/tests.build/build-system-with-null-refs.script b/tests.build/build-system-with-null-refs.script deleted file mode 100755 index e23dcafa..00000000 --- a/tests.build/build-system-with-null-refs.script +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -# -# Copyright (C) 2013 Codethink Limited -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - - -## Test building a system with null refs - -set -eu - -"$SRCDIR/scripts/test-morph" build-morphology \ - test:morphs-repo master hello-system diff --git a/tests.build/build-system-with-null-refs.setup b/tests.build/build-system-with-null-refs.setup deleted file mode 100755 index cbf53076..00000000 --- a/tests.build/build-system-with-null-refs.setup +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh -# -# Copyright (C) 2013 Codethink Limited -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -set -eu - -cd "$DATADIR/morphs-repo" -"$SRCDIR/scripts/nullify-local-refs" test:morphs master *.morph -git add *.morph -git commit --quiet -m "Nullify all refs" diff --git a/tests.deploy/deploy-with-null-refs.script b/tests.deploy/deploy-with-null-refs.script deleted file mode 100755 index c283debf..00000000 --- a/tests.deploy/deploy-with-null-refs.script +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash -# -# Copyright (C) 2013 Codethink Limited -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - - - -set -eu - - -. "$SRCDIR/tests.deploy/setup-build" - -cd "$DATADIR/workspace/branch1" -"$SRCDIR/scripts/nullify-local-refs" test:morphs master test:morphs/*.morph - -"$SRCDIR/scripts/test-morph" build hello-system - -"$SRCDIR/scripts/test-morph" build linux-system - -"$SRCDIR/scripts/test-morph" --log "$DATADIR/deploy.log" \ - deploy test_cluster \ - linux-system-2.HOSTNAME="baserock-rocks-even-more" \ - > /dev/null diff --git a/yarns/branches-workspaces.yarn b/yarns/branches-workspaces.yarn index b928f628..08627fe9 100644 --- a/yarns/branches-workspaces.yarn +++ b/yarns/branches-workspaces.yarn @@ -300,69 +300,6 @@ Creating a tag twice should fail. WHEN the user attempts to tag the system branch called foo as test123 THEN morph failed -Working with null repositories and refs ---------------------------------------- - -It is convenient to not explicitly name the repository and branch of -a stratum morphology, instead assuming it is the same as the current -morphology. - -These can be checked out like normal system branches. - - SCENARIO check out an existing system branch with null refs - GIVEN a workspace - AND a git server - AND null refs for local strata - WHEN the user checks out the system branch called master - THEN the system branch master is checked out - -Likewise we can also create new system branches from these, and we -wouldn't need to worry about changing the system branch ref. - - - SCENARIO branch off a system branch with null refs - GIVEN a workspace - AND a git server - AND null refs for local strata - WHEN the user creates a system branch called foo - THEN the system branch foo is checked out - -When we edit a morphology with null refs, they stay null. - - SCENARIO editing with null refs - GIVEN a workspace - AND a git server - AND null refs for local strata - -When creating the branch, the refs remain null. - - WHEN the user creates a system branch called foo - THEN in branch foo, system test-system refs test-stratum in None - -After editing the stratum they remain null. - - WHEN the user edits the stratum test-stratum in the system test-system in branch foo - THEN in branch foo, system test-system refs test-stratum in None - -Refs to chunks are still altered as usual - - WHEN the user edits the chunk test-chunk in the stratum test-stratum in the system test-system in branch foo - THEN in branch foo, system test-system refs test-stratum in None - AND in branch foo, stratum test-stratum refs test-chunk in foo - AND the edited chunk test:test-chunk has git branch foo - -Petrifying also leaves null refs unmolested - - SCENARIO morph petrifies null refs - GIVEN a workspace - AND a git server - AND null refs for local strata - WHEN the user creates a system branch called foo - AND the user pushes the system branch called foo to the git server - AND remembering all refs in foo - AND petrifying foo - THEN in branch foo, system test-system refs test-stratum in None - Generating a manifest works SCENARIO morph generates a manifest diff --git a/yarns/implementations.yarn b/yarns/implementations.yarn index e3db6b10..2a46dfa2 100644 --- a/yarns/implementations.yarn +++ b/yarns/implementations.yarn @@ -318,17 +318,6 @@ have a morphology using the test architecture. run_in "$DATADIR/gits/morphs" git add "$MATCH_1.morph" run_in "$DATADIR/gits/morphs" git commit -m "Added $MATCH_1 and strata morphologies." -Morphologies need to support having a null ref, which means look for the -stratum in the same repository and ref. Testing this requires different -morphologies. - - IMPLEMENTS GIVEN null refs for local strata - nullify_local_refs test:morphs master \ - "$DATADIR/gits/morphs/test-system.morph" \ - "$DATADIR/gits/morphs/test-stratum.morph" - run_in "$DATADIR/gits/morphs" git add . - run_in "$DATADIR/gits/morphs" git commit -m "Use null refs." - Implementation sections for system branch operations ---------------------------------------------------- diff --git a/yarns/morph.shell-lib b/yarns/morph.shell-lib index 66abd076..31dcc7af 100644 --- a/yarns/morph.shell-lib +++ b/yarns/morph.shell-lib @@ -3,7 +3,7 @@ # The shell functions in this library are meant to make writing IMPLEMENTS # sections for yarn scenario tests easier. -# Copyright (C) 2013 Codethink Limited +# Copyright (C) 2013-2014 Codethink Limited # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -152,11 +152,6 @@ assert_morphologies_are_petrified() } -nullify_local_refs() -{ - "$SRCDIR/scripts/nullify-local-refs" "$@" -} - # Currently, yarn isn't setting $SRCDIR to point at the project source # directory. We simulate this here. |