Skip to content

Commit

Permalink
Remove terraform init from integration tests
Browse files Browse the repository at this point in the history
This removes executing terraform before the tests. As the terraform-ls progressed, it has moved away from requiring a terraform init run before being able to parse the configuration.
  • Loading branch information
jpogran committed Nov 29, 2023
1 parent 0aa36ab commit 3a0cfc1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 34 deletions.
17 changes: 1 addition & 16 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,9 @@
"isDefault": true
}
},
{
"type": "process",
"label": "terraformInit",
"isBackground": true,
"command": "terraform",
"args": ["init"],
"options": {
"cwd": "${workspaceFolder}/testFixture"
},
"presentation": {
"reveal": "never",
"group": "watchers"
},
"group": "build"
},
{
"label": "tasks: watch-tests",
"dependsOn": ["npm: watch", "terraformInit"],
"dependsOn": ["npm: watch"],
"problemMatcher": []
},
{
Expand Down
18 changes: 0 additions & 18 deletions src/test/runTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,8 @@
import * as path from 'path';
import { runTests } from '@vscode/test-electron';
import { TestOptions } from '@vscode/test-electron/out/runTest';
import { exec } from '../utils/helpers';

async function terraformInit() {
const cwd = process.cwd();
process.chdir('testFixture');
const { stdout } = await exec('terraform', ['init', '-no-color']);
console.log(stdout);
process.chdir(cwd);
}

async function main(): Promise<void> {
try {
// initialize terraform before vscode opens
await terraformInit();
} catch (err) {
console.error(err);
console.error('Failed to run tests');
process.exitCode = 1;
}

// The folder containing the Extension Manifest package.json
// Passed to `--extensionDevelopmentPath`
// this is also the process working dir, even if vscode opens another folder
Expand Down

0 comments on commit 3a0cfc1

Please sign in to comment.