Skip to content

Commit

Permalink
chore: add mod replace for buildengine test modules
Browse files Browse the repository at this point in the history
Without this the tests would pull from github on every invocation.

Also skip buildengine Kotlin tests if `go test -short` is used, as these
take upwards of 30s.
  • Loading branch information
alecthomas committed Mar 8, 2024
1 parent 2df94ff commit 9e86b59
Show file tree
Hide file tree
Showing 7 changed files with 126 additions and 84 deletions.
15 changes: 15 additions & 0 deletions buildengine/build_kotlin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ import (
)

func TestGenerateBasicModule(t *testing.T) {
if testing.Short() {
t.SkipNow()
}
sch := &schema.Schema{
Modules: []*schema.Module{
schema.Builtins(),
Expand All @@ -28,6 +31,9 @@ package ftl.test
}

func TestGenerateAllTypes(t *testing.T) {
if testing.Short() {
t.SkipNow()
}
sch := &schema.Schema{
Modules: []*schema.Module{
schema.Builtins(),
Expand Down Expand Up @@ -148,6 +154,9 @@ data class TestResponse(
}

func TestGenerateAllVerbs(t *testing.T) {
if testing.Short() {
t.SkipNow()
}
sch := &schema.Schema{
Modules: []*schema.Module{
schema.Builtins(),
Expand Down Expand Up @@ -205,6 +214,9 @@ fun testVerb(context: Context, req: Request): ftl.builtin.Empty = throw
}

func TestGenerateBuiltins(t *testing.T) {
if testing.Short() {
t.SkipNow()
}
sch := &schema.Schema{
Modules: []*schema.Module{
schema.Builtins(),
Expand Down Expand Up @@ -251,6 +263,9 @@ class Empty
}

func TestGenerateEmptyDataRefs(t *testing.T) {
if testing.Short() {
t.SkipNow()
}
sch := &schema.Schema{
Modules: []*schema.Module{
schema.Builtins(),
Expand Down
17 changes: 11 additions & 6 deletions buildengine/testdata/modules/alpha/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@ require (
connectrpc.com/connect v1.15.0 // indirect
connectrpc.com/grpcreflect v1.2.0 // indirect
connectrpc.com/otelconnect v0.7.0 // indirect
github.com/BurntSushi/toml v1.3.2 // indirect
github.com/TBD54566975/scaffolder v0.8.0 // indirect
github.com/alecthomas/concurrency v0.0.2 // indirect
github.com/alecthomas/kong v0.9.0 // indirect
github.com/alecthomas/participle/v2 v2.1.1 // indirect
github.com/alecthomas/types v0.10.1 // indirect
github.com/alecthomas/types v0.13.0 // indirect
github.com/alessio/shellescape v1.4.2 // indirect
github.com/danieljoos/wincred v1.2.0 // indirect
github.com/go-logr/logr v1.4.1 // indirect
Expand All @@ -25,19 +28,21 @@ require (
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/oklog/ulid/v2 v2.1.0 // indirect
github.com/swaggest/jsonschema-go v0.3.64 // indirect
github.com/swaggest/jsonschema-go v0.3.66 // indirect
github.com/swaggest/refl v1.3.0 // indirect
github.com/zalando/go-keyring v0.2.3 // indirect
go.opentelemetry.io/otel v1.23.1 // indirect
go.opentelemetry.io/otel/metric v1.23.1 // indirect
go.opentelemetry.io/otel/trace v1.23.1 // indirect
go.opentelemetry.io/otel v1.24.0 // indirect
go.opentelemetry.io/otel/metric v1.24.0 // indirect
go.opentelemetry.io/otel/trace v1.24.0 // indirect
golang.design/x/reflect v0.0.0-20220504060917-02c43be63f3b // indirect
golang.org/x/crypto v0.19.0 // indirect
golang.org/x/exp v0.0.0-20240205201215-2c58cdc269a3 // indirect
golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect
golang.org/x/mod v0.15.0 // indirect
golang.org/x/net v0.21.0 // indirect
golang.org/x/sync v0.6.0 // indirect
golang.org/x/sys v0.17.0 // indirect
golang.org/x/text v0.14.0 // indirect
google.golang.org/protobuf v1.32.0 // indirect
)

replace github.com/TBD54566975/ftl => ../../../..
48 changes: 26 additions & 22 deletions buildengine/testdata/modules/alpha/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 11 additions & 6 deletions buildengine/testdata/modules/another/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@ require (
connectrpc.com/connect v1.15.0 // indirect
connectrpc.com/grpcreflect v1.2.0 // indirect
connectrpc.com/otelconnect v0.7.0 // indirect
github.com/BurntSushi/toml v1.3.2 // indirect
github.com/TBD54566975/scaffolder v0.8.0 // indirect
github.com/alecthomas/concurrency v0.0.2 // indirect
github.com/alecthomas/kong v0.9.0 // indirect
github.com/alecthomas/participle/v2 v2.1.1 // indirect
github.com/alecthomas/types v0.10.1 // indirect
github.com/alecthomas/types v0.13.0 // indirect
github.com/alessio/shellescape v1.4.2 // indirect
github.com/danieljoos/wincred v1.2.0 // indirect
github.com/go-logr/logr v1.4.1 // indirect
Expand All @@ -25,19 +28,21 @@ require (
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/oklog/ulid/v2 v2.1.0 // indirect
github.com/swaggest/jsonschema-go v0.3.64 // indirect
github.com/swaggest/jsonschema-go v0.3.66 // indirect
github.com/swaggest/refl v1.3.0 // indirect
github.com/zalando/go-keyring v0.2.3 // indirect
go.opentelemetry.io/otel v1.23.1 // indirect
go.opentelemetry.io/otel/metric v1.23.1 // indirect
go.opentelemetry.io/otel/trace v1.23.1 // indirect
go.opentelemetry.io/otel v1.24.0 // indirect
go.opentelemetry.io/otel/metric v1.24.0 // indirect
go.opentelemetry.io/otel/trace v1.24.0 // indirect
golang.design/x/reflect v0.0.0-20220504060917-02c43be63f3b // indirect
golang.org/x/crypto v0.19.0 // indirect
golang.org/x/exp v0.0.0-20240205201215-2c58cdc269a3 // indirect
golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect
golang.org/x/mod v0.15.0 // indirect
golang.org/x/net v0.21.0 // indirect
golang.org/x/sync v0.6.0 // indirect
golang.org/x/sys v0.17.0 // indirect
golang.org/x/text v0.14.0 // indirect
google.golang.org/protobuf v1.32.0 // indirect
)

replace github.com/TBD54566975/ftl => ../../../..
Loading

0 comments on commit 9e86b59

Please sign in to comment.