[RFE] Add a option to disable external connections in unit tests

15 views
Skip to first unread message

jar...@redhat.com

unread,
Jan 30, 2018, 4:58:20 PM1/30/18
to mongodb-user
Dear mongodb ruby driver developers

I have a request for enhancement for mongo-ruby-driver. https://github.com/mongodb/mongo-ruby-driver

I am seeing that since the latest version 2.5.0, some unit tests are connecting to external internet "testN.test.build.10gen.cc".

$ git clone https://github.com/mongodb/mongo-ruby-driver.git

$ cd mongo-ruby-driver

$ grep -r test.build.10gen.cc * | wc -l
48

Is it possible to add option to disable these unit test cases with environment variable?
We can see the logic with environment variables in spec/spec_helper.

if ENV[''DISABLED_NET']
  do something.
end

or mock the external connection by such as "webmock" library?

The reason is

I am working for the RPM package in Fedora Linux (RPM base Linux) Project.
I have to run the unit tests in no external internet environment.
https://src.fedoraproject.org/rpms/rubygem-mongo

Thank you.

Jun

Emily Stolfo

unread,
Jan 31, 2018, 4:13:16 AM1/31/18
to mongod...@googlegroups.com
Hi Jun

How are you running the specs? Have you explored using the "--exclude-pattern" flag with "rspec" to exclude the file(s) including tests making external connections?
If that doesn't work for you, let me know and I'll try to find another solution.

Thanks
Emily 

--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
 
For other MongoDB technical support options, see: https://docs.mongodb.com/manual/support/
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+unsubscribe@googlegroups.com.
To post to this group, send email to mongod...@googlegroups.com.
Visit this group at https://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/610dcaba-1b3f-49a0-876e-252b2a326e7b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages