Ejemplo n.º 1
0
    def test_manualNoApi(self, requestMock):
        config_test.CONFIG.pop("defaultApi", None)
        CONTEXT.CONFIG = config_test.CONFIG

        main.deploy("TestRepo-Bitbucket")

        self.assertTrue(verifyTEST_SEQUENCE(TEST_SEQs.deploy_repoConfigNoApi))
Ejemplo n.º 2
0
    def test_push_releaseOnly(self, requestMock):
        self.setupRequestMock(requestMock, name=".Releases")

        main.bitbucket()
        self.assertTrue(not os.path.exists(
            self.pathRelativeToDeployPath("TestRepo-Bitbucket-Releases")))
        self.assertTrue(verifyTEST_SEQUENCE(TEST_SEQs.dl_releaseNotSupported))
Ejemplo n.º 3
0
    def test_push_tagOnly(self, requestMock):
        self.setupRequestMock(requestMock, name=".Tags")

        main.bitbucket()
        self.assertTrue(not os.path.exists(
            self.pathRelativeToDeployPath("TestRepo-Bitbucket-Tags")))
        self.assertTrue(verifyTEST_SEQUENCE(TEST_SEQs.dl_tagRequiredNoTag))
Ejemplo n.º 4
0
 def test_push_develop(self, requestMock):
     self.setupRequestMock(requestMock, branch="develop")
 
     main.gitlab()
     self.assertTrue(os.path.exists(self.pathRelativeToDeployPath("TestRepo-Gitlab-develop")))
     self.assertTrue(os.path.exists(os.path.join(self.pathRelativeToDeployPath("TestRepo-Gitlab-develop"), self.latestPush_at_develop)))
     self.assertTrue(verifyTEST_SEQUENCE(TEST_SEQs.dl_deploySuccess))
Ejemplo n.º 5
0
 def test_create_notLatestTag(self, requestMock):
     self.setupRequestMock(requestMock, event="Tag Push Hook", branch="master", tag_name="dev18")
 
     main.gitlab()
     self.assertTrue(os.path.exists(self.pathRelativeToDeployPath("TestRepo-Gitlab-Tags")))
     self.assertTrue(os.path.exists(os.path.join(self.pathRelativeToDeployPath("TestRepo-Gitlab-Tags"), self.latestTag)))
     self.assertTrue(verifyTEST_SEQUENCE(TEST_SEQs.dl_deploySuccess, TEST_SEQs.dl_notNewestTag))
Ejemplo n.º 6
0
    def test_releaseOnly(self, requestMock):
        # abort because of release only branch
        requestMock.args = self.setupArgs()
        
        self.deployWrap(branch=".Releases")

        self.assertTrue(not os.path.exists(self.pathRelativeToDeployPath("TestRepo-Releases")))
        self.assertTrue(verifyTEST_SEQUENCE(TEST_SEQs.dl_tagRequiredNoTag))
Ejemplo n.º 7
0
    def test_ignoreWhitelist(self, requestMock):
        # pulls latest push@noWhitelist
        requestMock.args = self.setupArgs(force=True)

        self.deployWrap(branch="noWhitelist")
        self.assertTrue(os.path.exists(self.pathRelativeToDeployPath("TestRepo-noWhitelist")))
        self.assertTrue(os.path.exists(os.path.join(self.pathRelativeToDeployPath("TestRepo-noWhitelist"), self.latestPush_at_noWhitelist)))
        self.assertTrue(verifyTEST_SEQUENCE(TEST_SEQs.dl_deploySuccess, TEST_SEQs.dl_autoDeployConfigDisabledOW))
Ejemplo n.º 8
0
    def test_noWhitelist(self, requestMock):
        # not on whitelist
        requestMock.args = self.setupArgs()
        
        self.deployWrap(branch="noWhitelist")

        self.assertTrue(not os.path.exists(self.pathRelativeToDeployPath("TestRepo-noWhitelist")))
        self.assertTrue(verifyTEST_SEQUENCE(TEST_SEQs.dl_autoDeployConfigDisabled))
