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

Commit

Permalink
buffalo test needs to support sqlite
Browse files Browse the repository at this point in the history
  • Loading branch information
markbates committed Feb 28, 2018
1 parent 502e1bf commit 7805e97
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions buffalo/cmd/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package cmd
import (
"bytes"
"io"
"io/ioutil"
"os"
"os/exec"
"path/filepath"
Expand Down Expand Up @@ -170,6 +171,11 @@ func testPackages(givenArgs []string) ([]string, error) {

func newTestCmd(args []string) *exec.Cmd {
cargs := []string{"test", "-p", "1"}
if b, err := ioutil.ReadFile("database.yml"); err == nil {
if bytes.Contains(b, []byte("sqlite")) {
cargs = append(cargs, "-tags", "sqlite")
}
}
cargs = append(cargs, args...)
cmd := exec.Command(envy.Get("GO_BIN", "go"), cargs...)
cmd.Stdin = os.Stdin
Expand Down

0 comments on commit 7805e97

Please sign in to comment.