def testCreateStartedPresubmit(self, mock_time): # pylint: disable=no-self-use """Test create started for presubmit job.""" mock_time.return_value = 1000 os.environ["REPO_OWNER"] = "fake_org" os.environ["REPO_NAME"] = "fake_name" os.environ["PULL_PULL_SHA"] = "123abc" expected = { "timestamp": 1000, "repos": { "fake_org/fake_name": "123abc", }, } actual = prow_artifacts.create_started() self.assertEquals(expected, json.loads(actual))
def create_started_file(bucket): """Create the started file in gcs for gubernator.""" contents = prow_artifacts.create_started() target = os.path.join(prow_artifacts.get_gcs_dir(bucket), "started.json") util.upload_to_gcs(contents, target)