Skip to content

chore: enable terraform provisioners in e2e by default #13134

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

Merged
merged 24 commits into from
May 8, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update import order
  • Loading branch information
Emyrk committed May 3, 2024
commit f4d7c0d11e680909a2ac9057628607b445e3f8a3
27 changes: 14 additions & 13 deletions site/e2e/playwright.config.ts
Original file line number Diff line number Diff line change
@@ -1,39 +1,40 @@
import { defineConfig } from "@playwright/test";
import { execSync } from "child_process";
import * as path from "path";
import {
coderMain,
coderPort,
coderdPProfPort,
e2eFakeExperiment1,
e2eFakeExperiment2,
gitAuth, requireTerraformTests,
gitAuth,
requireTerraformTests,
} from "./constants";
import {execSync} from "child_process";
import {requiresTerraform} from "./helpers";

export const wsEndpoint = process.env.CODER_E2E_WS_ENDPOINT;

// This is where auth cookies are stored!
export const storageState = path.join(__dirname, ".auth.json");

if(requireTerraformTests) {
if (requireTerraformTests) {
try {
// If running terraform tests, verify the requirements exist in the
// environment.
//
// These execs will throw an error if the status code is non-zero.
// So if both these work, then we can launch terraform provisioners.
const terraformExec = execSync('terraform --version')
const dockerExec = execSync('docker --version')
} catch(e) {
throw new Error("Terraform provisioners require docker & terraform. " +
"At least one of these is not present in the runtime environment. To check yourself:\n" +
"\t$ terraform --version\n"+
"\t$ docker --version")
execSync("terraform --version");
execSync("docker --version");
} catch (e) {
throw new Error(
"Terraform provisioners require docker & terraform. " +
"At least one of these is not present in the runtime environment. To check yourself:\n" +
"\t$ terraform --version\n" +
"\t$ docker --version",
);
}
}


const localURL = (port: number, path: string): string => {
return `http://localhost:${port}${path}`;
};
Expand Down Expand Up @@ -80,7 +81,7 @@ export default defineConfig({
"--dangerous-disable-rate-limits",
"--provisioner-daemons 10",
// TODO: Enable some terraform provisioners
`--provisioner-types=echo${requireTerraformTests ? ",terraform": ""}`,
`--provisioner-types=echo${requireTerraformTests ? ",terraform" : ""}`,
`--provisioner-daemons=10`,
"--web-terminal-renderer=dom",
"--pprof-enable",
Expand Down
Loading