CMR-11368: Databine test improvements - #2472
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2472 +/- ##
==========================================
- Coverage 57.96% 57.94% -0.02%
==========================================
Files 1074 1074
Lines 74707 74710 +3
Branches 2189 2189
==========================================
- Hits 43303 43293 -10
- Misses 29355 29369 +14
+ Partials 2049 2048 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
e012631 to
7890190
Compare
…ge write status better
…ing the other testing threads
05d57bc to
dd40499
Compare
| (group-permission-parameter-subfield-validation params) | ||
| (group-permission-permission-validation params))) | ||
| (let [gp (:group-permission params)] | ||
| (if (and (some? gp) (not (map? gp))) |
There was a problem hiding this comment.
Sometimes, a null error would show up in tests
There was a problem hiding this comment.
why would gp ever be null?
There was a problem hiding this comment.
I have lost the original error, maybe this was a cast problem, I forget now, let me see if I can figure that out
There was a problem hiding this comment.
This was an invalid cast that could come up if someone sent in data that was not expected, I think the parser was trying to turn :0 into 0 and that was causing tests to fail
| ["GUEST" "AG10000-PROV"] (concat guest-acls AG10000-acls) | ||
| ["AG12345-PROV" "AG10000-PROV"] (concat AG12345-acls AG10000-acls) | ||
| ["guest" "registered" "AG12345-PROV" "AG10000-PROV"] all-acls-no-admin)) | ||
| (u/without-publishing-messages |
There was a problem hiding this comment.
this was a suggestion to prevent expected exceptions from showing up in the logs
| (finally | ||
| ;; always re-enable writes for access control service | ||
| (u/enable-access-control-writes post-options) | ||
| (Thread/sleep 500)))) |
There was a problem hiding this comment.
Try/finally was added to ensure that the services was always put back into read/write mode so that other tests could pass. This allows other tests to continue to run and not fail incorrectly. A delay was added to ensure the other service has time to take effect.
This is one of the intermittent errors we would get.
| (finally | ||
| ;; Allways re-eneable writes for access control service, even if there was an exception | ||
| (u/enable-access-control-writes post-options) | ||
| (Thread/sleep 500)))) |
There was a problem hiding this comment.
Try/finally was added to ensure that the services was always put back into read/write mode so that other tests could pass. This allows other tests to continue to run and not fail incorrectly. A delay was added to ensure the other service has time to take effect.
This is one of the intermittent errors we would get.
| @@ -0,0 +1,192 @@ | |||
| (ns cmr.system-int-test.access-control.fixtures | |||
There was a problem hiding this comment.
nothing to see here, just moving a file into this package
There was a problem hiding this comment.
Through GIT compare, it looks like it was added rather than moved
There was a problem hiding this comment.
this file was, because git does not have a cp, the file is still needed for the other tests that use it in that package. I was able to do a git mv for the actual test files, but I left the other tests where they were.
| (has-action-permission? (url/enable-access-control-writes-url) :post admin-read-update-token) | ||
| (has-action-permission? (url/enable-email-subscription-processing) :post admin-read-update-token) | ||
| ;; Give the servers time set | ||
| (Thread/sleep 500))))) |
There was a problem hiding this comment.
Try/finally was added to ensure that the services was always put back into read/write mode so that other tests could pass. This allows other tests to continue to run and not fail incorrectly. A delay was added to ensure the other service has time to take effect.
This is one of the intermittent errors we would get.
| (use-fixtures :once (fixtures/int-test-fixtures)) | ||
|
|
||
| (deftest invalid-search-test | ||
| (deftest ^:serial invalid-search-test |
There was a problem hiding this comment.
this is the goal of moving the tests, ^:serial only works in the context of the test group it is running in, and moving it here means it is applied to a large scope.
There was a problem hiding this comment.
Did you check that this test is actually being run in the build?
There was a problem hiding this comment.
as I understand it, tests.group1.edn should run everything in this package and I think I was getting errors before when I had messed up package names and was missing fixtures.
| (use-fixtures :once (fixtures/int-test-fixtures)) | ||
|
|
||
| (deftest invalid-search-test | ||
| (deftest ^:serial invalid-search-test |
There was a problem hiding this comment.
Did you check that this test is actually being run in the build?
| @@ -0,0 +1,192 @@ | |||
| (ns cmr.system-int-test.access-control.fixtures | |||
There was a problem hiding this comment.
Through GIT compare, it looks like it was added rather than moved
| (group-permission-parameter-subfield-validation params) | ||
| (group-permission-permission-validation params))) | ||
| (let [gp (:group-permission params)] | ||
| (if (and (some? gp) (not (map? gp))) |
There was a problem hiding this comment.
why would gp ever be null?
Overview
Background
This ticket started out as a Snyk ticket, however Jackson had a lot of issues and another ticket ended up applying the needed library change. In the course of doing the work to support 2.21.5 severely intermittent test issues prevented this ticket from being properly tested in bamboo and it was decided to fix those issues.
What are the changes?
What areas of the application does this impact?
Required Checklist