We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8480748 commit c3822eaCopy full SHA for c3822ea
test/test.ts
@@ -202,6 +202,14 @@ export const runTerraformApply = async <TVars extends TerraformVariables>(
202
...process.env,
203
...(customEnv ?? {}),
204
};
205
+
206
+ // This is a fix for when you try to run the tests from a Coder workspace.
207
+ // When process.env is destructured into the object, it can sometimes have
208
+ // workspace-specific values, which causes the resulting URL to be different
209
+ // from what the tests have classically expected.
210
+ childEnv.CODER_AGENT_URL = undefined;
211
+ childEnv.CODER_WORKSPACE_NAME = undefined;
212
213
for (const [key, value] of Object.entries(vars) as [string, JsonValue][]) {
214
if (value !== null) {
215
childEnv[`TF_VAR_${key}`] = String(value);
0 commit comments