-
Notifications
You must be signed in to change notification settings - Fork 39
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
Platform/13506/int tests for fhir router #14241
base: master
Are you sure you want to change the base?
Conversation
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.OpenSSF Scorecard
Scanned Manifest Files |
49a237d
to
0a7a643
Compare
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.
Nice work! This is really good stuff. Couple of high level things I think need to get added before merging:
- We should should be checking the action log details to make sure the filtering gets logged properly
- Adding a test around the observation pruning
- Adding a test where a report gets routed to multiple receivers
- The processing mode filter
} | ||
|
||
private fun createReport( | ||
fileFormat: Report.Format, |
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.
Intellij is saying that this will always be the FHIR
I would maybe drop it or you could modify one of the tests so that the HL7 is what is in the receive step
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.
does the route step ever receive an HL7 message? I thought everything got converted to FHIR by the preceding step?
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.
Why was this resolved? Comment seems unaddressed?
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.
that's on me - I thought the route step never received anything but FHIR hence I marked it as resolved. What would you like me to do here?
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.
You are correct, the route step doesn't receive anything but FHIR. I think what Michael is saying is we should resolve the IntelliJ warning somehow. One option is to not pass fileFormat
in at all. I think I'm actually okay with the way it is now because I see createReport getting abstracted into a common location where other integration tests, like translation, can use it?
nextAction: TaskAction, | ||
nextEventAction: Event.EventAction, | ||
topic: Topic, | ||
taskIndex: Long = 0, |
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.
Same here on this default, could amend one of the receive steps to have more than one item. Also, this name seems strange?
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.
happy to make whatever changes - but what name seems strange?
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.
you are passing taskIndex to ReportLineage call as reportLineageId
, I think that is confusing? Also yes, same issue is in FhirFunctionIntegrationTests. I think this was left over from my original approach.
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.
ack. will change reportLineageId
to something else
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.
I think you can just remove taskIndex param from createReport and hard code a 0 for the ReportLineage ID?
reportFile, txn, action | ||
) | ||
if (childReport != null) { | ||
ReportStreamTestDatabaseContainer.testDatabaseAccess |
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.
I'm not sure that it would impact your test, but this is not quite right since the item lineages are not getting created? It might not impact your test though in this case
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.
what do you mean the item lineages are not being created?
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.
If you look at our database tables, you'll see report_lineage and item_lineage. We are updating the report_lineage table but ignoring the item_lineage table. The FHIRRouter does not depend on the item_lineage table to perform its function, but it does update it so that means we should mock it properly so we can verify the item_lineage is correct after the step has completed.
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.
I could see this being a different ticket so we can move forward with Routing refactor. @mkalish thoughts?
every { BlobAccess getProperty "defaultBlobMetadata" } returns getBlobContainerMetadata() | ||
mockkObject(BlobAccess.BlobContainerMetadata) | ||
every { BlobAccess.BlobContainerMetadata.build(any(), any()) } returns getBlobContainerMetadata() | ||
mockkConstructor(DatabaseLookupTableAccess::class) |
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.
Maybe as a follow up, but I think in the spirit of these being integration gets I think it would great to not mock the lookup tables
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.
This needs to be addressed or ticket created and added to comment. Only then resolve the conversation.
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.
on me - I didn't take this as an action item so much as a passing thought. Do you want me to refactor the test or do you want me to write a ticket? Happy to do either. I'm ambivalent.
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.
How about let's just add a comment for now? I don't think we need a ticket, this seems low prio tech debt to me.
prime-router/src/test/kotlin/fhirengine/azure/FHIRRouterIntegrationTests.kt
Outdated
Show resolved
Hide resolved
prime-router/src/test/kotlin/fhirengine/azure/FHIRRouterIntegrationTests.kt
Show resolved
Hide resolved
prime-router/src/test/kotlin/fhirengine/azure/FHIRRouterIntegrationTests.kt
Show resolved
Hide resolved
prime-router/src/test/kotlin/fhirengine/azure/FHIRRouterIntegrationTests.kt
Show resolved
Hide resolved
04bc3b6
to
1d43fad
Compare
bc818c1
to
487a6a2
Compare
…out its nonsense...
b8c6058
to
36fda72
Compare
Quality Gate failedFailed conditions |
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.
Went through and unresolved some conversations that I wasn't sure were properly addressed.
} | ||
|
||
private fun createReport( | ||
fileFormat: Report.Format, |
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.
Why was this resolved? Comment seems unaddressed?
nextAction: TaskAction, | ||
nextEventAction: Event.EventAction, | ||
topic: Topic, | ||
taskIndex: Long = 0, |
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.
you are passing taskIndex to ReportLineage call as reportLineageId
, I think that is confusing? Also yes, same issue is in FhirFunctionIntegrationTests. I think this was left over from my original approach.
reportFile, txn, action | ||
) | ||
if (childReport != null) { | ||
ReportStreamTestDatabaseContainer.testDatabaseAccess |
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.
If you look at our database tables, you'll see report_lineage and item_lineage. We are updating the report_lineage table but ignoring the item_lineage table. The FHIRRouter does not depend on the item_lineage table to perform its function, but it does update it so that means we should mock it properly so we can verify the item_lineage is correct after the step has completed.
every { BlobAccess getProperty "defaultBlobMetadata" } returns getBlobContainerMetadata() | ||
mockkObject(BlobAccess.BlobContainerMetadata) | ||
every { BlobAccess.BlobContainerMetadata.build(any(), any()) } returns getBlobContainerMetadata() | ||
mockkConstructor(DatabaseLookupTableAccess::class) |
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.
This needs to be addressed or ticket created and added to comment. Only then resolve the conversation.
reportFile, txn, action | ||
) | ||
if (childReport != null) { | ||
ReportStreamTestDatabaseContainer.testDatabaseAccess |
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.
I could see this being a different ticket so we can move forward with Routing refactor. @mkalish thoughts?
// for receiver Y all five observations should be intact | ||
assertEquals(5, fhirBundleReceiverY.getObservations().size) | ||
val expectedCodes = listOf("94558-5", "95418-0", "95417-2", "95421-4", "95419-8") | ||
for (i in 0..fhirBundleReceiverX.getObservations().size - 1) { |
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.
Intellij doesn't like this syntax
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.
what do you mean it doesn't like this syntax? can you be more specific? everything works AFAIK
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.
This PR ...
If you are suggesting a fix for a currently exploitable issue, please disclose the issue to the prime-reportstream team directly outside of GitHub instead of filing a PR, so we may immediately patch the affected systems before a disclosure. See SECURITY.md/Reporting a Vulnerability for more information.
Test Steps:
Changes
Checklist
Testing
./prime test
or./gradlew testSmoke
against local Docker ReportStream container?npm run lint:write
?Process
Linked Issues
To Be Done
Create GitHub issues to track the work remaining, if any
Specific Security-related subjects a reviewer should pay specific attention to
If you answered 'yes' to any of the questions above, conduct a detailed Review that addresses at least: