Skip to content

Commit 6e0334f

Browse files
authored
Run all appropriate tests against serverless (#950)
GODRIVER-2421 GODRIVER-2396
1 parent a80ae1d commit 6e0334f

9 files changed

+30
-19
lines changed

Makefile

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -189,23 +189,25 @@ evg-test-kmip:
189189

190190
.PHONY: evg-test-serverless
191191
evg-test-serverless:
192+
# Serverless should be tested with all unified tests as well as tests in the following components: CRUD, load balancer,
193+
# retryable reads, retryable writes, sessions, transactions and cursor behavior.
192194
go test $(BUILD_TAGS) ./mongo/integration -run TestCrudSpec -v -timeout $(TEST_TIMEOUT)s >> test.suite
193-
go test $(BUILD_TAGS) ./mongo/integration -run TestRetryableWritesSpec -v -timeout $(TEST_TIMEOUT)s >> test.suite
194-
go test $(BUILD_TAGS) ./mongo/integration -run TestUnifiedSpecs/retryable-reads -v -timeout $(TEST_TIMEOUT)s >> test.suite
195-
go test $(BUILD_TAGS) ./mongo/integration -run TestUnifiedSpecs/sessions -v -timeout $(TEST_TIMEOUT)s >> test.suite
196-
go test $(BUILD_TAGS) ./mongo/integration/unified -run TestUnifiedSpec/crud/unified -v -timeout $(TEST_TIMEOUT)s >> test.suite
197-
go test $(BUILD_TAGS) ./mongo/integration/unified -run TestUnifiedSpec/transactions/unified -v -timeout $(TEST_TIMEOUT)s >> test.suite
198-
go test $(BUILD_TAGS) ./mongo/integration/unified -run TestUnifiedSpec/versioned-api -v -timeout $(TEST_TIMEOUT)s >> test.suite
199-
go test $(BUILD_TAGS) ./mongo/integration -run TestUnifiedSpecs/transactions/legacy -v -timeout $(TEST_TIMEOUT)s >> test.suite
200195
go test $(BUILD_TAGS) ./mongo/integration -run TestWriteErrorsWithLabels -v -timeout $(TEST_TIMEOUT)s >> test.suite
201196
go test $(BUILD_TAGS) ./mongo/integration -run TestWriteErrorsDetails -v -timeout $(TEST_TIMEOUT)s >> test.suite
202197
go test $(BUILD_TAGS) ./mongo/integration -run TestHintErrors -v -timeout $(TEST_TIMEOUT)s >> test.suite
203-
go test $(BUILD_TAGS) ./mongo/integration -run TestAggregatePrimaryPreferredReadPreference -v -timeout $(TEST_TIMEOUT)s >> test.suite
204198
go test $(BUILD_TAGS) ./mongo/integration -run TestWriteConcernError -v -timeout $(TEST_TIMEOUT)s >> test.suite
205199
go test $(BUILD_TAGS) ./mongo/integration -run TestErrorsCodeNamePropagated -v -timeout $(TEST_TIMEOUT)s >> test.suite
200+
go test $(BUILD_TAGS) ./mongo/integration -run TestLoadBalancerSupport -v -timeout $(TEST_TIMEOUT)s >> test.suite
201+
go test $(BUILD_TAGS) ./mongo/integration -run TestUnifiedSpecs/retryable-reads -v -timeout $(TEST_TIMEOUT)s >> test.suite
202+
go test $(BUILD_TAGS) ./mongo/integration -run TestRetryableReadsProse -v -timeout $(TEST_TIMEOUT)s >> test.suite
203+
go test $(BUILD_TAGS) ./mongo/integration -run TestRetryableWritesSpec -v -timeout $(TEST_TIMEOUT)s >> test.suite
206204
go test $(BUILD_TAGS) ./mongo/integration -run TestRetryableWritesProse -v -timeout $(TEST_TIMEOUT)s >> test.suite
205+
go test $(BUILD_TAGS) ./mongo/integration -run TestUnifiedSpecs/sessions -v -timeout $(TEST_TIMEOUT)s >> test.suite
206+
go test $(BUILD_TAGS) ./mongo/integration -run TestSessionsProse -v -timeout $(TEST_TIMEOUT)s >> test.suite
207+
go test $(BUILD_TAGS) ./mongo/integration -run TestUnifiedSpecs/transactions/legacy -v -timeout $(TEST_TIMEOUT)s >> test.suite
208+
go test $(BUILD_TAGS) ./mongo/integration -run TestConvenientTransactions -v -timeout $(TEST_TIMEOUT)s >> test.suite
207209
go test $(BUILD_TAGS) ./mongo/integration -run TestCursor -v -timeout $(TEST_TIMEOUT)s >> test.suite
208-
go test $(BUILD_TAGS) ./mongo/integration/unified -run TestUnifiedSpec/load-balancers -v -timeout $(TEST_TIMEOUT)s >> test.suite
210+
go test $(BUILD_TAGS) ./mongo/integration/unified -run TestUnifiedSpec -v -timeout $(TEST_TIMEOUT)s >> test.suite
209211

210212
# benchmark specific targets and support
211213
perf:driver-test-data.tar.gz

data/collection-management/README.rst

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,4 @@ Collection Management Tests
33
===========================
44

55
This directory contains tests for collection management. They are implemented
6-
in the `Unified Test Format <../../unified-test-format/unified-test-format.rst>`__
7-
and require schema version 1.0.
8-
6+
in the `Unified Test Format <../../unified-test-format/unified-test-format.rst>`__.

data/collection-management/createCollection-pre_and_post_images.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
{
22
"description": "createCollection-pre_and_post_images",
3-
"schemaVersion": "1.0",
3+
"schemaVersion": "1.4",
44
"runOnRequirements": [
55
{
6-
"minServerVersion": "6.0"
6+
"minServerVersion": "6.0",
7+
"serverless": "forbid"
78
}
89
],
910
"createEntities": [

data/collection-management/createCollection-pre_and_post_images.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
description: "createCollection-pre_and_post_images"
22

3-
schemaVersion: "1.0"
3+
schemaVersion: "1.4"
44

55
runOnRequirements:
66
- minServerVersion: "6.0"
7+
serverless: forbid
78

89
createEntities:
910
- client:

data/collection-management/modifyCollection-pre_and_post_images.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
{
22
"description": "modifyCollection-pre_and_post_images",
3-
"schemaVersion": "1.0",
3+
"schemaVersion": "1.4",
44
"runOnRequirements": [
55
{
6-
"minServerVersion": "6.0"
6+
"minServerVersion": "6.0",
7+
"serverless": "forbid"
78
}
89
],
910
"createEntities": [

data/collection-management/modifyCollection-pre_and_post_images.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
description: "modifyCollection-pre_and_post_images"
22

3-
schemaVersion: "1.0"
3+
schemaVersion: "1.4"
44

55
runOnRequirements:
66
- minServerVersion: "6.0"
7+
serverless: forbid
78

89
createEntities:
910
- client:

data/unified-test-format/valid-pass/initialCollectionData-collectionOptions.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@
4343
"description": "collection is created with the correct options",
4444
"runOnRequirements": [
4545
{
46-
"minServerVersion": "3.6"
46+
"minServerVersion": "3.6",
47+
"serverless": "forbid"
4748
}
4849
],
4950
"operations": [

data/unified-test-format/valid-pass/initialCollectionData-collectionOptions.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ tests:
2727
- description: collection is created with the correct options
2828
runOnRequirements:
2929
- minServerVersion: "3.6"
30+
# Capped collections cannot be created on serverless instances.
31+
serverless: forbid
3032
operations:
3133
# Execute a collStats command to ensure the collection was created with the correct options.
3234
- name: runCommand

mongo/integration/retryable_reads_prose_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ func TestRetryableReadsProse(t *testing.T) {
3636
defer mt.Close()
3737

3838
mt.Run("PoolClearedError retryability", func(mt *mtest.T) {
39+
if mtest.ClusterTopologyKind() == mtest.LoadBalanced {
40+
mt.Skip("skipping as load balanced topology has different pool clearing behavior")
41+
}
42+
3943
// Insert a document to test collection.
4044
_, err := mt.Coll.InsertOne(context.Background(), bson.D{{"x", 1}})
4145
assert.Nil(mt, err, "InsertOne error: %v", err)

0 commit comments

Comments
 (0)