-
-
Notifications
You must be signed in to change notification settings - Fork 730
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
Run background reports with Sidekiq, not fork #10615
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,6 +31,21 @@ | |
end | ||
end | ||
|
||
describe "Background processing" do | ||
before do | ||
Flipper.enable(:background_reports) | ||
ActiveJob::Base.queue_adapter.perform_enqueued_jobs = true | ||
end | ||
|
||
it "can run the customers report" do | ||
login_as_admin_and_visit admin_report_path( | ||
report_type: :customers, report_subtype: :mailing_list | ||
) | ||
click_button "Go" | ||
expect(page).to have_content "EMAIL FIRST NAME" | ||
end | ||
end | ||
|
||
Comment on lines
+34
to
+48
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because we're passing report parameters and chosen format to the job, it might be worth testing that these options have been used. |
||
describe "Can access Customers reports and generate customers report" do | ||
before do | ||
login_as_admin_and_visit admin_reports_path | ||
|
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.
Just wondering why this is needed?
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.
Once the job is done, we want to render it here in the same web request. So we are waiting for the result. That's like the current behaviour. We display the report (or download) when it's ready.
It's planned to send a download link for longer running reports. Then we don't need to wait and can tell the user straight away that the report is processing. But we don't have that yet.