Skip to content

Commit

Permalink
fix: adjust specs to support templating feature
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanilves committed Oct 17, 2019
1 parent 3b5bb1a commit e77f75e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,10 @@ docker-image: build
docker-image:
@docker image build --no-cache -t ${DOCKER_REPO}:${DOCKER_TAG} .

build: LDFLAGS=$(shell test `uname -s` = "Darwin" && echo '-s -w' || echo '-d -s -w')
build: NAME=$(shell test "${GOOS}" = "windows" && echo 'lstags.exe' || echo 'lstags')
build:
@if [[ -z "${GOOS}" ]]; then go build -mod=vendor -ldflags '-d -s -w' -a -tags netgo -installsuffix netgo; fi
@if [[ -z "${GOOS}" ]]; then go build -mod=vendor -ldflags '${LDFLAGS}' -a -tags netgo -installsuffix netgo; fi
@if [[ -n "${GOOS}" ]]; then mkdir -p dist/assets/lstags-${GOOS}; GOOS=${GOOS} go build -mod=vendor -ldflags '-s -w' -a -tags netgo -installsuffix netgo -o dist/assets/lstags-${GOOS}/${NAME}; fi

xbuild:
Expand Down
11 changes: 8 additions & 3 deletions api/v1/v1_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,12 @@ func runEnd2EndJob(pullRefs, seedRefs []string) ([]string, error) {
}
}

pushConfig := PushConfig{Registry: registryContainer.Hostname(), PathSeparator: "/", PathTemplate: "{{ .Prefix }}{{ .Path }}"}
pushConfig := PushConfig{
Registry: registryContainer.Hostname(),
PathSeparator: "/",
PathTemplate: "{{ .Prefix }}{{ .Path }}",
TagTemplate: "{{ .Tag }}",
}

pushCollection, err := api.CollectPushTags(collection, pushConfig)
if err != nil {
Expand Down Expand Up @@ -120,9 +125,9 @@ func TestEnd2End(t *testing.T) {
pushRefs, err := runEnd2EndJob(testCase.pullRefs, testCase.seedRefs)

if testCase.isCorrect {
assert.Nil(err, "should be no error")
assert.Nil(err, fmt.Sprintf("should be no error (%+v)", testCase))
} else {
assert.NotNil(err, "should be an error")
assert.NotNil(err, fmt.Sprintf("should be an error (%+v)", testCase))
}

if err != nil {
Expand Down

0 comments on commit e77f75e

Please sign in to comment.