grease icon indicating copy to clipboard operation
grease copied to clipboard

Extending from AutomationTest causes local testing to fail

Open chollinger opened this issue 7 years ago • 0 comments

Extending from AutomationTest causes local testing to fail

USE THIS TEMPLATE FOR YOUR ISSUE!
  • Primary Contact: Cory Hollinger

Abstract

When implementing a unit test class that extends from AutomationTest, GREASE tries to grab an instance of Mongo when AutomationTest.ioc is initialized. It does this because Mongo configurations are a valid option, but not all configurations will need Mongo and not all developers will have (or need) a Mongo instance stood up.

What needs to be done:

  • Add a check to see if Mongo exists on the machine
  • If Mongo isn't present, suppress the exception and don't try to grab configs from Mongo

Supporting Elements

File "/usr/local/lib/python3.6/site-packages/tgt_grease/core/Types/test.py", line 66, in init self.detect = Detect(self.ioc) File "/usr/local/lib/python3.6/site-packages/tgt_grease/enterprise/Model/Detection.py", line 30, in init self.ioc.ensureRegistration() File "/usr/local/lib/python3.6/site-packages/tgt_grease/core/InversionOfControl.py", line 99, in ensureRegistration 'activationTime': datetime.utcnow() File "/usr/local/lib/python3.6/site-packages/pymongo/collection.py", line 683, in insert_one session=session), File "/usr/local/lib/python3.6/site-packages/pymongo/collection.py", line 599, in _insert bypass_doc_val, session) File "/usr/local/lib/python3.6/site-packages/pymongo/collection.py", line 579, in _insert_one True, _insert_command, session) PYMONGO STACK TRACE OMITTED FOR BREVITY pymongo.errors.ServerSelectionTimeoutError: localhost:27017: [Errno 61] Connection refused

Issue Checklist

  • [ ] Maintainer has viewed
  • [ ] Loaded into Backlog
  • [ ] PR Submitted [Link Here](Eventual Link)

chollinger avatar Apr 17 '18 18:04 chollinger