Skip to content

Commit

Permalink
faster tests; add short and skip
Browse files Browse the repository at this point in the history
  • Loading branch information
mfridman committed Oct 14, 2023
1 parent dc8b261 commit c3a1ca2
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ tools:
test-packages:
go test $(GO_TEST_FLAGS) $$(go list ./... | grep -v -e /tests -e /bin -e /cmd -e /examples)

test-packages-short:
go test -test.short $(GO_TEST_FLAGS) $$(go list ./... | grep -v -e /tests -e /bin -e /cmd -e /examples)

test-e2e: test-e2e-postgres test-e2e-mysql test-e2e-clickhouse test-e2e-vertica

test-e2e-postgres:
Expand Down
3 changes: 3 additions & 0 deletions create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ import (

func TestSequential(t *testing.T) {
t.Parallel()
if testing.Short() {
t.Skip("skip long running test")
}

dir := t.TempDir()
defer os.Remove("./bin/create-goose") // clean up
Expand Down
3 changes: 3 additions & 0 deletions fix_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ import (

func TestFix(t *testing.T) {
t.Parallel()
if testing.Short() {
t.Skip("skip long running test")
}

dir := t.TempDir()
defer os.Remove("./bin/fix-goose") // clean up
Expand Down
2 changes: 2 additions & 0 deletions internal/migrationstats/migrationstats_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
)

func TestParsingGoMigrations(t *testing.T) {
t.Parallel()
tests := []struct {
name string
input string
Expand Down Expand Up @@ -38,6 +39,7 @@ func TestParsingGoMigrations(t *testing.T) {
}

func TestParsingGoMigrationsError(t *testing.T) {
t.Parallel()
_, err := parseGoFile(strings.NewReader(emptyInit))
check.HasError(t, err)
check.Contains(t, err.Error(), "no registered goose functions")
Expand Down
1 change: 1 addition & 0 deletions lock/postgres_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
)

func TestPostgresSessionLocker(t *testing.T) {
t.Parallel()
if testing.Short() {
t.Skip("skip long running test")
}
Expand Down

0 comments on commit c3a1ca2

Please sign in to comment.