Beispiel #1
0
    def setUp(self):
        RECIPE = """
root: True

checkoutSCM:
    -
      scm: git
      url: [email protected]
      branch: test

buildScript: |
    echo 'build'
packageScript: |
    echo 'package'
        """
        self.oldCwd = os.getcwd()
        self.cwd = tempfile.mkdtemp()
        self.jenkinsMock = JenkinsMock()
        self.jenkinsMock.start_mock_server(8080)
        self.jenkinsMock.getServerData()
        os.chdir(self.cwd)
        os.mkdir("recipes")
        with open(os.path.join("recipes", "test.yaml"), "w") as f:
            print(RECIPE, file=f)

        # do bob jenkins add
        self.executeBobJenkinsCmd(
            "add myTestJenkins http://localhost:8080 -r test")
        self.executeBobJenkinsCmd("push -q myTestJenkins")
        self.jenkinsMock.getServerData()
Beispiel #2
0
 def setUp(self):
     self.oldCwd = os.getcwd()
     self.jenkinsMock = JenkinsMock()
     self.jenkinsMock.start_mock_server(8080)
     self.jenkinsMock.getServerData()
     self.cwd = tempfile.mkdtemp()
     os.chdir(self.cwd)
Beispiel #3
0
    def testSetURL(self):
        self.newJenkinsMock = JenkinsMock()
        self.newJenkinsMock.start_mock_server(8081)

        self.executeBobJenkinsCmd("set-url myTestJenkins http://localhost:8081")
        self.executeBobJenkinsCmd("push -q myTestJenkins")

        send = self.jenkinsMock.getServerData()
        sendNew = self.newJenkinsMock.getServerData()
        assert(len(send) == 0)
        assert(len(sendNew) != 0)