buffalo: Error running test
Steps to Reproduce the Problem
- Run
buffalo testorbuffalo test -m FunctionToTest
Expected Behavior
I’m expecting the test would run perfectly and the database is being migrated.
Actual Behavior
It shows error when running buffalo test:
dropped database xendit_ovo_connector_test
created database xendit_ovo_connector_test
schema is empty for xendit_ovo_connector_test, skipping
INFO[0001] go test -p 1 -tags development github.com/xendit/xendit-ovo-connector github.com/xendit/xendit-ovo-connector/actions github.com/xendit/xendit-ovo-connector/grifts github.com/xendit/xendit-ovo-connector/models github.com/xendit/xendit-ovo-connector/utils
? github.com/xendit/xendit-ovo-connector [no test files]
[POP] 2018/09/25 09:27:02 info - Loading config file from /home/edyo/Documents/workspace/go/src/github.com/xendit/xendit-ovo-connector/database.yml
Warning: Log is deprecated, and will be removed in a future version. Please use SetLogger instead.
2018/09/25 09:27:02 pq: relation "users_merchants" does not exist
level=info msg=/merchants content_type=application/json db="0s" duration="6.21866ms" human_size="0 B" method=POST path=/merchants request_id=XoxHYhigCN-WOwAzukaHF size="0" status="0"
level=error msg="pq: relation \"users_merchants\" does not exist" content_type=application/json db="0s" duration="6.21866ms" human_size="0 B" method=POST path=/merchants request_id=XoxHYhigCN-WOwAzukaHF size="0" status="0"
--- FAIL: Test_ActionSuite (0.02s)
--- FAIL: Test_ActionSuite/Test_Merchant_Create (0.02s)
require.go:157:
Error Trace: merchant_test.go:10
Error: Not equal:
expected: 201
actual : 500
Test: Test_ActionSuite/Test_Merchant_Create
FAIL
FAIL github.com/xendit/xendit-ovo-connector/actions 0.072s
? github.com/xendit/xendit-ovo-connector/grifts [no test files]
ok github.com/xendit/xendit-ovo-connector/models (cached)
ok github.com/xendit/xendit-ovo-connector/utils (cached) [no tests to run]
Usage:
buffalo test [flags]
Flags:
-m, --force-migrations skips loading the schema and instead runs migrations before running tests
-h, --help help for test
ERRO[0002] Error: exit status 1
Info
### Buffalo Version
v0.12.6
### App Information
Pwd=/home/edyo/Documents/workspace/go/src/github.com/xendit/xendit-ovo-connector
Root=/home/edyo/Documents/workspace/go/src/github.com/xendit/xendit-ovo-connector
GoPath=/home/edyo/Documents/workspace/go
Name=xendit-ovo-connector
Bin=bin/xendit-ovo-connector
PackagePkg=github.com/xendit/xendit-ovo-connector
ActionsPkg=github.com/xendit/xendit-ovo-connector/actions
ModelsPkg=github.com/xendit/xendit-ovo-connector/models
GriftsPkg=github.com/xendit/xendit-ovo-connector/grifts
VCS=git
WithPop=true
WithSQLite=false
WithDep=false
WithWebpack=false
WithYarn=false
WithDocker=true
WithGrifts=true
### Go Version
go version go1.10.3 linux/amd64
### Go Env
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/edyo/.cache/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/edyo/Documents/workspace/go"
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build122391856=/tmp/go-build -gno-record-gcc-switches"
### Node Version
v10.11.0
### NPM Version
6.4.1
### Yarn Version
1.7.0
### PostgreSQL Version
PostgreSQL Not Found
### MySQL Version
mysql Ver 14.14 Distrib 5.7.23, for Linux (x86_64) using EditLine wrapper
### SQLite Version
3.22.0 2018-01-22 18:45:57 0c55d179733b46d8d0ba4d88e01a25e10677046ee3da1d5b1581e86726f2alt2
### Dep Version
could not find a Gopkg.toml file
### Dep Status
could not find a Gopkg.toml file
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 16 (8 by maintainers)
You’re right. The tests are failing. But have a look at the following Postgres log. They are failing, because there are no tables. I’ve just installed pg_dump onto my host, now it’s working fine 😃