Skip to content

Commit

Permalink
test(temporal): add globalSetup to install native binary before test
Browse files Browse the repository at this point in the history
  • Loading branch information
ochrstn authored and Romakita committed Oct 5, 2023
1 parent c5c1e88 commit b1a137e
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,6 @@ jobs:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: yarn install --frozen-lockfile --network-timeout 500000 --ignore-engines
- name: Install Temporal.io test server
run: curl -L -o /tmp/temporal-test-server-sdk-typescript-1.8.6.tar.gz https://temporal.download/assets/temporalio/sdk-java/releases/download/v1.17.0/temporal-test-server_1.17.0_linux_amd64.tar.gz
- name: Run build
run: yarn tsc --build
- name: Run test
Expand Down
1 change: 1 addition & 0 deletions packages/third-parties/temporal/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
module.exports = {
...require("@tsed/jest-config"),
roots: ["<rootDir>/src", "<rootDir>/test"],
globalSetup: "<rootDir>/test/global-setup.ts",
coverageThreshold: {
global: {
statements: 94.62,
Expand Down
2 changes: 1 addition & 1 deletion packages/third-parties/temporal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"scripts": {
"build": "yarn barrels && yarn build:ts",
"barrels": "yarn barrelsby --delete -d ./src -e \"\\.spec\\.ts\" -e \"__mock__\" -e \".benchmark.ts\"",
"test": "cross-env NODE_ENV=test yarn jest --runInBand && jest-coverage-thresholds-bumper ",
"test": "cross-env NODE_ENV=test yarn jest --runInBand --forceExit && jest-coverage-thresholds-bumper ",
"build:ts": "tsc --build tsconfig.json && tsc --build tsconfig.esm.json",
"lint": "eslint '**/*.{ts,js}'",
"lint:fix": "eslint '**/*.{ts,js}' --fix"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import {TestWorkflowEnvironment} from "@temporalio/testing";
import {Temporal, Activity, bootstrapWorker, TemporalClient} from "../src";
import {Server} from "./helpers/Server";
import {Runtime} from "@temporalio/worker";
import {getEphemeralServerTarget} from "@temporalio/core-bridge";
import {Runtime} from "@temporalio/worker";
import {PlatformTest} from "@tsed/common";
import {TemporalClient} from "../src";
import {Server} from "./helpers/Server";

describe("Temporal Client", () => {
let server: any;
Expand Down
6 changes: 6 additions & 0 deletions packages/third-parties/temporal/test/global-setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import {TestWorkflowEnvironment} from "@temporalio/testing";

module.exports = async function () {
const envTest = await TestWorkflowEnvironment.createTimeSkipping();
await envTest.teardown();
};

0 comments on commit b1a137e

Please sign in to comment.