Skip to content

Commit

Permalink
Rename env
Browse files Browse the repository at this point in the history
  • Loading branch information
KacperMalachowski committed Jan 2, 2025
1 parent 81b16b7 commit 44225f2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion cmd/image-builder/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ func loadJenkinsGitState() (GitStateConfig, error) {
}

baseRef := os.Getenv("CHANGE_BRANCH")
pullRequestHeadSHA := os.Getenv("CHANGE_TARGET")
pullRequestHeadSHA := os.Getenv("CHANGE_HEAD_SHA")

gitState.JobType = "presubmit"
gitState.PullRequestNumber = pullNumber
Expand Down
21 changes: 10 additions & 11 deletions cmd/image-builder/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -385,11 +385,10 @@ func TestLoadGitStateConfig(t *testing.T) {
ciSystem: Jenkins,
},
env: map[string]string{
"BRANCH_NAME": "refs/heads/main",
"JENKINS_HOME": "/some/absolute/path",
"GIT_URL": "github.com/kyma-project/test-infra",
"GIT_COMMIT": "1234",
"CHANGE_TARGET": "refs/heads/main",
"BRANCH_NAME": "refs/heads/main",
"JENKINS_HOME": "/some/absolute/path",
"GIT_URL": "github.com/kyma-project/test-infra",
"GIT_COMMIT": "1234",
},
gitState: GitStateConfig{
RepositoryName: "test-infra",
Expand All @@ -404,12 +403,12 @@ func TestLoadGitStateConfig(t *testing.T) {
ciSystem: Jenkins,
},
env: map[string]string{
"BRANCH_NAME": "refs/heads/main",
"JENKINS_HOME": "/some/absolute/path",
"CHANGE_ID": "14",
"GIT_URL": "github.com/kyma-project/test-infra",
"GIT_COMMIT": "1234",
"CHANGE_TARGET": "4321",
"BRANCH_NAME": "refs/heads/main",
"JENKINS_HOME": "/some/absolute/path",
"CHANGE_ID": "14",
"GIT_URL": "github.com/kyma-project/test-infra",
"GIT_COMMIT": "1234",
"CHANGE_HEAD_SHA": "4321", // Must be explicitly set when calling docker run
},
gitState: GitStateConfig{
RepositoryName: "test-infra",
Expand Down

0 comments on commit 44225f2

Please sign in to comment.