[GODRIVER-420] integration tests should detect topology from connection, not TOPOLOGY envvar Created: 22/May/18  Updated: 28/Oct/23  Resolved: 03/Sep/19

Status: Closed
Project: Go Driver
Component/s: Testing
Affects Version/s: 0.0.6
Fix Version/s: 1.2.0

Type: New Feature Priority: Major - P3
Reporter: Sam Kleinman (Inactive) Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to GODRIVER-276 Implement a testing framework Closed
Epic Link: Robust Testing Framework

 Description   

My local mongodb test environment, which the driver to run tests normally via go tests, fails the Change Stream tests, because I have a replica set running locally, but the test fixtures assume that since the TOPOLOGY envvar isn't set, that it's a standalone.

For some tests its reasonable to rely on the topology argument, but this one is awkward, as it means that my local system always fails.



 Comments   
Comment by Divjot Arora (Inactive) [ 03/Sep/19 ]

The testing framework implemented in GODRIVER-276 auto-detects the topology type for integration tests and allows specifying which topologies a test can run against.

Comment by Githook User [ 03/Sep/19 ]

Author:

{'username': 'divjotarora', 'email': 'divjot.arora@10gen.com', 'name': 'Divjot Arora'}

Message: Implement a testing framework.

  • Create the mtest framework in mongo/integration/mtest
  • Add helpers to create mock responses

GODRIVER-276
GODRIVER-420

Change-Id: I314b81e5474feda0457965a869f90989b32ec0ca
Branch: master
https://github.com/mongodb/mongo-go-driver/commit/22646d953d8106e567b1da9aab98b627a2fb204f

Comment by Kristofer Brandow (Inactive) [ 22/May/18 ]

Another reason to use command line flags and not intuit the topology is that command line flags will prevent caching of test results, which we probably don't want to cache because it means if we switch topologies that tests won't be rerun.

Comment by Kristofer Brandow (Inactive) [ 22/May/18 ]

The test that's failing here is because the TOPOLOGY envvar isn't set to the replica_set the tests think it's talking to a standalone and that getting a change stream should fail, but it doesn't, which is why the test fails.

We need a better test framework, and I would much rather have mandatory command line flags then try and have some tests intuit what type of topology they are communicating with.

Comment by Jeffrey Yemin [ 22/May/18 ]

Shouldn't the test runner skip the test rather than fail it in this scenario?

I recently implemented auto-cluster-type-detection in the Java driver's test runner, and that has been saving me a lot of time especially when working on features that require a replica set. See JAVA-2848.

Generated at Thu Feb 08 08:34:10 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.