Skip to content

Commit

Permalink
chore: clean up the WithJava API
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartwdouglas committed Aug 14, 2024
1 parent 2ce1deb commit c99f200
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
1 change: 0 additions & 1 deletion backend/controller/leases/lease_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
func TestLease(t *testing.T) {
in.Run(t,
in.WithLanguages("go", "java"),
in.WithJava(),
in.CopyModule("leases"),
in.Build("leases"),
// checks if leases work in a unit test environment
Expand Down
8 changes: 5 additions & 3 deletions integration/harness.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"fmt"
"os"
"path/filepath"
"slices"
"sync"
"syscall"
"testing"
Expand Down Expand Up @@ -78,8 +79,9 @@ func WithEnvar(key, value string) Option {
}
}

// WithJava is a Run* option that ensures the Java runtime is built.
func WithJava() Option {
// BuildJava is a Run* option that ensures the Java runtime is built.
// If the test languages contain java this is not necessary, as it is implied
func BuildJava() Option {
return func(o *options) {
o.requireJava = true
}
Expand Down Expand Up @@ -176,7 +178,7 @@ func run(t *testing.T, actionsOrOptions ...ActionOrOption) {
Infof("Building ftl")
err = ftlexec.Command(ctx, log.Debug, rootDir, "just", "build", "ftl").RunBuffered(ctx)
assert.NoError(t, err)
if opts.requireJava {
if opts.requireJava || slices.Contains(opts.languages, "java") {
err = ftlexec.Command(ctx, log.Debug, rootDir, "just", "build-java", "-DskipTests").RunBuffered(ctx)
assert.NoError(t, err)
}
Expand Down
1 change: 0 additions & 1 deletion java-runtime/java_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ func TestJavaToGoCall(t *testing.T) {
//tests = append(tests, PairedPrefixVerbTest("nilvalue", "optionalTestObjectOptionalFieldsVerb", ftl.None[any]())...)

in.Run(t,
in.WithJava(),
in.WithLanguages("java"),
in.CopyModule("gomodule"),
in.CopyModule("javamodule"),
Expand Down

0 comments on commit c99f200

Please sign in to comment.