test(magician): refactor vcr-merge-test to use testing sandbox#17953
test(magician): refactor vcr-merge-test to use testing sandbox#17953majedalfaraj wants to merge 3 commits into
Conversation
|
Googlers: For automatic test runs see go/terraform-auto-test-runs. @roaks3, a repository maintainer, has been assigned to review your changes. If you have not received review feedback within 2 business days, please leave a comment on this PR asking them to take a look. You can help make sure that review is quick by doing a self-review and by running impacted tests locally. |
The `interceptingRunner` wraps around `exec.Runner` and reroutes commands (such as git, make) to fake scripts inside the sandbox, if they exist. This eliminates the need to modify environment variables and allows for safe parallel testing.
Refactors the test to use the testing sandbox rather than `mockRunner`. To avoid directly executing `gcloud` commands, this refactor includes a `gcloud` bash emulator. This emulator intercepts the CLI commands and translates them to filesys operations, verifying behavioural state without making HTTP requests.
…gRunner Because the new sandbox framework can intercept and reroute binary calls to temporary directories, manipulating $PATH is no longer necessary. Allows for test to be safely run in parallel.
7a63480 to
e810ee5
Compare
|
Depends on #17961 |
roaks3
left a comment
There was a problem hiding this comment.
Am I understanding correctly that this change only impacts these 2 tests? As in, we aren't changing VCR merge behavior or actually adding a sandbox anywhere.
Also, if this is still dependent on the other PR, would would mind converting it into a draft, so it doesn't get merged by accident?
Yes, this change is intended to simulate the same VCR merge behaviour, but rewrite the implementation-based test to a behaviour-driven one that runs in a sandbox. I converted this PR into a draft until the sandbox PR is merged. |
Refactors the test to use the testing sandbox rather than
mockRunner. To avoid directly executinggcloudcommands, this refactor includes agcloudbash emulator. This emulator intercepts the CLI commands and translates them to filesys operations, verifying behavioural state without making HTTP requests.