Skip to content
This repository has been archived by the owner on Feb 24, 2024. It is now read-only.

Commit

Permalink
Fixes broken build tags, again. This time adds an integration test to (
Browse files Browse the repository at this point in the history
…#1142)

prevent regressions
  • Loading branch information
markbates authored Jun 27, 2018
1 parent a88c44f commit 8358345
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
18 changes: 17 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ ADD . .
RUN go get -v -t ./...
RUN make install

RUN go test -tags sqlite -race ./...
RUN go test -tags sqlite -race ./...
RUN go test -tags sqlite -coverprofile cover.out -covermode count ./...

RUN if [ -z "$CODECOV_TOKEN" ] ; then \
Expand All @@ -39,6 +39,22 @@ RUN gometalinter --install
RUN gometalinter --vendor --deadline=5m ./... --skip=internal

WORKDIR $GOPATH/src/

# START: tests bins are built with tags properly
RUN mkdir -p $GOPATH/src/github.com/markbates
WORKDIR $GOPATH/src/github.com/markbates
RUN buffalo new --skip-webpack coke --db-type=sqlite3
WORKDIR $GOPATH/src/github.com/markbates/coke
RUN buffalo db create -a -d
RUN buffalo g resource widget name
RUN buffalo b -d
# works fine:
RUN ./bin/coke migrate
RUN rm -rfv $GOPATH/src/github.com/markbates/coke
# :END

WORKDIR $GOPATH/src/

RUN buffalo new --db-type=sqlite3 hello_world --ci-provider=travis
WORKDIR ./hello_world

Expand Down
2 changes: 1 addition & 1 deletion meta/tags.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ type BuildTags []string
// String returns the tags in the form of:
// "foo bar baz" (with the quotes!)
func (t BuildTags) String() string {
return `"` + strings.Join(t, " ") + `"`
return strings.Join(t, " ")
}

// BuildTags combines the passed in env, and any additional tags,
Expand Down
6 changes: 3 additions & 3 deletions meta/tags_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func Test_BuildTags(t *testing.T) {
tags := app.BuildTags("dev")
r.Len(tags, 1)
r.Equal("dev", tags[0])
r.Equal(`"dev"`, tags.String())
r.Equal(`dev`, tags.String())
})
t.Run("with database.yml", func(st *testing.T) {
t.Run("with sqlite", func(st *testing.T) {
Expand All @@ -29,7 +29,7 @@ func Test_BuildTags(t *testing.T) {
r.Len(tags, 2)
r.Equal("dev", tags[0])
r.Equal("sqlite", tags[1])
r.Equal(`"dev sqlite"`, tags.String())
r.Equal(`dev sqlite`, tags.String())
})
t.Run("without sqlite", func(st *testing.T) {
r := require.New(st)
Expand All @@ -41,7 +41,7 @@ func Test_BuildTags(t *testing.T) {
tags := app.BuildTags("dev")
r.Len(tags, 1)
r.Equal("dev", tags[0])
r.Equal(`"dev"`, tags.String())
r.Equal(`dev`, tags.String())
})
})
}

0 comments on commit 8358345

Please sign in to comment.