|
1 | 1 | import { defineConfig } from "@playwright/test";
|
| 2 | +import { execSync } from "child_process"; |
2 | 3 | import * as path from "path";
|
3 | 4 | import {
|
4 | 5 | coderMain,
|
5 | 6 | coderPort,
|
6 | 7 | coderdPProfPort,
|
7 | 8 | e2eFakeExperiment1,
|
8 | 9 | e2eFakeExperiment2,
|
9 |
| - gitAuth, requireTerraformTests, |
| 10 | + gitAuth, |
| 11 | + requireTerraformTests, |
10 | 12 | } from "./constants";
|
11 |
| -import {execSync} from "child_process"; |
12 |
| -import {requiresTerraform} from "./helpers"; |
13 | 13 |
|
14 | 14 | export const wsEndpoint = process.env.CODER_E2E_WS_ENDPOINT;
|
15 | 15 |
|
16 | 16 | // This is where auth cookies are stored!
|
17 | 17 | export const storageState = path.join(__dirname, ".auth.json");
|
18 | 18 |
|
19 |
| -if(requireTerraformTests) { |
| 19 | +if (requireTerraformTests) { |
20 | 20 | try {
|
21 | 21 | // If running terraform tests, verify the requirements exist in the
|
22 | 22 | // environment.
|
23 | 23 | //
|
24 | 24 | // These execs will throw an error if the status code is non-zero.
|
25 | 25 | // So if both these work, then we can launch terraform provisioners.
|
26 |
| - const terraformExec = execSync('terraform --version') |
27 |
| - const dockerExec = execSync('docker --version') |
28 |
| - } catch(e) { |
29 |
| - throw new Error("Terraform provisioners require docker & terraform. " + |
30 |
| - "At least one of these is not present in the runtime environment. To check yourself:\n" + |
31 |
| - "\t$ terraform --version\n"+ |
32 |
| - "\t$ docker --version") |
| 26 | + execSync("terraform --version"); |
| 27 | + execSync("docker --version"); |
| 28 | + } catch (e) { |
| 29 | + throw new Error( |
| 30 | + "Terraform provisioners require docker & terraform. " + |
| 31 | + "At least one of these is not present in the runtime environment. To check yourself:\n" + |
| 32 | + "\t$ terraform --version\n" + |
| 33 | + "\t$ docker --version", |
| 34 | + ); |
33 | 35 | }
|
34 | 36 | }
|
35 | 37 |
|
36 |
| - |
37 | 38 | const localURL = (port: number, path: string): string => {
|
38 | 39 | return `http://localhost:${port}${path}`;
|
39 | 40 | };
|
@@ -80,7 +81,7 @@ export default defineConfig({
|
80 | 81 | "--dangerous-disable-rate-limits",
|
81 | 82 | "--provisioner-daemons 10",
|
82 | 83 | // TODO: Enable some terraform provisioners
|
83 |
| - `--provisioner-types=echo${requireTerraformTests ? ",terraform": ""}`, |
| 84 | + `--provisioner-types=echo${requireTerraformTests ? ",terraform" : ""}`, |
84 | 85 | `--provisioner-daemons=10`,
|
85 | 86 | "--web-terminal-renderer=dom",
|
86 | 87 | "--pprof-enable",
|
|
0 commit comments