Commit 02b4800f authored by Aaron Goldenthal's avatar Aaron Goldenthal
Browse files

Update test to only use ref from file if CI_COMMIT_SHA not specified

parent 1d07cf4d
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -42,13 +42,18 @@ func TestCreate(t *testing.T) {
}

func TestCreateFromFile(t *testing.T) {
	// Ref matches the value from file unless CI_COMMIT_SHA specified
	sha := os.Getenv("CI_COMMIT_SHA")
	if sha == "" {
		sha = "abcdefgh12345678"
	}
	releasedAt, _ := time.Parse(time.RFC3339, "2019-01-03T01:55:18.203Z")
	expectedRelease := gitlab.CreateReleaseRequest{
		Name:        "Release for test",
		Description: "This is a release for testing only.",
		TagName:     "v1.2.3",
		ReleasedAt:  &releasedAt,
		Ref:         "abcdefgh12345678",
		Ref:         sha,
		Assets: &gitlab.Assets{
			Links: []*gitlab.Link{
				{
+1 −0
Original line number Diff line number Diff line
@@ -3,6 +3,7 @@ name: Release for test
description: This is a release for testing only.
tag-name: v1.2.3
released-at: 2019-01-03T01:55:18.203Z
# The ref given here is used unless CI_COMMIT_SHA is specified
ref: abcdefgh12345678
milestone:
  - 'v2.0'