Skip to content

Commit

Permalink
Move test data to testdata dir & remove unneeded Dockerfile (#452)
Browse files Browse the repository at this point in the history
* Move test data to testdata dir & remove unneeded Dockerfile

* Fix migration files location for CI tests
  • Loading branch information
stanislas-m committed Nov 1, 2019
1 parent b5e47d5 commit f8da582
Show file tree
Hide file tree
Showing 59 changed files with 11 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ bin/*
gin-bin
*.sqlite
tsoda
migrations/schema.sql
testdata/migrations/schema.sql
.grifter/
vendor/
go.mod
Expand Down
8 changes: 0 additions & 8 deletions Dockerfile

This file was deleted.

6 changes: 3 additions & 3 deletions azure-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ steps:
workingDirectory: "$(modulePath)"
displayName: "Install soda"
- script: |
$(GOBIN)/soda drop -e $(SODA_DIALECT)
$(GOBIN)/soda create -e $(SODA_DIALECT)
$(GOBIN)/soda migrate -e $(SODA_DIALECT)
$(GOBIN)/soda drop -e $(SODA_DIALECT) -p ./testdata/migrations
$(GOBIN)/soda create -e $(SODA_DIALECT) -p ./testdata/migrations
$(GOBIN)/soda migrate -e $(SODA_DIALECT) -p ./testdata/migrations
workingDirectory: "$(modulePath)"
displayName: "Create DB & run migrations"
- script: |
Expand Down
2 changes: 1 addition & 1 deletion migration_box_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ func Test_MigrationBox(t *testing.T) {
}
r := require.New(t)

b, err := NewMigrationBox(packr.New("./migrations/multiple", "./migrations/multiple"), PDB)
b, err := NewMigrationBox(packr.New("./testdata/migrations/multiple", "./testdata/migrations/multiple"), PDB)
r.NoError(err)
r.Equal(4, len(b.Migrations["up"]))
r.Equal("mysql", b.Migrations["up"][0].DBType)
Expand Down
12 changes: 6 additions & 6 deletions test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ function test {
export SODA_DIALECT=$1
echo ./tsoda -v
echo "Setup..."
./tsoda drop -e $SODA_DIALECT -c ./database.yml
./tsoda create -e $SODA_DIALECT -c ./database.yml
./tsoda migrate -e $SODA_DIALECT -c ./database.yml
./tsoda drop -e $SODA_DIALECT -c ./database.yml -p ./testdata/migrations
./tsoda create -e $SODA_DIALECT -c ./database.yml -p ./testdata/migrations
./tsoda migrate -e $SODA_DIALECT -c ./database.yml -p ./testdata/migrations
echo "Test..."
go test -race -tags sqlite $VERBOSE ./... -count=1
}
Expand All @@ -61,9 +61,9 @@ function debug_test {
export SODA_DIALECT=$1
echo ./tsoda -v
echo "Setup..."
./tsoda drop -e $SODA_DIALECT -c ./database.yml
./tsoda create -e $SODA_DIALECT -c ./database.yml
./tsoda migrate -e $SODA_DIALECT -c ./database.yml
./tsoda drop -e $SODA_DIALECT -c ./database.yml -p ./testdata/migrations
./tsoda create -e $SODA_DIALECT -c ./database.yml -p ./testdata/migrations
./tsoda migrate -e $SODA_DIALECT -c ./database.yml -p ./testdata/migrations
echo "Test and debug..."
dlv test github.com/gobuffalo/pop
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit f8da582

Please sign in to comment.