Skip to content

Commit

Permalink
Use global default timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
skorfmann committed Apr 21, 2021
1 parent 7b79f49 commit 5bb0d68
Show file tree
Hide file tree
Showing 12 changed files with 15 additions and 21 deletions.
2 changes: 1 addition & 1 deletion test/csharp/synth-app/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ describe("csharp full integration test synth", () => {
test("synth generates JSON", async () => {
await driver.synth()
expect(driver.synthesizedStack('csharp-simple')).toMatchSnapshot()
}, 180_000);
});
})
1 change: 0 additions & 1 deletion test/java/synth-app/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { TestDriver } from "../../test-helper";

describe("java full integration", () => {
let driver: TestDriver;
jest.setTimeout(240_000);

beforeAll(async () => {
driver = new TestDriver(__dirname)
Expand Down
2 changes: 1 addition & 1 deletion test/python/multiple-stacks/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ describe("python full integration test synth", () => {
await driver.synth()
expect(driver.synthesizedStack('python-simple-one')).toMatchSnapshot()
expect(driver.synthesizedStack('python-simple-two')).toMatchSnapshot()
}, 240_000)
})
})
2 changes: 1 addition & 1 deletion test/python/synth-app/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ describe("python full integration test synth", () => {
test("synth generates JSON", async () => {
await driver.synth()
expect(driver.synthesizedStack('python-simple')).toMatchSnapshot()
}, 240_000);
});
})
2 changes: 1 addition & 1 deletion test/python/third-party-provider/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ describe("python full integration 3rd party", () => {
test("synth generates JSON", async () => {
await driver.synth()
expect(driver.synthesizedStack('python-third-party-provider')).toMatchSnapshot()
}, 30_000)
})
})
6 changes: 3 additions & 3 deletions test/typescript/feature-flags/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,19 @@ describe("full integration test", () => {
writeConfig(driver.workingDirectory, jsonWithContext({ excludeStackIdFromLogicalIds: "true" }))
await driver.synth()
expect(loadStackJson(driver.workingDirectory, 'hello-deploy')).toMatchSnapshot();
}, 60_000);
});

test("with allowSepCharsInLogicalIds feature", async () => {
writeConfig(driver.workingDirectory, jsonWithContext({ allowSepCharsInLogicalIds: "true" }))
await driver.synth()
expect(loadStackJson(driver.workingDirectory, 'hello-deploy')).toMatchSnapshot();
}, 60_000);
});

test("without features", async () => {
writeConfig(driver.workingDirectory, cdktfJSON)
await driver.synth()
expect(loadStackJson(driver.workingDirectory, 'hello-deploy')).toMatchSnapshot();
}, 60_000);
});

const jsonWithContext = (context) => {
return Object.assign({}, cdktfJSON, { context })
Expand Down
8 changes: 4 additions & 4 deletions test/typescript/init-remote-template/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@ import { TestDriver } from "../../test-helper";
const fs = require('fs').promises;

describe("remote templates", () => {

test("can init", async () => {
const driver = new TestDriver(__dirname)
await driver.setupRemoteTemplateProject();
const files = await fs.readdir(driver.workingDirectory);
expect(files).toEqual(['.gen', '.gitignore', '.npmrc', 'cdktf.json', 'help', 'main.ts', 'package.json', 'tsconfig.json']);
}, 120_000)
})

test("handles invalid url", async () => {
const driver = new TestDriver(__dirname)

try {
await driver.setupRemoteTemplateProject('invalid_url');
fail('Expected init to throw an error');
} catch (e) {
expect(e.stderr).toContain('Could not download template: the supplied url is invalid');
}
}, 120_000)
})
})
2 changes: 1 addition & 1 deletion test/typescript/init-with-colors/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ describe("test with colors", () => {
driver = new TestDriver(__dirname, { FORCE_COLOR: '1' })
driver.switchToTempDir()
await driver.init('typescript')
}, 120_000)
})
})
4 changes: 2 additions & 2 deletions test/typescript/modules/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ describe("full integration test", () => {
onPosix("build modules posix", async () => {
await driver.synth()
expect(driver.synthesizedStack('hello-modules')).toMatchSnapshot()
}, 120_000)
})

onWindows("build modules windows", async () => {
await driver.synth()
expect(driver.synthesizedStack('hello-modules')).toMatchSnapshot()
}, 120_000)
})
})
2 changes: 1 addition & 1 deletion test/typescript/synth-app-error/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ describe("full integration test synth", () => {
Synth command: npm run --silent compile && node thisFileDoesNotExist.js
Error: non-zero exit code 1`);
}
}, 120_000)
})
})
1 change: 0 additions & 1 deletion test/typescript/synth-app/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { TestDriver } from "../../test-helper";

describe("full integration test synth", () => {
let driver: TestDriver;
jest.setTimeout(120_000);

beforeAll(async () => {
driver = new TestDriver(__dirname)
Expand Down
4 changes: 0 additions & 4 deletions test/typescript/terraform-cloud/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ if (withAuth == it.skip) {
console.log('TERRAFORM_CLOUD_TOKEN is undefined, skipping authed tests')
}

const delay = (ms: number) => {
return new Promise(resolve => setTimeout(resolve, ms));
}

describe("full integration test", () => {
let driver: TestDriver;
let workspaceName: string;
Expand Down

0 comments on commit 5bb0d68

Please sign in to comment.