-
Notifications
You must be signed in to change notification settings - Fork 4
Improve publication logging #1503
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -179,6 +179,34 @@ def teardown | |
| 'validate checksums as no local files were attached to the record. This ' \ | ||
| 'requires staff to manually check the ETD record and DSpace record and take ' \ | ||
| 'appropriate action.' | ||
|
|
||
|
Member
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. This entire test, not just the new assertions, is very confusing. It looks like we have stubbed an entire run and in this test are checking all the possible error states that the stubs have provided us. If that's the case, since you didn't update any stubs are these new assertions testing things that were already there or are they testing the new formatting you put in place?
Contributor
Author
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. Good question! Previously, this stub would produce an empty/nil error message because we were only reading DSpaceResponse. So yes, the new assertions are testing new behavior, but it's really hard to discern that in the current test state. Let me know if the change I just pushed helps clarify the intended test behavior. |
||
| end | ||
|
|
||
| test 'DSS error fields are surfaced in results errors' do | ||
| Aws.config[:sqs] = { | ||
| stub_responses: { | ||
| receive_message: [ | ||
| { | ||
| messages: [ | ||
| { message_id: 'id1', receipt_handle: 'handle1', | ||
| body: '{"ResultType": "error", "ErrorInfo": "Stuff broke", "DSpaceResponse": "N/A", "ExceptionMessage": "500 Server Error: Internal Server Error", "ExceptionTraceback": "Traceback (most recent call last):\nFile submission.py, line 84, in submit\nrequests.exceptions.HTTPError: 500 Server Error"}', | ||
| message_attributes: { 'PackageID' => { string_value: "etd_#{@bad_thesis.id}", data_type: 'String' }, | ||
| 'SubmissionSource' => { string_value: 'ETD', data_type: 'String' } } } | ||
| ] | ||
| }, | ||
| { messages: [] } | ||
| ] | ||
| } | ||
| } | ||
|
|
||
| results = DspacePublicationResultsJob.perform_now | ||
|
|
||
| dss_error = results[:errors].find { |e| e.include?('ErrorInfo:') } | ||
| assert_not_nil dss_error, 'Expected DSS error details to be surfaced in results[:errors]' | ||
| assert_includes dss_error, 'ErrorInfo: Stuff broke' | ||
| assert_includes dss_error, 'DSpaceResponse: N/A' | ||
| assert_includes dss_error, 'ExceptionMessage: 500 Server Error: Internal Server Error' | ||
| assert_includes dss_error, 'ExceptionTraceback: Traceback (most recent call last):' | ||
| end | ||
|
|
||
| test 'enqueues preservation submission prep job' do | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.