Ejemplo n.º 9
0
 def test_releaseOnlyOW(self, requestMock):
     # pull latest push@master
     requestMock.args = self.setupArgs(ignoreRelease=True)
 
     self.deployWrap(branch=".Releases")
     self.assertTrue(os.path.exists(self.pathRelativeToDeployPath("TestRepo-Releases")))
     self.assertTrue(os.path.exists(os.path.join(self.pathRelativeToDeployPath("TestRepo-Releases"), self.latestPush_at_master)))
     self.assertTrue(verifyTEST_SEQUENCE(TEST_SEQs.dl_deploySuccess, TEST_SEQs.dl_tagRequiredNoTagOW))
Ejemplo n.º 10
0
 def test_releaseOnlyNotNewestReleaseOW(self, requestMock):
     # pull specified tag
     requestMock.args = self.setupArgs(ignoreRelease=True)
 
     self.deployWrap(branch=".Releases", tag="dev18")
     self.assertTrue(os.path.exists(self.pathRelativeToDeployPath("TestRepo-Releases")))
     self.assertTrue(os.path.exists(os.path.join(self.pathRelativeToDeployPath("TestRepo-Releases"), "dev18.txt")))
     self.assertTrue(verifyTEST_SEQUENCE(TEST_SEQs.dl_deploySuccess, TEST_SEQs.dl_releaseOnlyNotLatestRelRelKnownOW))
Ejemplo n.º 11
0
    def test_push_noWhitelist(self, requestMock):
        self.setupRequestMock(requestMock, name="noWhitelist")

        main.bitbucket()
        self.assertTrue((not os.path.exists(
            self.pathRelativeToDeployPath("TestRepo-Bitbucket-noWhitelist"))))
        self.assertTrue(
            verifyTEST_SEQUENCE(TEST_SEQs.dl_autoDeployConfigDisabled))
Ejemplo n.º 12
0
 def test_tagOnlyNotNewestTag(self, requestMock):
     # pull latest tag
     requestMock.args = self.setupArgs()
 
     self.deployWrap(branch=".Tags", tag="dev18")
     
     self.assertTrue(os.path.exists(self.pathRelativeToDeployPath("TestRepo-Tags")))
     self.assertTrue(os.path.exists(os.path.join(self.pathRelativeToDeployPath("TestRepo-Tags"), self.latestTag)))
     self.assertTrue(verifyTEST_SEQUENCE(TEST_SEQs.dl_deploySuccess, TEST_SEQs.dl_notNewestTag))
Ejemplo n.º 13
0
    def test_master(self, requestMock):
        # pull latest push@master
        requestMock.args = self.setupArgs()
        
        self.deployWrap()

        self.assertTrue(os.path.exists(self.pathRelativeToDeployPath("TestRepo")))
        self.assertTrue(os.path.exists(os.path.join(self.pathRelativeToDeployPath("TestRepo"), self.latestPush_at_master)))
        self.assertTrue(verifyTEST_SEQUENCE(TEST_SEQs.dl_deploySuccess))
Ejemplo n.º 14
0
 def test_latestRelease(self, requestMock):
     # pull latest release
     requestMock.args = self.setupArgs()
 
     self.deployWrap(branch=".Tags", tag="latestRelease")
 
     self.assertTrue(os.path.exists(self.pathRelativeToDeployPath("TestRepo-Tags")))
     self.assertTrue(os.path.exists(os.path.join(self.pathRelativeToDeployPath("TestRepo-Tags"), self.latestReleaseTag)))
     self.assertTrue(verifyTEST_SEQUENCE(TEST_SEQs.dl_deploySuccess, TEST_SEQs.dl_nwhTagLatestRelease))
Ejemplo n.º 15
0
    def test_develop(self, requestMock):
        # pull latest push@develop
        requestMock.args = self.setupArgs()
        
        self.deployWrap(branch="develop")

        self.assertTrue(os.path.exists(self.pathRelativeToDeployPath("TestRepo-develop")))
        self.assertTrue(os.path.exists(os.path.join(self.pathRelativeToDeployPath("TestRepo-develop"), self.latestPush_at_develop)))
        self.assertTrue(verifyTEST_SEQUENCE(TEST_SEQs.dl_deploySuccess))
