[APP-345] feat: sas, scriptifying test harness for use outside of tests#3105
[APP-345] feat: sas, scriptifying test harness for use outside of tests#3105mcmcgrath13 merged 10 commits intomainfrom
Conversation
…into mcm/report-env-compare
JordanGuinn
left a comment
There was a problem hiding this comment.
One q about a potential env gate for the data scripts, but otherwise looks good to me! 🚀
There was a problem hiding this comment.
(thought, b): Are there any build parameters or env vars we can take advantage of here to ensure this and the restore_original.data.py can only ever be run in dev/pre-prod environments?
There was a problem hiding this comment.
These files (scripts or tests) aren't included in our built container, which I think is our best proxy for prod. Given a human would need to set up an env var for the connection to a prod database, then also pass an argument, it feels like it would need to be pretty intentional. And the good news is they could maybe quickly restore if they did this by accident?
I don't think there's any way to know from a DB itself if it's production or not 🤔
There was a problem hiding this comment.
Alrighty. Something to keep an eye on moving forward I'd think, should we ever expand usage of that env var, or need to incorporate any Python scripts into the build for whatever reason
| yield | ||
|
|
||
| # restore the original data | ||
| restore_original_data(conn_string, db_tables, fk_tables) |
There was a problem hiding this comment.
TIL that the therestore_original_data call after the yield indicates to pytest that it's teardown code! For a sec I was confused as to why we were inserting fake data just to immediately truncate it 😅 🤦
emyl3
left a comment
There was a problem hiding this comment.
worked as expected for me!
Description
Notes:
Tickets
Checklist before requesting a review