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

Commit

Permalink
Fix plugin timeout issues (#1470)
Browse files Browse the repository at this point in the history
* WIP fix buffalo-pop not found

* Fix plugin timeout issues

* Restore -u flag in ci-deps
  • Loading branch information
stanislas-m authored Nov 26, 2018
1 parent 7dc6819 commit 671b1c8
Show file tree
Hide file tree
Showing 9 changed files with 204 additions and 164 deletions.
141 changes: 2 additions & 139 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,146 +14,9 @@ ARG TRAVIS_REPO_SLUG
ARG TRAVIS_TAG

ENV BP=$GOPATH/src/github.com/gobuffalo/buffalo

RUN rm $(which buffalo)
RUN rm -rf $BP
RUN mkdir -p $BP
WORKDIR $BP
COPY . .

RUN make ci-deps

RUN packr clean
RUN gometalinter --vendor --deadline=5m ./... --skip=internal
RUN make install

RUN buffalo version

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

RUN if [ -z "$CODECOV_TOKEN" ] ; then \
echo codecov not enabled ; \
else curl -s https://codecov.io/bash -o codecov && \
bash codecov -f cover.out -X fix; fi

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

RUN filetest -c $GOPATH/src/github.com/gobuffalo/buffalo/buffalo/cmd/filetests/new_travis.json

RUN go vet ./...
RUN buffalo db create -a
RUN buffalo db migrate -e test
RUN buffalo test -race

RUN go get -v github.com/gobuffalo/buffalo-goth
RUN buffalo g goth facebook twitter linkedin github
RUN filetest -c $GOPATH/src/github.com/gobuffalo/buffalo/buffalo/cmd/filetests/goth.json

RUN buffalo g resource admins --skip-model
RUN filetest -c $GOPATH/src/github.com/gobuffalo/buffalo/buffalo/cmd/filetests/resource_skip_model.json
RUN rm actions/admins_test.go

RUN buffalo test -race
RUN buffalo build -static

RUN buffalo g resource users name:text email:text
RUN filetest -c $GOPATH/src/github.com/gobuffalo/buffalo/buffalo/cmd/filetests/resource_model_migration.json

RUN buffalo g resource admins --use-model users
RUN filetest -c $GOPATH/src/github.com/gobuffalo/buffalo/buffalo/cmd/filetests/resource_use_model.json

RUN rm actions/admins_test.go
RUN rm models/user_test.go
RUN rm models/user.go
RUN rm actions/users_test.go
RUN rm -rv templates/users

RUN buffalo g resource ouch
RUN buffalo d resource -y ouch
RUN filetest -c $GOPATH/src/github.com/gobuffalo/buffalo/buffalo/cmd/filetests/destroy_resource_all.json

RUN buffalo db g model ouch
RUN buffalo db d model -y ouch
RUN filetest -c $GOPATH/src/github.com/gobuffalo/buffalo/buffalo/cmd/filetests/destroy_model_all.json

RUN buffalo g actions ouch build edit
RUN buffalo d action -y ouch
RUN filetest -c $GOPATH/src/github.com/gobuffalo/buffalo/buffalo/cmd/filetests/destroy_action_all.json

RUN buffalo g mailer ouch
RUN buffalo d mailer -y ouch
RUN filetest -c $GOPATH/src/github.com/gobuffalo/buffalo/buffalo/cmd/filetests/destroy_mailer_all.json

RUN buffalo g actions comments show edit
RUN filetest -c $GOPATH/src/github.com/gobuffalo/buffalo/buffalo/cmd/filetests/generate_action_all.json

RUN buffalo g actions comments destroy
RUN filetest -c $GOPATH/src/github.com/gobuffalo/buffalo/buffalo/cmd/filetests/generate_action_existing.json

RUN buffalo g resource user
RUN filetest -c $GOPATH/src/github.com/gobuffalo/buffalo/buffalo/cmd/filetests/generate_resource_singular.json

RUN buffalo g resource cars
RUN filetest -c $GOPATH/src/github.com/gobuffalo/buffalo/buffalo/cmd/filetests/generate_resource_plural.json

RUN buffalo g actions users create --skip-template
RUN filetest -c $GOPATH/src/github.com/gobuffalo/buffalo/buffalo/cmd/filetests/generate_action_skip_template.json

RUN buffalo g actions users update --skip-template --method POST
RUN filetest -c $GOPATH/src/github.com/gobuffalo/buffalo/buffalo/cmd/filetests/generate_action_with_method.json

WORKDIR $GOPATH/src
RUN buffalo new --api apiapp
WORKDIR ./apiapp
RUN buffalo build
RUN filetest -c $GOPATH/src/github.com/gobuffalo/buffalo/buffalo/cmd/filetests/apiapp.json

RUN buffalo g task plainTask
RUN filetest -c $GOPATH/src/github.com/gobuffalo/buffalo/buffalo/cmd/filetests/generate_plain_task.json

RUN buffalo g task nested:task:now
RUN filetest -c $GOPATH/src/github.com/gobuffalo/buffalo/buffalo/cmd/filetests/generate_nested_task.json

RUN buffalo g resource admin/planes
RUN filetest -c $GOPATH/src/github.com/gobuffalo/buffalo/buffalo/cmd/filetests/generate_resource_nested.json

RUN buffalo g resource admin/users --name=AdminUser
RUN filetest -c $GOPATH/src/github.com/gobuffalo/buffalo/buffalo/cmd/filetests/generate_resource_nested_model_name.json

RUN buffalo g resource person
RUN filetest -c $GOPATH/src/github.com/gobuffalo/buffalo/buffalo/cmd/filetests/generate_resource_irregular.json

RUN buffalo g resource person_event
RUN filetest -c $GOPATH/src/github.com/gobuffalo/buffalo/buffalo/cmd/filetests/generate_underscore.json

RUN buffalo g mailer welcome_email
RUN filetest -c $GOPATH/src/github.com/gobuffalo/buffalo/buffalo/cmd/filetests/generate_mailer.json

RUN rm -rf bin
RUN buffalo build -k -e
RUN filetest -c $GOPATH/src/github.com/gobuffalo/buffalo/buffalo/cmd/filetests/no_assets_build.json

RUN go get github.com/gobuffalo/oldapp/0_12_6/...
WORKDIR $GOPATH/src/github.com/gobuffalo/oldapp/0_12_6
RUN buffalo fix --y
RUN filetest -c $GOPATH/src/github.com/gobuffalo/buffalo/buffalo/cmd/filetests/fix_old_app.json
RUN buffalo build -static
COPY . .
RUN bash ./it.sh
2 changes: 1 addition & 1 deletion buffalo/cmd/build/apkg.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func (b *Builder) buildAInit() error {
ctx := plush.NewContext()
ctx.Set("opts", b.Options)

t, err := templates.MustString("a.go.tmpl")
t, err := templates.FindString("a.go.tmpl")
if err != nil {
return errors.WithStack(err)
}
Expand Down
2 changes: 1 addition & 1 deletion buffalo/cmd/build/transform_main.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func (b *Builder) createBuildMain() error {
ctx.Set("buildTime", bt)
ctx.Set("buildVersion", b.buildVersion(bt))

t, err := templates.MustString("main.go.tmpl")
t, err := templates.FindString("main.go.tmpl")
if err != nil {
return errors.WithStack(err)
}
Expand Down
5 changes: 2 additions & 3 deletions buffalo/cmd/fix/npm.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@ package fix
import (
"bytes"
"fmt"
"html/template"
"io/ioutil"
"os"
"os/exec"
"path/filepath"

"html/template"

"github.com/gobuffalo/buffalo/generators/assets/webpack"
"github.com/gobuffalo/buffalo/generators/newapp"
"github.com/pkg/errors"
Expand All @@ -33,7 +32,7 @@ func PackageJSONCheck(r *Runner) error {

box := webpack.TemplateBox

f, err := box.MustString("package.json.tmpl")
f, err := box.FindString("package.json.tmpl")
if err != nil {
return errors.WithStack(err)
}
Expand Down
5 changes: 2 additions & 3 deletions buffalo/cmd/fix/webpack.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@ package fix
import (
"bytes"
"fmt"
"html/template"
"io/ioutil"
"os"

"html/template"

"github.com/gobuffalo/buffalo/generators/assets/webpack"
"github.com/gobuffalo/buffalo/generators/newapp"
"github.com/pkg/errors"
Expand All @@ -31,7 +30,7 @@ func WebpackCheck(r *Runner) error {

box := webpack.TemplateBox

f, err := box.MustString("webpack.config.js.tmpl")
f, err := box.FindString("webpack.config.js.tmpl")
if err != nil {
return errors.WithStack(err)
}
Expand Down
7 changes: 3 additions & 4 deletions generators/resource/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ import (
"path/filepath"
"strings"

"github.com/pkg/errors"

"github.com/gobuffalo/buffalo/generators"
"github.com/gobuffalo/makr"
"github.com/gobuffalo/packr"
"github.com/pkg/errors"
)

// Run generates a new actions/resource file and a stub test.
Expand Down Expand Up @@ -71,11 +70,11 @@ func (res Generator) Run(root string, data makr.Data) error {
func (res Generator) modelCommand() makr.Command {
args := res.Args
args = append(args[:0], args[0+1:]...)
args = append([]string{"db", "g", "model", res.Model.UnderSingular()}, args...)
args = append([]string{"pop", "g", "model", res.Model.UnderSingular()}, args...)

if res.SkipMigration {
args = append(args, "--skip-migration")
}

return makr.NewCommand(exec.Command("buffalo", args...))
return makr.NewCommand(exec.Command("buffalo-pop", args...))
}
25 changes: 12 additions & 13 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
module github.com/gobuffalo/buffalo

require (
github.com/codegangsta/negroni v1.0.0 // indirect
github.com/dgrijalva/jwt-go v3.2.0+incompatible
github.com/dustin/go-humanize v1.0.0
github.com/fatih/color v1.7.0
github.com/go-sql-driver/mysql v1.4.1 // indirect
github.com/gobuffalo/buffalo-plugins v1.6.11
github.com/gobuffalo/buffalo-pop v1.1.14
github.com/gobuffalo/buffalo-plugins v1.7.2
github.com/gobuffalo/buffalo-pop v1.1.15
github.com/gobuffalo/envy v1.6.9
github.com/gobuffalo/events v1.1.7
github.com/gobuffalo/fizz v1.1.3 // indirect
github.com/gobuffalo/genny v0.0.0-20181114215459-0a4decd77f5d
github.com/gobuffalo/events v1.1.8
github.com/gobuffalo/genny v0.0.0-20181119162812-e8ff4adce8bb
github.com/gobuffalo/github_flavored_markdown v1.0.7
github.com/gobuffalo/httptest v1.0.4
github.com/gobuffalo/httptest v1.0.5
github.com/gobuffalo/makr v1.1.5
github.com/gobuffalo/mw-basicauth v1.0.7
github.com/gobuffalo/mw-contenttype v0.0.0-20180802152300-74f5a47f4d56
Expand All @@ -22,15 +19,16 @@ require (
github.com/gobuffalo/mw-i18n v0.0.0-20181027200759-09e0c99be4d3
github.com/gobuffalo/mw-paramlogger v0.0.0-20181005191442-d6ee392ec72e
github.com/gobuffalo/mw-tokenauth v0.0.0-20181001105134-8545f626c189
github.com/gobuffalo/packd v0.0.0-20181114190715-f25c5d2471d7
github.com/gobuffalo/packr v1.21.0
github.com/gobuffalo/packd v0.0.0-20181124090624-311c6248e5fb
github.com/gobuffalo/packr v1.21.5
github.com/gobuffalo/plush v3.7.22+incompatible
github.com/gobuffalo/pop v4.9.0+incompatible
github.com/gobuffalo/pop v4.9.2+incompatible
github.com/gobuffalo/tags v2.0.11+incompatible
github.com/gobuffalo/x v0.0.0-20181110221217-14085ca3e1a9
github.com/gorilla/context v1.1.1
github.com/gorilla/mux v1.6.2
github.com/gorilla/sessions v1.1.3
github.com/jmoiron/sqlx v1.2.0 // indirect
github.com/markbates/deplist v1.0.5
github.com/markbates/grift v1.0.5
github.com/markbates/inflect v1.0.4
Expand All @@ -44,9 +42,10 @@ require (
github.com/spf13/pflag v1.0.3
github.com/spf13/viper v1.2.1
github.com/stretchr/testify v1.2.2
github.com/unrolled/secure v0.0.0-20181022170031-4b6b7cf51606 // indirect
golang.org/x/crypto v0.0.0-20181112202954-3d3f9f413869
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a // indirect
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f
golang.org/x/tools v0.0.0-20181114190951-94339b83286c
google.golang.org/appengine v1.3.0 // indirect
golang.org/x/tools v0.0.0-20181122213734-04b5d21e00f1
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc
)
Loading

0 comments on commit 671b1c8

Please sign in to comment.