Skip to content

Commit dcad0f4

Browse files
committed
Fix unit test: cql.test should set -test.coverprofile flag first before sub command.
1 parent d3b14b7 commit dcad0f4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

sqlchain/observer/observation_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -488,9 +488,9 @@ func TestFullProcess(t *testing.T) {
488488
var observerCmd *utils.CMD
489489
observerCmd, err = utils.RunCommandNB(
490490
FJ(baseDir, "./bin/cql.test"),
491-
[]string{"web", "-config", FJ(testWorkingDir, "./observation/node_observer/config.yaml"),
491+
[]string{"-test.coverprofile", FJ(baseDir, "./cmd/cql/observer.cover.out"),
492+
"web", "-config", FJ(testWorkingDir, "./observation/node_observer/config.yaml"),
492493
"-bg-log-level", "debug",
493-
"-test.coverprofile", FJ(baseDir, "./cmd/cql/observer.cover.out"),
494494
"127.0.0.1:4663",
495495
},
496496
"observer", testWorkingDir, logDir, false,
@@ -719,9 +719,9 @@ func TestFullProcess(t *testing.T) {
719719
// start observer again
720720
observerCmd, err = utils.RunCommandNB(
721721
FJ(baseDir, "./bin/cql.test"),
722-
[]string{"web", "-config", FJ(testWorkingDir, "./observation/node_observer/config.yaml"),
722+
[]string{"-test.coverprofile", FJ(baseDir, "./cmd/cql/observer.cover.out"),
723+
"web", "-config", FJ(testWorkingDir, "./observation/node_observer/config.yaml"),
723724
"-bg-log-level", "debug",
724-
"-test.coverprofile", FJ(baseDir, "./cmd/cql/observer.cover.out"),
725725
"127.0.0.1:4663",
726726
},
727727
"observer", testWorkingDir, logDir, false,

0 commit comments

Comments
 (0)