Skip to content

Commit

Permalink
Remove references to op test harness (#3673)
Browse files Browse the repository at this point in the history
This PR makes the following changes:
- Removes unused `teraslice-op-test-harness` dependencies in `teraslice`
and `teraslice-test-harness`
- Removes `OpTestHarnessOptions` interface
- Removes all references to `teraslice-op-test-harness` in the docs

ref: #3669
  • Loading branch information
busma13 authored Jul 8, 2024
1 parent 19f6877 commit c083bf3
Show file tree
Hide file tree
Showing 9 changed files with 1,028 additions and 1,186 deletions.
1,745 changes: 1,027 additions & 718 deletions docs/assets/teraslice-packages.excalidraw

Large diffs are not rendered by default.

Binary file modified docs/assets/teraslice-packages.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
415 changes: 0 additions & 415 deletions docs/packages/teraslice-op-test-harness/overview.md

This file was deleted.

32 changes: 1 addition & 31 deletions docs/packages/teraslice-test-harness/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ npm install --save-dev teraslice-test-harness

This package exports a few different test harnesses for running your operation.

**Note:** All TestHarnesses except `OpTestHarness` can take a path to the asset directory so it can the test can load and fully validate multiple different operations, if none are specified then it will assume it is running in a [asset bundle](../../asset-bundles/development.md).
**Note:** All TestHarnesses can take a path to the asset directory so it can the test can load and fully validate multiple different operations, if none are specified then it will assume it is running in a [asset bundle](../../asset-bundles/development.md).

### SlicerTestHarness

Expand Down Expand Up @@ -366,36 +366,6 @@ describe('Example Asset (Job)', () => {
});
```
### OpTestHarness
A simple test harness for running an single operation with minimal customizations. Based of the older [teraslice-op-test-harness](../teraslice-op-test-harness/overview.md) package.
**This is useful for testing Data in -> out on a Fetcher or Processor.**
**Usage:**
```js
const { OpTestHarness } = require('teraslice-test-harness');
const ExampleProcessor = require('../asset/example/processor');

describe('Example Asset (Op)', () => {
let harness;
beforeEach(() => {
harness = new OpTestHarness(ExampleProcessor);
return harness.initialize();
});

afterEach(() => {
return harness.shutdown();
});

it('should be able to run a slice', () => {
const input = [{ foo: 'bar' }, { bar: 'baz' }];
return expect(harness.run(input)).resolves.toBeArrayOfSize(2);
});
});
```
### DownloadExternalAssets
Used to test processors in separate asset bundles. It downloads a zipped asset bundle to ./test/.cache/downloads and unzips the asset to ./test/.cache/assets. At this point assets must be in a github repository to be downloaded.
Expand Down
1 change: 0 additions & 1 deletion packages/teraslice-test-harness/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
},
"dependencies": {
"@terascope/fetch-github-release": "^0.8.10",
"@terascope/teraslice-op-test-harness": "^1.24.1",
"decompress": "^4.2.1",
"fs-extra": "^11.2.0"
},
Expand Down
4 changes: 0 additions & 4 deletions packages/teraslice-test-harness/src/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ export interface JobHarnessOptions {
cluster_manager_type?: ClusterManagerType
}

export interface OpTestHarnessOptions {
clients?: TestClientConfig[];
}

export type AnyOperationConstructor = ProcessorConstructor|SlicerConstructor;

export interface SliceResults {
Expand Down
1 change: 0 additions & 1 deletion packages/teraslice/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@
"uuid": "^9.0.1"
},
"devDependencies": {
"@terascope/teraslice-op-test-harness": "^1.24.1",
"@types/archiver": "^6.0.2",
"@types/express": "^4.17.21",
"archiver": "^7.0.1",
Expand Down
9 changes: 0 additions & 9 deletions website/sidebars.json
Original file line number Diff line number Diff line change
Expand Up @@ -207,15 +207,6 @@
]
}
],
"Legacy": [
{
"type": "subcategory",
"label": "teraslice-op-test-harness",
"ids": [
"packages/teraslice-op-test-harness/overview"
]
}
],
"Internal": [
{
"type": "subcategory",
Expand Down
7 changes: 0 additions & 7 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2339,13 +2339,6 @@
lz4-asm "^0.4.2"
node-gzip "^1.1.2"

"@terascope/teraslice-op-test-harness@^1.24.1":
version "1.24.1"
resolved "https://registry.yarnpkg.com/@terascope/teraslice-op-test-harness/-/teraslice-op-test-harness-1.24.1.tgz#f3170cb5f659c927fb907d34c940181f9bfe48fa"
integrity sha512-T7tQ35S//2SY2gOgZxs7uPCEfLH0wAig2YV6gVTYLVBj7NivRtKgJx2EbwJGGQb0n3gNhNj/zn6AUKZ03+Q41A==
dependencies:
bluebird "^3.7.2"

"@terascope/types@^0.15.1":
version "0.15.1"
resolved "https://registry.yarnpkg.com/@terascope/types/-/types-0.15.1.tgz#2898c7361c57687d1b53a741c7555e8cba7804ca"
Expand Down

0 comments on commit c083bf3

Please sign in to comment.