Skip to content

Commit 94bf67e

Browse files
authored
Skip Stable API count example test. (#1011)
1 parent 2d577b3 commit 94bf67e

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

examples/documentation_examples/examples.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2905,6 +2905,10 @@ func StableAPIDeprecationErrorsExample() {
29052905
// StableAPIStrictCountExample is an example of using CountDocuments instead of a traditional count
29062906
// with a strict stable API since the count command does not belong to API version 1.
29072907
func StableAPIStrictCountExample(t *testing.T) {
2908+
// TODO(GODRIVER-2482): The "count" command is now part of Stable API v1 in MongoDB v5.0.x and
2909+
// TODO v6.x, so this example no longer works correctly in any CI tested server version. Rewrite
2910+
// TODO this example with a command that is not part of Stable API v1. For now, this example
2911+
// TODO test is always skipped.
29082912
uri := mtest.ClusterURI()
29092913

29102914
serverAPIOptions := options.ServerAPI(options.ServerAPIVersion1).SetStrict(true)

examples/documentation_examples/examples_test.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,12 @@ func TestDocumentationExamples(t *testing.T) {
9292
mt := mtest.New(t)
9393
defer mt.Close()
9494

95-
// Because it uses RunCommand with an apiVersion, the strict count example can only be
96-
// run on 5.0+ without auth. It also cannot be run on 6.0+ since the count command was
97-
// added to API version 1 and no longer results in an error when strict is enabled.
98-
mtOpts := mtest.NewOptions().MinServerVersion("5.0").MaxServerVersion("5.3")
95+
// Stable API is supported in 5.0+
96+
mtOpts := mtest.NewOptions().MinServerVersion("5.0")
9997
mt.RunOpts("StableAPIStrictCountExample", mtOpts, func(mt *mtest.T) {
98+
// TODO(GODRIVER-2482): Unskip when this test is rewritten to work with Stable API v1.
99+
mt.Skip(`skipping because "count" is now part of Stable API v1; see GODRIVER-2482`)
100+
100101
documentation_examples.StableAPIStrictCountExample(mt.T)
101102
})
102103

0 commit comments

Comments
 (0)