-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Quiet mongoimport noise during tests #522
Conversation
processes = [ | ||
subprocess.Popen([ | ||
'mongoimport', '-d', dbname, '-c', | ||
collection_prefix + collection, '--jsonArray', | ||
'--file', | ||
SplitModuleTest.COMMON_ROOT + '/test/data/splitmongo_json/' + collection + '.json' | ||
]) | ||
], | ||
stderr=devnull, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps stifle only stdout and not stderr? It would be misleading if the external proc failed silently.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know what mongoimport does on failure, if anything goes to stderr. The best option would be to use .communicate() instead of .wait(), and to show the failing output if the subprocess fails.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
idk what communicate does and whether I needed the wait to ensure the tests don't begin w/o the db being init'd, but if you feel confident, I'd believe you, and I agree w/ the sentiment that it'd be better to show whatever error emerges.
OK, I changed it to .communicate(). Try it if you like. |
…ests Quiet mongoimport noise during tests
XBlock-utils hash update
* stv/pin/scipy: Pin requirements for scipy/numpy
Co-authored-by: Renovate Bot <bot@renovateapp.com>
Mongoimport writes messages to stdout and we don't want to see those during tests. Please keep the tests quiet!
@dmitchell review?