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

Add test cases for partially delivered submissions #16055

Merged
merged 5 commits into from
Oct 9, 2024

Conversation

thetaurean
Copy link
Collaborator

@thetaurean thetaurean commented Sep 30, 2024

This PR adds tests cases to properly cover a partially delivered submission. It also relabels 2 old tests that are actually testing in-flight submissions. The bug that this PR fixes was actually solved in prior PR(s), but it only added tests for pipeline output and not submission history.

Test Steps:

  1. Run tests

Changes

  • Added proper test cases for partially delivered submissions
  • Marked the replaced tests cases with TODO and updated their description
  • Minor update to ReportNodeBuilder.kt that got lumped in here for reasons

Checklist

Testing

  • Tested locally?
  • Ran ./prime test or ./gradlew testSmoke against local Docker ReportStream container?
  • Added tests?

Linked Issues

To Be Done

@thetaurean thetaurean added the platform Platform Team label Sep 30, 2024
@thetaurean thetaurean requested a review from a team as a code owner September 30, 2024 16:13
Copy link

github-actions bot commented Sep 30, 2024

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails

Scanned Manifest Files

Copy link

github-actions bot commented Sep 30, 2024

Test Results

1 241 tests  +2   1 237 ✅ +2   7m 42s ⏱️ -3s
  162 suites ±0       4 💤 ±0 
  162 files   ±0       0 ❌ ±0 

Results for commit dee5da9. ± Comparison against base commit 5025bf5.

This pull request removes 1 and adds 3 tests. Note that renamed tests count towards both.
gov.cdc.prime.router.history.azure.SubmissionFunctionIntegrationTests ‑ it should return a history for partially delivered submission (for legacy route step)()
gov.cdc.prime.router.history.azure.SubmissionFunctionIntegrationTests ‑ it should return a history for an in-flight submission (for legacy route step)()
gov.cdc.prime.router.history.azure.SubmissionFunctionIntegrationTests ‑ it should return a history for an in-flight submission()
gov.cdc.prime.router.history.azure.SubmissionFunctionIntegrationTests ‑ it should return a history for an partially delivered submission (for legacy route step)()

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Sep 30, 2024

Integration Test Results

 53 files  ±0   53 suites  ±0   27m 38s ⏱️ +25s
410 tests ±0  401 ✅ ±0  9 💤 ±0  0 ❌ ±0 
413 runs  ±0  404 ✅ ±0  9 💤 ±0  0 ❌ ±0 

Results for commit dee5da9. ± Comparison against base commit 5025bf5.

♻️ This comment has been updated with latest results.

@david-navapbc
Copy link
Collaborator

Archive.zip

I pulled master and merged it into a local copy of this branch and got the test error you see in the attached report.

@thetaurean
Copy link
Collaborator Author

Archive.zip

I pulled master and merged it into a local copy of this branch and got the test error you see in the attached report.

Looks like a connection refused on your local blob container. Investigating further but passing in CI so might be a local issue.

@@ -153,7 +307,7 @@ class SubmissionFunctionIntegrationTests {
val historyNode = JacksonMapperUtilities.defaultMapper.readTree(history.body.toString())
assertThat(
historyNode.get("overallStatus").asText()
).isEqualTo(DetailedSubmissionHistory.Status.PARTIALLY_DELIVERED.toString())
).isEqualTo(DetailedSubmissionHistory.Status.PARTIALLY_DELIVERED.toString()) // TODO: should be RECEIVED
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why the TODO?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Related to the todo in the function header (#16054)

@@ -95,15 +248,16 @@ class SubmissionFunctionIntegrationTests {
val historyNode = JacksonMapperUtilities.defaultMapper.readTree(history.body.toString())
assertThat(
historyNode.get("overallStatus").asText()
).isEqualTo(DetailedSubmissionHistory.Status.PARTIALLY_DELIVERED.toString())
).isEqualTo(DetailedSubmissionHistory.Status.PARTIALLY_DELIVERED.toString()) // TODO: should be RECEIVED
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why the TODO?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Related to the todo in the function header (#16054)

@@ -189,6 +208,7 @@ class ReportNodeBuilder {
}
}
lateinit var theAction: TaskAction
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are some of these lateinit and some of these are nullable vars?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point! I'm going to take a 2nd look; on first (2nd) glance they should probably both be nullable since null is a valid state in either case.

Copy link
Collaborator

@david-navapbc david-navapbc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

Copy link

sonarcloud bot commented Oct 9, 2024

@thetaurean thetaurean merged commit ffbe8be into master Oct 9, 2024
22 checks passed
@thetaurean thetaurean deleted the platform/thetaurean/15645-partially-delivered branch October 9, 2024 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform Platform Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Submission History API doesn't show Filtered reports
3 participants