Skip to content

Commit

Permalink
Disable UTF8-invalid tests when running CLI dev server (#1448)
Browse files Browse the repository at this point in the history
  • Loading branch information
cretz authored Apr 24, 2024
1 parent 93c08b0 commit 8361067
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/cmd/build/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,9 @@ func (b *builder) integrationTest() error {
if *coverageFileFlag != "" {
args = append(args, "-coverprofile="+filepath.Join(b.rootDir, coverageDir, *coverageFileFlag), "-coverpkg=./...")
}
if *devServerFlag {
args = append(args, "-using-cli-dev-server")
}
args = append(args, "./...")
// Must run in test dir
cmd := b.cmdFromRoot(args...)
Expand Down
16 changes: 16 additions & 0 deletions test/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ package test_test
import (
"context"
"errors"
"flag"
"fmt"
"math/rand"
"os"
Expand Down Expand Up @@ -77,6 +78,12 @@ import (
"go.temporal.io/sdk/workflow"
)

var usingCLIDevServerFlag bool

func init() {
flag.BoolVar(&usingCLIDevServerFlag, "using-cli-dev-server", false, "Whether CLI dev server is in use")
}

const (
ctxTimeout = 15 * time.Second
namespaceCacheRefreshInterval = 20 * time.Second
Expand Down Expand Up @@ -5059,6 +5066,12 @@ func (ts *InvalidUTF8Suite) TearDownSuite() {
}

func (ts *InvalidUTF8Suite) SetupTest() {
// This suite isn't valid for CLI dev servers because they don't allow invalid
// UTF8
if usingCLIDevServerFlag {
ts.T().Skip("Skipping invalid UTF8 suite for dev server")
return
}
var err error
ts.client, err = client.Dial(client.Options{
HostPort: ts.config.ServiceAddr,
Expand Down Expand Up @@ -5091,6 +5104,9 @@ func (ts *InvalidUTF8Suite) SetupTest() {
}

func (ts *InvalidUTF8Suite) TearDownTest() {
if usingCLIDevServerFlag {
return
}
ts.client.Close()
if !ts.workerStopped {
ts.worker.Stop()
Expand Down

0 comments on commit 8361067

Please sign in to comment.