Ejemplo n.º 16
0
 def test_releaseOnlyNotNewestRelease(self, requestMock):
     # pull latest release
     requestMock.args = self.setupArgs()
 
     self.deployWrap(branch=".Releases", tag="dev18")
     
     self.assertTrue(os.path.exists(self.pathRelativeToDeployPath("TestRepo-Releases")))
     self.assertTrue(os.path.exists(os.path.join(self.pathRelativeToDeployPath("TestRepo-Releases"), self.latestReleaseTag)))
     self.assertTrue(verifyTEST_SEQUENCE(TEST_SEQs.dl_deploySuccess, TEST_SEQs.dl_releaseOnlyNotLatestRelRelKnown))
Ejemplo n.º 17
0
 def test_releaseOnlyReleaseUnknown(self, requestMock):
     # abort latest release unknown on releaseOnly branch
     requestMock.args = self.setupArgs()
     
     config_test.CONFIG["github"]["username"] = "******"
     CONTEXT.CONFIG = config_test.CONFIG
 
     self.deployWrap(branch=".Releases", tag="dev18")
     self.assertTrue(not os.path.exists(self.pathRelativeToDeployPath("TestRepo-Releases")))
     self.assertTrue(verifyTEST_SEQUENCE(TEST_SEQs.release_invalidCredentials, TEST_SEQs.dl_releaseOnlyRelUnknown))
Ejemplo n.º 18
0
    def test_releaseOnlyReleaseUnknownOW(self, requestMock):
        # pulls spevified tag
        requestMock.args = self.setupArgs(ignoreRelease=True)

        config_test.CONFIG["github"]["username"] = "******"
        CONTEXT.CONFIG = config_test.CONFIG
    
        self.deployWrap(branch=".Releases", tag="dev18")
        self.assertTrue(os.path.exists(self.pathRelativeToDeployPath("TestRepo-Releases")))
        self.assertTrue(os.path.exists(os.path.join(self.pathRelativeToDeployPath("TestRepo-Releases"), "dev18.txt")))
        self.assertTrue(verifyTEST_SEQUENCE(TEST_SEQs.dl_deploySuccess, TEST_SEQs.release_invalidCredentials, TEST_SEQs.dl_releaseOnlyRelUnknownOW))
Ejemplo n.º 19
0
    def test_push_master(self, requestMock):
        self.setupRequestMock(requestMock)

        main.bitbucket()
        self.assertTrue(
            os.path.exists(
                self.pathRelativeToDeployPath("TestRepo-Bitbucket")))
        self.assertTrue(
            os.path.exists(
                os.path.join(
                    self.pathRelativeToDeployPath("TestRepo-Bitbucket"),
                    self.latestPush_at_master)))
        self.assertTrue(verifyTEST_SEQUENCE(TEST_SEQs.dl_deploySuccess))
Ejemplo n.º 20
0
    def test_create_latestTag(self, requestMock):
        self.setupRequestMock(requestMock,
                              type="tag",
                              name=self.latestTag.replace(".txt", ""))

        main.bitbucket()
        self.assertTrue(
            os.path.exists(
                self.pathRelativeToDeployPath("TestRepo-Bitbucket-Tags")))
        self.assertTrue(
            os.path.exists(
                os.path.join(
                    self.pathRelativeToDeployPath("TestRepo-Bitbucket-Tags"),
                    self.latestTag)))
        self.assertTrue(verifyTEST_SEQUENCE(TEST_SEQs.dl_deploySuccess))
Ejemplo n.º 21
0
 def test_push_tagOnly(self, requestMock):
     self.setupRequestMock(requestMock, branch=".Tags")
 
     main.gitlab()
     self.assertTrue(not os.path.exists(self.pathRelativeToDeployPath("TestRepo-Gitlab-Tags")))
     self.assertTrue(verifyTEST_SEQUENCE(TEST_SEQs.dl_tagRequiredNoTag))
Ejemplo n.º 22
0
    def test_manualWrongApi(self, requestMock):
        # repo not found, using github default API
        main.deploy("TestRepo-Bitbucket")

        self.assertTrue(verifyTEST_SEQUENCE())