Skip to content

Commit 7bd36df

Browse files
authored
Flatten test directory structure (#1303)
There was a mistake in #1299: tests inside the `integration-tests` subdirectory were not being run. But that mistake emphasizes that it's not really desirable to have the nested directory. So instead of modifying the `test` and `test.watch` command definitions in `package.json`, this PR flattens the directory structure as follows ``` helpers.ts helpers-integration.ts // helper boilerplate shared by the new-style integration tests test-integration-*.ts // i.e. new style integration tests (i.e. not matching -old-*.ts) test-integration-old-*.ts // old-style integration tests ```
1 parent 324db87 commit 7bd36df

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

packages/test/src/integration-tests/helpers.ts renamed to packages/test/src/helpers-integration.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ import {
1515
bundleWorkflowCode,
1616
} from '@temporalio/worker';
1717
import * as workflow from '@temporalio/workflow';
18-
import { ConnectionInjectorInterceptor } from '../activities/interceptors';
19-
import { Worker, test as anyTest, bundlerOptions } from '../helpers';
18+
import { ConnectionInjectorInterceptor } from './activities/interceptors';
19+
import { Worker, test as anyTest, bundlerOptions } from './helpers';
2020

2121
export interface Context {
2222
env: TestWorkflowEnvironment;

packages/test/src/integration-tests-old.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/* eslint @typescript-eslint/no-non-null-assertion: 0 */
22

33
/**
4-
* Our most recent style of integration tests are those in the
5-
* integration-tests/ directory. This file has been given the suffix -old to
6-
* distinguish the different variants.
4+
* This file has been given the suffix -old because it uses an older style of
5+
* integration testing. New code should follow the style of integration tests in
6+
* the files without this suffix.
77
*/
88
import path from 'node:path';
99
import v8 from 'node:v8';

packages/test/src/test-integration-codec-old.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
2-
* Our most recent style of integration tests are those in the
3-
* integration-tests/ directory. This file has been given the suffix -old to
4-
* distinguish the different variants.
2+
* This file has been given the suffix -old because it uses an older style of
3+
* integration testing. New code should follow the style of integration tests in
4+
* the files without this suffix.
55
*/
66

77
import { RUN_INTEGRATION_TESTS, ByteSkewerPayloadCodec } from './helpers';

packages/test/src/test-integration-old.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
2-
* Our most recent style of integration tests are those in the
3-
* integration-tests/ directory. This file has been given the suffix -old to
4-
* distinguish the different variants.
2+
* This file has been given the suffix -old because it uses an older style of
3+
* integration testing. New code should follow the style of integration tests in
4+
* the files without this suffix.
55
*/
66

77
import { RUN_INTEGRATION_TESTS } from './helpers';

packages/test/src/integration-tests/test-misc.ts renamed to packages/test/src/test-integration-workflows.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import * as activity from '@temporalio/activity';
44
import { tsToMs } from '@temporalio/common/lib/time';
55
import { CancelReason } from '@temporalio/worker/lib/activity';
66
import * as workflow from '@temporalio/workflow';
7-
import { signalSchedulingWorkflow } from '../activities/helpers';
8-
import { activityStartedSignal } from '../workflows/definitions';
9-
import { helpers, makeTestFunction } from './helpers';
7+
import { signalSchedulingWorkflow } from './activities/helpers';
8+
import { activityStartedSignal } from './workflows/definitions';
9+
import { helpers, makeTestFunction } from './helpers-integration';
1010

1111
const test = makeTestFunction({ workflowsPath: __filename });
1212

0 commit comments

Comments
 (0)