-
Notifications
You must be signed in to change notification settings - Fork 0
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
refactor(fakeData): KAM-331: Create fake-data package #7241
Conversation
…ub.com/beyondessential/tamanu into kam-331-create-data-generation-package
This reverts commit 477f135.
This reverts commit 410a1d5.
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.
All files in this directory are helper functions built out of the original logic in the old scripts/src/fake.ts
User, | ||
} from '@tamanu/database'; | ||
|
||
export const generateImportData = 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.
Generate one of each import data types to be used for foreign key relationships when making clinical data
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 the fence if I should have this file with all import data, or split it up amongst the other files in this directory in new functions
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 it either way or both but let's just have it all in here for now for simplicity.
noteCount = chance.integer({ min: 1, max: 5 }), | ||
diagnosisCount = chance.integer({ min: 1, max: 5 }), |
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 have done some simple randomness here but am a bit on the fence about how far I should take it
Do you think some relatively simple randomness like this is fine? Or do you think it is worth doing what we were talking about where you mentioned taking in a range or number and using that to generate the random number. Its easy enough to do but am a little worried about over-engineering 🤔
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.
Nah the way you've got it is fine. We can always make it customisable later if we feel like it.
Changes
As part of our testing project for creating a synthetic environment, we have decided to pull out the logic for populating a DB instance with data used in determinism testing into its own package
fake-data
. This will be used for both determinism testing and will be used in the future to populate the synthetic test environment + any other use case for generating fake data.fake-data
/scripts
to the new packageDeterminism testing was done and passed in a pr branched off this with dummy migration #7264
Deploys
Remember to...