From dfa3f9f915ad6114d1eb6929ec36496c7e60802b Mon Sep 17 00:00:00 2001 From: Jeremy Prevost Date: Tue, 9 Jul 2024 16:27:49 -0400 Subject: [PATCH 1/2] Updates all AWS gems and skips some assertions and tests Our tests have some syntax errors in some of the mocks. We will fix them, but for now we are skipping failures and pushing the updated gems to allow us to read the production SQS queues which is not currently possible due to a change introduced somewhere in SQS or the associated gems. --- Gemfile | 6 +-- Gemfile.lock | 52 +++++++++---------- .../dspace_publication_results_job_test.rb | 27 +++++----- 3 files changed, 44 insertions(+), 41 deletions(-) diff --git a/Gemfile b/Gemfile index 1ccb90f1..0e84157b 100644 --- a/Gemfile +++ b/Gemfile @@ -7,9 +7,9 @@ git_source(:github) do |repo_name| end gem 'administrate', '~> 0.19.0' -gem 'aws-sdk-rails', '~> 3.8.0' -gem 'aws-sdk-s3', '~> 1.146.1' -gem 'aws-sdk-sqs', '~> 1.62.0' +gem 'aws-sdk-rails' +gem 'aws-sdk-s3' +gem 'aws-sdk-sqs' gem 'bootsnap' gem 'cancancan' gem 'cocoon' diff --git a/Gemfile.lock b/Gemfile.lock index 4b26aae5..8affc13f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -91,41 +91,41 @@ GEM ansi (1.5.0) ast (2.4.2) aws-eventstream (1.3.0) - aws-partitions (1.948.0) + aws-partitions (1.953.0) aws-record (2.13.0) aws-sdk-dynamodb (~> 1, >= 1.85.0) - aws-sdk-core (3.199.0) + aws-sdk-core (3.201.1) aws-eventstream (~> 1, >= 1.3.0) aws-partitions (~> 1, >= 1.651.0) aws-sigv4 (~> 1.8) jmespath (~> 1, >= 1.6.1) - aws-sdk-dynamodb (1.115.0) - aws-sdk-core (~> 3, >= 3.199.0) - aws-sigv4 (~> 1.1) - aws-sdk-kms (1.87.0) - aws-sdk-core (~> 3, >= 3.199.0) - aws-sigv4 (~> 1.1) - aws-sdk-rails (3.8.0) + aws-sdk-dynamodb (1.116.0) + aws-sdk-core (~> 3, >= 3.201.0) + aws-sigv4 (~> 1.5) + aws-sdk-kms (1.88.0) + aws-sdk-core (~> 3, >= 3.201.0) + aws-sigv4 (~> 1.5) + aws-sdk-rails (3.13.0) aws-record (~> 2) aws-sdk-ses (~> 1, >= 1.50.0) aws-sdk-sesv2 (~> 1, >= 1.34.0) aws-sdk-sqs (~> 1, >= 1.56.0) aws-sessionstore-dynamodb (~> 2) - concurrent-ruby (~> 1) + concurrent-ruby (>= 1.3.1) railties (>= 5.2.0) - aws-sdk-s3 (1.146.1) - aws-sdk-core (~> 3, >= 3.191.0) + aws-sdk-s3 (1.156.0) + aws-sdk-core (~> 3, >= 3.201.0) aws-sdk-kms (~> 1) - aws-sigv4 (~> 1.8) - aws-sdk-ses (1.66.0) - aws-sdk-core (~> 3, >= 3.199.0) - aws-sigv4 (~> 1.1) - aws-sdk-sesv2 (1.53.0) - aws-sdk-core (~> 3, >= 3.199.0) - aws-sigv4 (~> 1.1) - aws-sdk-sqs (1.62.0) - aws-sdk-core (~> 3, >= 3.177.0) - aws-sigv4 (~> 1.1) + aws-sigv4 (~> 1.5) + aws-sdk-ses (1.68.0) + aws-sdk-core (~> 3, >= 3.201.0) + aws-sigv4 (~> 1.5) + aws-sdk-sesv2 (1.54.0) + aws-sdk-core (~> 3, >= 3.201.0) + aws-sigv4 (~> 1.5) + aws-sdk-sqs (1.80.0) + aws-sdk-core (~> 3, >= 3.201.0) + aws-sigv4 (~> 1.5) aws-sessionstore-dynamodb (2.2.0) aws-sdk-dynamodb (~> 1, >= 1.85.0) rack (>= 2, < 4) @@ -236,7 +236,7 @@ GEM method_source (1.1.0) mini_mime (1.1.5) mini_portile2 (2.8.7) - minitest (5.24.0) + minitest (5.24.1) minitest-reporters (1.7.1) ansi builder @@ -438,9 +438,9 @@ PLATFORMS DEPENDENCIES administrate (~> 0.19.0) annotate - aws-sdk-rails (~> 3.8.0) - aws-sdk-s3 (~> 1.146.1) - aws-sdk-sqs (~> 1.62.0) + aws-sdk-rails + aws-sdk-s3 + aws-sdk-sqs bootsnap bullet byebug diff --git a/test/jobs/dspace_publication_results_job_test.rb b/test/jobs/dspace_publication_results_job_test.rb index ed735ac8..07b3daa0 100644 --- a/test/jobs/dspace_publication_results_job_test.rb +++ b/test/jobs/dspace_publication_results_job_test.rb @@ -94,7 +94,7 @@ def teardown assert_equal 'Publication error', @bad_thesis.publication_status assert_equal 'Publication error', @no_handle_thesis.publication_status assert_equal 'Publication error', @invalid_status_thesis.publication_status - assert_equal 'Publication error', @bad_checksum.publication_status + # assert_equal 'Publication error', @bad_checksum.publication_status # SQS mocks need to be updated end test 'thesis handle is updated' do @@ -106,10 +106,11 @@ def teardown @bad_checksum.reload assert_equal 'http://example.com/handle/123123123', @good_thesis.dspace_handle - assert_equal 'http://example.com/handle/123123123', @bad_checksum.dspace_handle + # assert_equal 'http://example.com/handle/123123123', @bad_checksum.dspace_handle # SQS mocks need to be updated end test 'results hash is populated' do + skip('SQS mocks need to be updated') results = DspacePublicationResultsJob.perform_now # 6 total results confirms that the non-ETD message was skipped @@ -167,18 +168,19 @@ def teardown assert_includes results[:errors], "Couldn't find Thesis with 'id'=9999999999999" # bad checksum - assert_includes results[:errors], 'Thesis 532738922 with handle http://example.com/handle/123123123 was published'\ - ' with non matching checksums. ETD checksums'\ - ' ["2800ec8c99c60f5b15520beac9939a46"] dspace checksums ["borkedchecksum"]. This'\ - ' requires immediate attention to either manually replace the problem file in'\ - ' DSpace or delete the entire thesis from DSpace to ensure that nobody is able'\ - ' to download the broken file.' + # SQS mocks need to be updated + # assert_includes results[:errors], 'Thesis 532738922 with handle http://example.com/handle/123123123 was published ' \ + # 'with non matching checksums. ETD checksums ' \ + # '["2800ec8c99c60f5b15520beac9939a46"] dspace checksums ["borkedchecksum"]. This ' \ + # 'requires immediate attention to either manually replace the problem file in ' \ + # 'DSpace or delete the entire thesis from DSpace to ensure that nobody is able ' \ + # 'to download the broken file.' # no local files to checksum - assert_includes results[:errors], 'Thesis 980190962 updated to status Publication error due to inability to'\ - ' 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.' + assert_includes results[:errors], 'Thesis 980190962 updated to status Publication error due to inability to ' \ + '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.' end test 'enqueues preservation submission prep job' do @@ -203,6 +205,7 @@ def teardown # The requirements are less strict than for preservation because any published thesis should be exported as MARC, even # if it's not valid by preservation standards. test 'only published theses are exported as MARC' do + skip('SQS mocks need to be updated') results = DspacePublicationResultsJob.perform_now assert_equal 3, results[:marc_exports].count end From b1c46b583e25ac2dc0a586358da658fac52679e6 Mon Sep 17 00:00:00 2001 From: jazairi <16103405+jazairi@users.noreply.github.com> Date: Tue, 9 Jul 2024 17:00:06 -0400 Subject: [PATCH 2/2] Unskip publication results job tests and make message IDs unique All failing tests in the DspacePublicationResultsJob test are related to the stubbed message that involves a bad checksum. On further investigation, this message has the same `message_id` as another message. [The SQS API docs](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_Message.html) specify that the `MessageId` property must be unique. It's possible that this was always the case, but it was only enforced in more recent versions of `aws-sdk-sqs`, which would explain why these tests only started erroring when we tried to upgrade the gem. --- db/test.sqlite3-shm | Bin 32768 -> 32768 bytes db/test.sqlite3-wal | Bin 259592 -> 259592 bytes .../dspace_publication_results_job_test.rb | 21 ++++++++---------- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/db/test.sqlite3-shm b/db/test.sqlite3-shm index ddc8ac043fcf00873d9e261f3060d7a58b379f69..7231bfc1a3b7bf39113878f8ef24ded67b78cf40 100644 GIT binary patch delta 64 vcmZo@U}|V!njj(ZVAX1qhMr9#kJ?^m+SrQ*Pb%Wgn^5Kwhev8-!h(7Ld2buH delta 64 vcmZo@U}|V!njj%Dk+pL1v<$33>Kb9!<5$CCvMw2^kWqR0&Z<$!qeMye5-}P&#IUs#~du z+(XezOPhJcI86|Z`Qgm9@x-Mu$+>^gHM-ShX&_xZk+-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^i?{etQxBkWCV6HkOzJW)s9E?q&rx&ATaJ|1tVA-DXh%TFt;CoFQa5BVI# z--5u_T8cXkv-|vbh2&qp+&IW6dVG+Y`aL-v*VVx5WDn}u_v9E46ldY;fV09oxH?Qo z_SNyL+g-95#mPrV{(F}HB?(uLkW)Q!b^cKgpB>$fk&|&p1g8`1XDWDrCsC7*lX19% zF#&Bjj(y62cadJyyC?9M12_uBQX-OE?3t@4@h>FI9KlJYJ5_p$RC+WlxRrFLI-SO! zEi?Aw)8r`JVZF{^R{=Qr#ZcSM@Sij8Ru!{fjH|~l0ysPHLnFak=!H0?=eET6-|YP* z)mTqHz@0X8^BD4P{3GoCf0Ni-S6%~|hwGs459D}U9i|9Y|3Kp2aOi|{WRwr?XyE?M z|MHNV?eYH)MBWboV8ke}GO(-4;|Jo@8>AXH*-U9&xPjbI)|$O*gtxbRwBGkW;4lS# z*&tE@g8r4Eh#2trmb59HYj>;%zJn(SD=MTs({{@$5MNj|$ diff --git a/test/jobs/dspace_publication_results_job_test.rb b/test/jobs/dspace_publication_results_job_test.rb index 07b3daa0..9a700add 100644 --- a/test/jobs/dspace_publication_results_job_test.rb +++ b/test/jobs/dspace_publication_results_job_test.rb @@ -26,7 +26,7 @@ def setup 'SubmissionSource' => { string_value: 'ETD', data_type: 'String' } } }, # success but thesis no longer has files locally - { message_id: 'id1a', receipt_handle: 'handle1a', + { message_id: 'id1b', receipt_handle: 'handle1a', body: '{"ResultType": "success", "ItemHandle": "http://example.com/handle/123123123", "lastModified": "Thu Sep 09 17: 56: 39 UTC 2021", "Bitstreams": [{ "BitstreamName": "a_pdf.pdf", "BitstreamUUID": "fakeuuidshhhhh", "BitstreamChecksum": { "value": "2800ec8c99c60f5b15520beac9939a46", "checkSumAlgorithm": "MD5"}}]}', message_attributes: { 'PackageID' => { string_value: "etd_#{@valid_with_no_local_files.id}", data_type: 'String' }, 'SubmissionSource' => { string_value: 'ETD', data_type: 'String' } } }, @@ -94,7 +94,7 @@ def teardown assert_equal 'Publication error', @bad_thesis.publication_status assert_equal 'Publication error', @no_handle_thesis.publication_status assert_equal 'Publication error', @invalid_status_thesis.publication_status - # assert_equal 'Publication error', @bad_checksum.publication_status # SQS mocks need to be updated + assert_equal 'Publication error', @bad_checksum.publication_status end test 'thesis handle is updated' do @@ -106,11 +106,10 @@ def teardown @bad_checksum.reload assert_equal 'http://example.com/handle/123123123', @good_thesis.dspace_handle - # assert_equal 'http://example.com/handle/123123123', @bad_checksum.dspace_handle # SQS mocks need to be updated + assert_equal 'http://example.com/handle/123123123', @bad_checksum.dspace_handle end test 'results hash is populated' do - skip('SQS mocks need to be updated') results = DspacePublicationResultsJob.perform_now # 6 total results confirms that the non-ETD message was skipped @@ -168,13 +167,12 @@ def teardown assert_includes results[:errors], "Couldn't find Thesis with 'id'=9999999999999" # bad checksum - # SQS mocks need to be updated - # assert_includes results[:errors], 'Thesis 532738922 with handle http://example.com/handle/123123123 was published ' \ - # 'with non matching checksums. ETD checksums ' \ - # '["2800ec8c99c60f5b15520beac9939a46"] dspace checksums ["borkedchecksum"]. This ' \ - # 'requires immediate attention to either manually replace the problem file in ' \ - # 'DSpace or delete the entire thesis from DSpace to ensure that nobody is able ' \ - # 'to download the broken file.' + assert_includes results[:errors], 'Thesis 532738922 with handle http://example.com/handle/123123123 was published ' \ + 'with non matching checksums. ETD checksums ' \ + '["2800ec8c99c60f5b15520beac9939a46"] dspace checksums ["borkedchecksum"]. This ' \ + 'requires immediate attention to either manually replace the problem file in ' \ + 'DSpace or delete the entire thesis from DSpace to ensure that nobody is able ' \ + 'to download the broken file.' # no local files to checksum assert_includes results[:errors], 'Thesis 980190962 updated to status Publication error due to inability to ' \ @@ -205,7 +203,6 @@ def teardown # The requirements are less strict than for preservation because any published thesis should be exported as MARC, even # if it's not valid by preservation standards. test 'only published theses are exported as MARC' do - skip('SQS mocks need to be updated') results = DspacePublicationResultsJob.perform_now assert_equal 3, results[:marc_exports].count end