Beispiel #1
0
    def test_circle(self):
        case = self.SimpleManifest_OneProjectDependsOnTwoOthers(self)
        case.addThirdTier()

        upsetowrapper.runShouldFail(case.localClone1, "addRequirement recursiveProject", "circle")

        upsetowrapper.run(case.localRecursiveProject, "delRequirement requiringProject")
        upsetowrapper.run(case.localClone1, "addRequirement recursiveProject")
        upsetowrapper.runShouldFail(case.localRecursiveProject, "addRequirement requiringProject", "circle")
Beispiel #2
0
    def test_refusesToCreateHashInconsistency_TwoProjectPointAtSameOriginWithDifferentHashes(self):
        case = self.SimpleManifest_OneProjectDependsOnTwoOthers(self)
        case.addThirdTier()

        case.localClone1.createAddCommitPush("anotherfile")
        upsetowrapper.runShouldFail(case.localRecursiveProject, "addRequirement project1", "hash paradox")
        upsetowrapper.runShouldFail(case.localRecursiveProject, "checkRequirements", "hash")
        upsetowrapper.run(case.localRecursiveProject, "fulfillRequirements")
        upsetowrapper.run(case.localRecursiveProject, "checkRequirements")
        upsetowrapper.run(case.localRecursiveProject, "addRequirement project1")
Beispiel #3
0
    def test_checkRequirementsOnNonUpsetoedProjects(self):
        case = self.SimpleManifest_OneProjectDependsOnTwoOthers(self)
        case.addThirdTier()
        upsetowrapper.runShouldFail(case.localClone1, "checkRequirements", "manifest")
        upsetowrapper.runShouldFail(case.localClone2, "checkRequirements", "manifest")
        upsetowrapper.run(case.localRequiringProject, "checkRequirements")
        upsetowrapper.run(case.localRecursiveProject, "checkRequirements")

        upsetowrapper.run(case.localClone1, "checkRequirements --allowNoManifest")
        upsetowrapper.run(case.localClone2, "checkRequirements --allowNoManifest")
        upsetowrapper.run(case.localRequiringProject, "checkRequirements --allowNoManifest")
        upsetowrapper.run(case.localRecursiveProject, "checkRequirements --allowNoManifest")
Beispiel #4
0
    def test_resolveParadoxByLocalManifestRequirements(self):
        case = self.SimpleManifest_OneProjectDependsOnTwoOthers(self)
        case.addThirdTier()

        case.localClone1.createAddCommitPush("anotherfile")
        upsetowrapper.run(
            case.localRecursiveProject, "addRequirement project1 --dirtyParadoxResolution project1")
        upsetowrapper.run(case.localRecursiveProject, "checkRequirements")
        self.assertTrue(os.path.exists(os.path.join(case.localClone1.directory(), "anotherfile")))
        upsetowrapper.run(case.localRecursiveProject, "fulfillRequirements")
        upsetowrapper.run(case.localRecursiveProject, "checkRequirements")
        self.assertTrue(os.path.exists(os.path.join(case.localClone1.directory(), "anotherfile")))
        upsetowrapper.runShouldFail(case.localRecursiveProject, "addRequirement project1", "hash paradox")
        upsetowrapper.run(
            case.localRecursiveProject, "addRequirement project1 --dirtyParadoxResolution project1")
Beispiel #5
0
    def test_updateVersion(self):
        case = self.SimpleManifest_OneProjectDependsOnTwoOthers(self)

        case.localClone1.createAddCommitPush("anotherfile")
        newHash = case.localClone1.hash()

        upsetowrapper.runShouldFail(case.localRequiringProject, "checkRequirements", "hash")
        upsetowrapper.run(case.localRequiringProject, "fulfillRequirements")
        upsetowrapper.run(case.localRequiringProject, "checkRequirements")
        self.assertNotEqual(case.localClone1.hash(), newHash)

        case.localClone1.checkout('master')
        self.assertEqual(case.localClone1.hash(), newHash)
        upsetowrapper.run(case.localRequiringProject, "addRequirement project1")
        upsetowrapper.run(case.localRequiringProject, "checkRequirements")
        self.assertEqual(case.localClone1.hash(), newHash)
Beispiel #6
0
    def test_checkWorkspaceClean(self):
        case = self.SimpleManifest_OneProjectDependsOnTwoOthers(self)
        case.addThirdTier()
        upsetowrapper.run(case.localRecursiveProject, "checkRequirements --gitClean")
        output = upsetowrapper.run(case.localRecursiveProject, "git status -s")
        self.assertEquals(len([l for l in output.strip().split("\n") if not l.startswith("#")]), 0)
        with open(case.localClone1.directory() + "/notcheckedin", "w") as f:
            f.write("i'm here to make things dirty")
        output = upsetowrapper.run(case.localRecursiveProject, "git status -s")
        self.assertEquals(len([l for l in output.strip().split("\n") if not l.startswith("#")]), 1)
        upsetowrapper.runShouldFail(case.localRecursiveProject, "checkRequirements --gitClean", "clean")

        os.unlink(case.localClone1.directory() + "/notcheckedin")
        upsetowrapper.run(case.localRecursiveProject, "checkRequirements --gitClean")

        with open(case.localRecursiveProject.directory() + "/notcheckedin", "w") as f:
            f.write("i'm here to make things dirty")
        upsetowrapper.runShouldFail(case.localRecursiveProject, "checkRequirements --gitClean", "clean")
Beispiel #7
0
    def test_resolveParadoxByLocalManifestRequirements_CollisionBetweenResolutions(self):
        case = self.SimpleManifest_OneProjectDependsOnTwoOthers(self)
        case.addThirdTier()
        case.addFourthTier()
        upsetowrapper.run(case.localFourthTierProject, "addRequirement project1")

        hashBefore = case.localClone1.hash()
        case.localClone1.createAddCommitPush("anotherfile")
        upsetowrapper.run(
            case.localRecursiveProject, "addRequirement project1 --dirtyParadoxResolution project1")
        case.localRecursiveProject.addCommitPushManifest()
        self.assertTrue(os.path.exists(os.path.join(case.localClone1.directory(), "anotherfile")))

        upsetowrapper.runShouldFail(
            case.localFourthTierProject, "addRequirement recursiveProject", "hash paradox")
        upsetowrapper.runShouldFail(
            case.localFourthTierProject,
            "addRequirement recursiveProject --dirtyParadoxResolution project1",
            "hash")
        case.localClone1.checkout(hashBefore)
        upsetowrapper.run(
            case.localFourthTierProject,
            "addRequirement recursiveProject --dirtyParadoxResolution project1")
Beispiel #8
0
    def test_checkRequirements(self):
        case = self.SimpleManifest_OneProjectDependsOnTwoOthers(self)

        upsetowrapper.run(case.localRequiringProject, "checkRequirements")
        shutil.rmtree(case.localClone2.directory())
        upsetowrapper.runShouldFail(case.localRequiringProject, "checkRequirements", "exist")
Beispiel #9
0
 def test_checkWorkspaceUnsullied(self):
     case = self.SimpleManifest_OneProjectDependsOnTwoOthers(self)
     case.addThirdTier()
     upsetowrapper.run(case.localRecursiveProject, "checkRequirements --unsullied")
     os.mkdir(os.path.join(gitwrapper.localClonesDir(), "projectoutsideofupseto"))
     upsetowrapper.runShouldFail(case.localRecursiveProject, "checkRequirements --unsullied", "sullied")