Skip to content
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

Merged
merged 1 commit into from
Jul 31, 2013

Conversation

nedbat
Copy link
Contributor

@nedbat nedbat commented Jul 30, 2013

Mongoimport writes messages to stdout and we don't want to see those during tests. Please keep the tests quiet!

@dmitchell review?

processes = [
subprocess.Popen([
'mongoimport', '-d', dbname, '-c',
collection_prefix + collection, '--jsonArray',
'--file',
SplitModuleTest.COMMON_ROOT + '/test/data/splitmongo_json/' + collection + '.json'
])
],
stderr=devnull,
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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.

@nedbat
Copy link
Contributor Author

nedbat commented Jul 30, 2013

OK, I changed it to .communicate(). Try it if you like.

nedbat added a commit that referenced this pull request Jul 31, 2013
…ests

Quiet mongoimport noise during tests
@nedbat nedbat merged commit 15859dd into master Jul 31, 2013
@nedbat nedbat deleted the ned/quiet-mongoimport-noise-during-tests branch July 31, 2013 14:26
e-kolpakov referenced this pull request in open-craft/edx-platform Sep 17, 2015
diegomillan pushed a commit to eduNEXT/edx-platform that referenced this pull request Sep 27, 2016
* stv/pin/scipy:
  Pin requirements for scipy/numpy
Sujeet1379 pushed a commit to chandrudev/edx-platform that referenced this pull request Nov 17, 2022
Co-authored-by: Renovate Bot <bot@renovateapp.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants