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

DEV: Add RakeHelpers.print_message to wrap puts #9008

Closed

Conversation

martin-brennan
Copy link
Contributor

  • Rake tasks often have a heavy output to inform the person
    running it what is going on. however if we want to test the
    rake task we don't want all that output clogging up the CI
    build logs.

    RakeHelpers.print_message can be used in place of puts in rake
    tasks, and when running the spec for the task the output is
    not printed RAILS_ENABLE_TEST_LOG is switched on

* rake tasks often have a heavy output to inform the person
  running it what is going on. however if we want to test the
  rake task we don't want all that output clogging up the CI
  build logs.

  RakeHelpers.print_message can be used in place of puts in rake
  tasks, and when running the spec for the task the output is
  not printed RAILS_ENABLE_TEST_LOG is switched on
@martin-brennan
Copy link
Contributor Author

Hey @ZogStriP can you please take a look at this; my take on fixing the fly-bazooka problem here https://review.discourse.org/t/try-fix-upload-spec-flakys-and-remove-logging-from-tasks-uploads-spec/9174/2?u=martin

@SamSaffron
Copy link
Member

I am not sure about this ... you can use this pattern instead:

output = capture_stdout do
inventory.backfill_etags_and_list_missing
end

Then we don't need to remember to use special helpers.

@martin-brennan
Copy link
Contributor Author

@SamSaffron ah I totally missed that that was a thing...will close this

@eviltrout eviltrout deleted the dev/add-more-elegant-way-to-puts-output-in-rake branch July 9, 2020 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants