-
Notifications
You must be signed in to change notification settings - Fork 542
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update integration test suite #713
Changes from 6 commits
5393f02
ebcecff
1d1c380
51e6b7e
c8fca01
439f424
a468721
42ebc59
a0d5fce
9c7b6fe
40c1f5d
a86b49c
c1d8ac0
388a252
e732eb3
7821621
e0154a7
d767f2a
19e067b
df63d45
209bc3e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,6 @@ | |
|
||
dist/ | ||
release_notes.txt | ||
|
||
go.work | ||
go.work.sum |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,10 +7,8 @@ import ( | |
"path/filepath" | ||
"testing" | ||
|
||
"github.com/jackc/pgx/v5/pgconn" | ||
"github.com/pressly/goose/v3/database" | ||
"github.com/pressly/goose/v3/internal/check" | ||
"github.com/pressly/goose/v3/internal/testdb" | ||
"go.uber.org/multierr" | ||
"modernc.org/sqlite" | ||
) | ||
|
@@ -32,21 +30,6 @@ func TestDialectStore(t *testing.T) { | |
_, err = database.NewStore("", "foo") | ||
check.HasError(t, err) | ||
}) | ||
t.Run("postgres", func(t *testing.T) { | ||
if testing.Short() { | ||
t.Skip("skip long-running test") | ||
} | ||
// Test postgres specific behavior. | ||
db, cleanup, err := testdb.NewPostgres() | ||
check.NoError(t, err) | ||
t.Cleanup(cleanup) | ||
testStore(context.Background(), t, database.DialectPostgres, db, func(t *testing.T, err error) { | ||
var pgErr *pgconn.PgError | ||
ok := errors.As(err, &pgErr) | ||
check.Bool(t, ok, true) | ||
check.Equal(t, pgErr.Code, "42P07") // duplicate_table | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The entire dialect store can be tested with SQLite. The only reason we had postgres in here was to test for this duplicate table error, confirming the error can be correctly asserted from caller -> driver -> goose -> caller. |
||
}) | ||
}) | ||
// Test generic behavior. | ||
t.Run("sqlite3", func(t *testing.T) { | ||
db, err := sql.Open("sqlite", ":memory:") | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,102 +1,89 @@ | ||
module github.com/pressly/goose/v3 | ||
|
||
go 1.20 | ||
go 1.21 | ||
|
||
toolchain go1.22.1 | ||
|
||
require ( | ||
github.com/ClickHouse/clickhouse-go/v2 v2.17.1 | ||
github.com/go-sql-driver/mysql v1.7.1 | ||
github.com/jackc/pgx/v5 v5.5.2 | ||
github.com/marcboeker/go-duckdb v1.5.6 | ||
github.com/ClickHouse/clickhouse-go/v2 v2.20.0 | ||
github.com/go-sql-driver/mysql v1.8.0 | ||
github.com/jackc/pgx/v5 v5.5.5 | ||
github.com/marcboeker/go-duckdb v1.6.1 | ||
github.com/mfridman/interpolate v0.0.2 | ||
github.com/microsoft/go-mssqldb v1.6.0 | ||
github.com/ory/dockertest/v3 v3.10.0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I want the main goose module to have no dependency on this and any of the indirect deps. I think removing it and having an independent "integration test" module is cleaner. |
||
github.com/microsoft/go-mssqldb v1.7.0 | ||
github.com/sethvargo/go-retry v0.2.4 | ||
github.com/tursodatabase/libsql-client-go v0.0.0-20231216154754-8383a53d618f | ||
github.com/tursodatabase/libsql-client-go v0.0.0-20240220085343-4ae0eb9d0898 | ||
github.com/vertica/vertica-sql-go v1.3.3 | ||
github.com/ydb-platform/ydb-go-sdk/v3 v3.55.1 | ||
github.com/ydb-platform/ydb-go-sdk/v3 v3.57.0 | ||
github.com/ziutek/mymysql v1.5.4 | ||
go.uber.org/multierr v1.11.0 | ||
golang.org/x/sync v0.6.0 | ||
modernc.org/sqlite v1.28.0 | ||
modernc.org/sqlite v1.29.3 | ||
) | ||
|
||
require ( | ||
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect | ||
github.com/ClickHouse/ch-go v0.58.2 // indirect | ||
github.com/Microsoft/go-winio v0.6.1 // indirect | ||
github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 // indirect | ||
github.com/andybalholm/brotli v1.0.6 // indirect | ||
filippo.io/edwards25519 v1.1.0 // indirect | ||
github.com/ClickHouse/ch-go v0.61.5 // indirect | ||
github.com/andybalholm/brotli v1.1.0 // indirect | ||
github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230512164433-5d1fd1a340c9 // indirect | ||
github.com/cenkalti/backoff/v4 v4.2.1 // indirect | ||
github.com/containerd/continuity v0.4.3 // indirect | ||
github.com/docker/cli v24.0.7+incompatible // indirect | ||
github.com/docker/docker v24.0.7+incompatible // indirect | ||
github.com/docker/go-connections v0.4.0 // indirect | ||
github.com/docker/go-units v0.5.0 // indirect | ||
github.com/apache/arrow/go/v14 v14.0.2 // indirect | ||
github.com/docker/docker v25.0.4+incompatible // indirect | ||
github.com/dustin/go-humanize v1.0.1 // indirect | ||
github.com/elastic/go-sysinfo v1.11.2 // indirect | ||
github.com/elastic/go-sysinfo v1.13.1 // indirect | ||
github.com/elastic/go-windows v1.0.1 // indirect | ||
github.com/go-faster/city v1.0.1 // indirect | ||
github.com/go-faster/errors v0.6.1 // indirect | ||
github.com/gogo/protobuf v1.3.2 // indirect | ||
github.com/go-faster/errors v0.7.1 // indirect | ||
github.com/goccy/go-json v0.10.2 // indirect | ||
github.com/golang-jwt/jwt/v4 v4.5.0 // indirect | ||
github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 // indirect | ||
github.com/golang-sql/sqlexp v0.1.0 // indirect | ||
github.com/golang/protobuf v1.5.3 // indirect | ||
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect | ||
github.com/google/uuid v1.5.0 // indirect | ||
github.com/imdario/mergo v0.3.16 // indirect | ||
github.com/golang/protobuf v1.5.4 // indirect | ||
github.com/google/flatbuffers v24.3.7+incompatible // indirect | ||
github.com/google/uuid v1.6.0 // indirect | ||
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect | ||
github.com/jackc/pgpassfile v1.0.0 // indirect | ||
github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect | ||
github.com/jackc/pgservicefile v0.0.0-20231201235250-de7065d80cb9 // indirect | ||
github.com/jackc/puddle/v2 v2.2.1 // indirect | ||
github.com/joeshaw/multierror v0.0.0-20140124173710-69b34d4ec901 // indirect | ||
github.com/jonboulle/clockwork v0.4.0 // indirect | ||
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect | ||
github.com/klauspost/compress v1.17.2 // indirect | ||
github.com/klauspost/compress v1.17.7 // indirect | ||
github.com/klauspost/cpuid/v2 v2.2.7 // indirect | ||
github.com/libsql/sqlite-antlr4-parser v0.0.0-20230802215326-5cb5bb604475 // indirect | ||
github.com/mattn/go-isatty v0.0.20 // indirect | ||
github.com/mitchellh/mapstructure v1.5.0 // indirect | ||
github.com/moby/term v0.5.0 // indirect | ||
github.com/opencontainers/go-digest v1.0.0 // indirect | ||
github.com/opencontainers/image-spec v1.1.0-rc5 // indirect | ||
github.com/opencontainers/runc v1.1.12 // indirect | ||
github.com/paulmach/orb v0.10.0 // indirect | ||
github.com/pierrec/lz4/v4 v4.1.18 // indirect | ||
github.com/ncruces/go-strftime v0.1.9 // indirect | ||
github.com/opencontainers/image-spec v1.1.0 // indirect | ||
github.com/paulmach/orb v0.11.1 // indirect | ||
github.com/pierrec/lz4/v4 v4.1.21 // indirect | ||
github.com/pkg/errors v0.9.1 // indirect | ||
github.com/prometheus/procfs v0.12.0 // indirect | ||
github.com/prometheus/procfs v0.13.0 // indirect | ||
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect | ||
github.com/segmentio/asm v1.2.0 // indirect | ||
github.com/shopspring/decimal v1.3.1 // indirect | ||
github.com/sirupsen/logrus v1.9.3 // indirect | ||
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect | ||
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect | ||
github.com/xeipuuv/gojsonschema v1.2.0 // indirect | ||
github.com/ydb-platform/ydb-go-genproto v0.0.0-20240126124512-dbb0e1720dbf // indirect | ||
go.opentelemetry.io/otel v1.20.0 // indirect | ||
go.opentelemetry.io/otel/trace v1.20.0 // indirect | ||
golang.org/x/crypto v0.17.0 // indirect | ||
golang.org/x/exp v0.0.0-20230510235704-dd950f8aeaea // indirect | ||
golang.org/x/mod v0.14.0 // indirect | ||
golang.org/x/net v0.19.0 // indirect | ||
golang.org/x/sys v0.15.0 // indirect | ||
github.com/ydb-platform/ydb-go-genproto v0.0.0-20240219184408-1de5f3f077de // indirect | ||
github.com/zeebo/xxh3 v1.0.2 // indirect | ||
go.opentelemetry.io/otel v1.24.0 // indirect | ||
go.opentelemetry.io/otel/trace v1.24.0 // indirect | ||
golang.org/x/crypto v0.21.0 // indirect | ||
golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect | ||
golang.org/x/mod v0.16.0 // indirect | ||
golang.org/x/net v0.22.0 // indirect | ||
golang.org/x/sys v0.18.0 // indirect | ||
golang.org/x/text v0.14.0 // indirect | ||
golang.org/x/tools v0.15.0 // indirect | ||
google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 // indirect | ||
google.golang.org/grpc v1.59.0 // indirect | ||
google.golang.org/protobuf v1.31.0 // indirect | ||
gopkg.in/yaml.v2 v2.4.0 // indirect | ||
golang.org/x/tools v0.19.0 // indirect | ||
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect | ||
google.golang.org/genproto/googleapis/rpc v0.0.0-20240308144416-29370a3891b7 // indirect | ||
google.golang.org/grpc v1.62.1 // indirect | ||
google.golang.org/protobuf v1.33.0 // indirect | ||
gopkg.in/yaml.v3 v3.0.1 // indirect | ||
howett.net/plist v1.0.0 // indirect | ||
lukechampine.com/uint128 v1.3.0 // indirect | ||
modernc.org/cc/v3 v3.41.0 // indirect | ||
modernc.org/ccgo/v3 v3.16.15 // indirect | ||
modernc.org/libc v1.32.0 // indirect | ||
howett.net/plist v1.0.1 // indirect | ||
modernc.org/gc/v3 v3.0.0-20240304020402-f0dba7c97c2b // indirect | ||
modernc.org/libc v1.43.1 // indirect | ||
modernc.org/mathutil v1.6.0 // indirect | ||
modernc.org/memory v1.7.2 // indirect | ||
modernc.org/opt v0.1.3 // indirect | ||
modernc.org/strutil v1.2.0 // indirect | ||
modernc.org/token v1.1.0 // indirect | ||
nhooyr.io/websocket v1.8.7 // indirect | ||
nhooyr.io/websocket v1.8.10 // indirect | ||
) | ||
|
||
retract ( | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was a bit of a bottleneck, and I think we should be able to run more tests in parallel.