fix: make sure TF tests run properly
This commit is contained in:
parent
8480748023
commit
c3822eafe5
@ -202,6 +202,14 @@ export const runTerraformApply = async <TVars extends TerraformVariables>(
|
|||||||
...process.env,
|
...process.env,
|
||||||
...(customEnv ?? {}),
|
...(customEnv ?? {}),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// This is a fix for when you try to run the tests from a Coder workspace.
|
||||||
|
// When process.env is destructured into the object, it can sometimes have
|
||||||
|
// workspace-specific values, which causes the resulting URL to be different
|
||||||
|
// from what the tests have classically expected.
|
||||||
|
childEnv.CODER_AGENT_URL = undefined;
|
||||||
|
childEnv.CODER_WORKSPACE_NAME = undefined;
|
||||||
|
|
||||||
for (const [key, value] of Object.entries(vars) as [string, JsonValue][]) {
|
for (const [key, value] of Object.entries(vars) as [string, JsonValue][]) {
|
||||||
if (value !== null) {
|
if (value !== null) {
|
||||||
childEnv[`TF_VAR_${key}`] = String(value);
|
childEnv[`TF_VAR_${key}`] = String(value);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user