-
Notifications
You must be signed in to change notification settings - Fork 392
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
Fix flaky test issue with export tests #2080
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ |
363df71
to
86eae10
Compare
const resourceJSON = dataRes.text.trim().split('\n'); | ||
expect(resourceJSON).toHaveLength(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.
we are noticing duplicate resources being created in export tests, so proactively removing the assertion on number of observation results.
86eae10
to
c853a08
Compare
6b554b2
to
e618bb9
Compare
e618bb9
to
60b47d4
Compare
bc59b28
to
770cfcc
Compare
770cfcc
to
7843b3d
Compare
@@ -99,211 +99,6 @@ describe('System export', () => { | |||
expect(JSON.parse(resourceJSON[0])?.subject?.reference).toEqual(`Patient/${res1.body.id}`); | |||
}); | |||
|
|||
test('Parameters', async () => { |
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.
These tests using _since
parameter is redundant and doesn't provide additional test coverage.
since
parameter is also tested in
test('Since filter', async () => { |
Kudos, SonarCloud Quality Gate passed! |
expect(JSON.parse(resourceJSON[0])?.code?.text).toEqual('test2'); | ||
}); | ||
|
||
test('Multiple Resources by Resource Type', async () => { |
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 test coverage is redundant, there was a later test below that provided the same coverage. Deleting the test since it was also flaky before #2022 . https://github.com/medplum/medplum/pull/2080/files#diff-454070ab471e4a54926cd48d6d4e8e030e3158b06f16797fd9774ed037d467e9L307
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.
Oo, nice. Even better. Thanks @tonylee80 !
Address flaky export test issue, where duplicate resources are created.
https://github.com/medplum/medplum/actions/runs/5026350802/jobs/9014520800
Remove redundant flaky tests. There are other tests from
src/fhir/operations/export.test.ts
andsrc/fhir/operations/groupexport.test.ts
that provides overlapping test coverage.Test Coverage Before changes:
Test coverage after changes: