Skip to content

Commit 8361067

Browse files
authoredApr 24, 2024··
Disable UTF8-invalid tests when running CLI dev server (#1448)
1 parent 93c08b0 commit 8361067

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed
 

‎internal/cmd/build/main.go

+3
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,9 @@ func (b *builder) integrationTest() error {
166166
if *coverageFileFlag != "" {
167167
args = append(args, "-coverprofile="+filepath.Join(b.rootDir, coverageDir, *coverageFileFlag), "-coverpkg=./...")
168168
}
169+
if *devServerFlag {
170+
args = append(args, "-using-cli-dev-server")
171+
}
169172
args = append(args, "./...")
170173
// Must run in test dir
171174
cmd := b.cmdFromRoot(args...)

‎test/integration_test.go

+16
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ package test_test
2727
import (
2828
"context"
2929
"errors"
30+
"flag"
3031
"fmt"
3132
"math/rand"
3233
"os"
@@ -77,6 +78,12 @@ import (
7778
"go.temporal.io/sdk/workflow"
7879
)
7980

81+
var usingCLIDevServerFlag bool
82+
83+
func init() {
84+
flag.BoolVar(&usingCLIDevServerFlag, "using-cli-dev-server", false, "Whether CLI dev server is in use")
85+
}
86+
8087
const (
8188
ctxTimeout = 15 * time.Second
8289
namespaceCacheRefreshInterval = 20 * time.Second
@@ -5059,6 +5066,12 @@ func (ts *InvalidUTF8Suite) TearDownSuite() {
50595066
}
50605067

50615068
func (ts *InvalidUTF8Suite) SetupTest() {
5069+
// This suite isn't valid for CLI dev servers because they don't allow invalid
5070+
// UTF8
5071+
if usingCLIDevServerFlag {
5072+
ts.T().Skip("Skipping invalid UTF8 suite for dev server")
5073+
return
5074+
}
50625075
var err error
50635076
ts.client, err = client.Dial(client.Options{
50645077
HostPort: ts.config.ServiceAddr,
@@ -5091,6 +5104,9 @@ func (ts *InvalidUTF8Suite) SetupTest() {
50915104
}
50925105

50935106
func (ts *InvalidUTF8Suite) TearDownTest() {
5107+
if usingCLIDevServerFlag {
5108+
return
5109+
}
50945110
ts.client.Close()
50955111
if !ts.workerStopped {
50965112
ts.worker.Stop()

0 commit comments

Comments
 (0)
Please sign in to comment.