Skip to content

Commit

Permalink
Update server/embed/config_test.go
Browse files Browse the repository at this point in the history
Co-authored-by: Marek Siarkowicz <[email protected]>
  • Loading branch information
siyuanfoundation and serathius authored Jun 28, 2024
1 parent c726d69 commit f92c189
Showing 1 changed file with 7 additions and 17 deletions.
24 changes: 7 additions & 17 deletions server/embed/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,24 +159,14 @@ func TestConfigFileFeatureGates(t *testing.T) {
t.Run(tc.name, func(t *testing.T) {
var b []byte
var err error
if tc.setExperimentalStopGRPCServiceOnDefrag {
yc := struct {
ExperimentalStopGRPCServiceOnDefrag bool `json:"experimental-stop-grpc-service-on-defrag"`
FeatureGatesJSON string `json:"feature-gates"`
}{
tc.experimentalStopGRPCServiceOnDefrag,
tc.featureGatesJSON,
}
b, err = yaml.Marshal(&yc)
} else {
yc := struct {
FeatureGatesJSON string `json:"feature-gates"`
}{

tc.featureGatesJSON,
}
b, err = yaml.Marshal(&yc)
data := map[string]string{}
if tc.featureGatesJSON != "" {
data["feature-gates"] = tc.featureGatesJSON
}
if tc.experimentalStopGRPCServiceOnDefrag != "" {
data["experimental-stop-grpc-service-on-defrag"] = tc.experimentalStopGRPCServiceOnDefrag
}
b, err = yaml.Marshal(&yc)
if err != nil {
t.Fatal(err)
}
Expand Down

0 comments on commit f92c189

Please sign in to comment.