-
Notifications
You must be signed in to change notification settings - Fork 19
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
bug - modify_state hook should operate on a copy of state #27
Conversation
Codecov Report
@@ Coverage Diff @@
## master #27 +/- ##
==========================================
+ Coverage 92.59% 92.64% +0.04%
==========================================
Files 8 8
Lines 459 462 +3
==========================================
+ Hits 425 428 +3
Misses 34 34
Continue to review full report at Codecov.
|
4f2b1a3
to
9caba07
Compare
9caba07
to
cf5f0b8
Compare
4c183a1
to
7a39fbc
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.
lgtm, thanks
Two things are addressed in this. The first is what is passed back to the function under test. During replays that's
TerraformTestApi
and during live runs it'sTerraformState
while functionally both the same thing, we want to make sure we don't leakTerraformState
directly to the function under test asTerraformTestApi
interface will likely grow in the future.Second item, if the modify_state hook is implemented in a test run then the modified state is not only written to disk but also returned to the function under test. What should happen is the unmodified state during record / live runs is returned to the function under test and a copy is passed through the modify_state hook before writing to disk.