Skip to content

Commit fa05206

Browse files
committed
tweak not to require topology in env
1 parent f9cc0b8 commit fa05206

File tree

4 files changed

+17
-18
lines changed

4 files changed

+17
-18
lines changed

.github/workflows/all.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,3 @@ jobs:
7070
MVTEST_SRC: ${{matrix.topology.srcConnStr}}
7171
MVTEST_DST: ${{matrix.topology.dstConnStr}}
7272
MVTEST_META: mongodb://localhost:27040
73-
MVTEST_TOPOLOGY: ${{matrix.topology.name}}

internal/verifier/change_stream_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ func (suite *IntegrationTestSuite) TestStartAtTimeNoChanges() {
147147
}
148148

149149
func (suite *IntegrationTestSuite) TestStartAtTimeWithChanges() {
150-
if suite.GetTopology() == TopologySharded {
150+
if suite.GetSrcTopology() == TopologySharded {
151151
suite.T().Skip("Skipping pending REP-5299.")
152152
}
153153

internal/verifier/integration_test_suite.go

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ package verifier
22

33
import (
44
"context"
5-
"os"
65
"strings"
76

87
mapset "github.com/deckarep/golang-set/v2"
98
"github.com/pkg/errors"
9+
"github.com/samber/lo"
1010
"github.com/stretchr/testify/suite"
1111
"go.mongodb.org/mongo-driver/bson"
1212
"go.mongodb.org/mongo-driver/mongo"
@@ -23,8 +23,6 @@ const (
2323
TopologySharded TestTopology = "sharded"
2424
)
2525

26-
var knownTopologies = []TestTopology{TopologyReplset, TopologySharded}
27-
2826
type IntegrationTestSuite struct {
2927
suite.Suite
3028
srcConnStr, dstConnStr, metaConnStr string
@@ -120,20 +118,22 @@ func (suite *IntegrationTestSuite) TearDownTest() {
120118
}
121119
}
122120

123-
func (suite *IntegrationTestSuite) GetTopology() TestTopology {
124-
rawTopology, found := os.LookupEnv(topologyEnvVar)
125-
126-
suite.Require().True(found, "Environment must contain %#q.", topologyEnvVar)
121+
func (suite *IntegrationTestSuite) GetSrcTopology() TestTopology {
122+
hello := struct {
123+
Msg string
124+
}{}
127125

128-
topology := TestTopology(rawTopology)
126+
resp := suite.srcMongoClient.Database("admin").RunCommand(
127+
suite.Context(),
128+
bson.D{{"hello", 1}},
129+
)
129130

130-
suite.Require().Contains(
131-
knownTopologies,
132-
topology,
133-
"%#q must be a known value.",
131+
suite.Require().NoError(
132+
resp.Decode(&hello),
133+
"should fetch & decode hello",
134134
)
135135

136-
return topology
136+
return lo.Ternary(hello.Msg == "isdbgrid", TopologySharded, "")
137137
}
138138

139139
func (suite *IntegrationTestSuite) BuildVerifier() *Verifier {

internal/verifier/migration_verifier_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1149,7 +1149,7 @@ func TestVerifierCompareIndexSpecs(t *testing.T) {
11491149
}
11501150

11511151
func (suite *IntegrationTestSuite) TestVerifierNamespaceList() {
1152-
if suite.GetTopology() == TopologySharded {
1152+
if suite.GetSrcTopology() == TopologySharded {
11531153
suite.T().Skip("Skipping pending REP-5299.")
11541154
}
11551155

@@ -1279,7 +1279,7 @@ func (suite *IntegrationTestSuite) TestVerificationStatus() {
12791279
}
12801280

12811281
func (suite *IntegrationTestSuite) TestGenerationalRechecking() {
1282-
if suite.GetTopology() == TopologySharded {
1282+
if suite.GetSrcTopology() == TopologySharded {
12831283
suite.T().Skip("Skipping pending REP-5299.")
12841284
}
12851285

@@ -1391,7 +1391,7 @@ func (suite *IntegrationTestSuite) TestGenerationalRechecking() {
13911391
}
13921392

13931393
func (suite *IntegrationTestSuite) TestVerifierWithFilter() {
1394-
if suite.GetTopology() == TopologySharded {
1394+
if suite.GetSrcTopology() == TopologySharded {
13951395
suite.T().Skip("Skipping pending REP-5299.")
13961396
}
13971397

0 commit comments

Comments
 (0)