Skip to content

Commit

Permalink
removed unit-b tests changed unit-a to unit tests, 6 shards for unit …
Browse files Browse the repository at this point in the history
…tests
  • Loading branch information
Charlie Iorg committed Nov 29, 2022
1 parent 860afc0 commit 04ae6d7
Show file tree
Hide file tree
Showing 20 changed files with 30 additions and 44 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,7 @@
"kafka": [
"kafka"
],
"unit-a": [],
"unit-b": []
"unit": []
}
},
"docker": {
Expand Down
2 changes: 1 addition & 1 deletion packages/data-mate/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,6 @@
"srcMain": "src/index.ts",
"terascope": {
"enableTypedoc": true,
"testSuite": "unit-b"
"testSuite": "unit"
}
}
2 changes: 1 addition & 1 deletion packages/data-types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@
"srcMain": "src/index.ts",
"terascope": {
"enableTypedoc": true,
"testSuite": "unit-b"
"testSuite": "unit"
}
}
2 changes: 1 addition & 1 deletion packages/eslint-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@
},
"terascope": {
"enableTypedoc": false,
"testSuite": "unit-b"
"testSuite": "unit"
}
}
2 changes: 1 addition & 1 deletion packages/generator-teraslice/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@
"registry": "https://registry.npmjs.org/"
},
"terascope": {
"testSuite": "unit-b"
"testSuite": "unit"
}
}
2 changes: 1 addition & 1 deletion packages/job-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,6 @@
"srcMain": "src/index.ts",
"terascope": {
"enableTypedoc": true,
"testSuite": "unit-a"
"testSuite": "unit"
}
}
2 changes: 1 addition & 1 deletion packages/scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,6 @@
"srcMain": "src/index.ts",
"terascope": {
"enableTypedoc": false,
"testSuite": "unit-a"
"testSuite": "unit"
}
}
35 changes: 11 additions & 24 deletions packages/scripts/test/test-runner-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ describe('Test Runner Helpers', () => {
it('should be able to filter by a suite', () => {
const options = makeTestOptions({
all: false,
suite: ['unit-a'],
suite: ['unit'],
});
const filtered = filterBySuite(packages, options);
const suites = filtered.map((pkgInfo) => pkgInfo.terascope.testSuite);
Expand Down Expand Up @@ -82,65 +82,52 @@ describe('Test Runner Helpers', () => {
suite: ['restrained'],
}));

const unitATests = filterBySuite(packages, makeTestOptions({
const unitTests = filterBySuite(packages, makeTestOptions({
all: true,
suite: ['unit-a'],
}));

const unitBTests = filterBySuite(packages, makeTestOptions({
all: true,
suite: ['unit-b'],
suite: ['unit']
}));

const unitAndESPackages = [
...unitBTests,
...unitATests,
...unitTests,
...restrainedTests,
...opensearchTests,
...elasticsearchTests,
...elasticsearchTests
];

const grouped = groupBySuite(packages, availableSuites, makeTestOptions({
all: true,
watch: true
}));

expect(mapInfo(grouped['unit-a'])).toBeArrayOfSize(0);
expect(mapInfo(grouped['unit-b'])).toBeArrayOfSize(0);
expect(mapInfo(grouped.unit)).toBeArrayOfSize(0);
expect(mapInfo(grouped.elasticsearch).length).toEqual(
mapInfo(unitAndESPackages).length
);
});
});

describe('when a unit-a test and none-unit-a test, it should group them together', () => {
it('should be able group elasticsearch and unit-a together', () => {
describe('when a unit test and none-unit test, it should group them together', () => {
it('should be able group elasticsearch and unit together', () => {
const elasticsearchTests = filterBySuite(packages, makeTestOptions({
all: false,
suite: ['elasticsearch'],
})).slice(0, 2);

const unitATests = filterBySuite(packages, makeTestOptions({
all: false,
suite: ['unit-a'],
})).slice(0, 2);

const unitBTests = filterBySuite(packages, makeTestOptions({
all: false,
suite: ['unit-b'],
suite: ['unit'],
})).slice(0, 2);

const unitAndESPackages = [
...unitATests,
...unitBTests,
...elasticsearchTests,
...elasticsearchTests
];

const grouped = groupBySuite(unitAndESPackages, availableSuites, makeTestOptions({
all: false,
}));

expect(mapInfo(grouped['unit-a'])).toBeArrayOfSize(0);
expect(mapInfo(grouped.unit)).toBeArrayOfSize(0);
expect(mapInfo(grouped.elasticsearch)).toEqual(
mapInfo(unitAndESPackages)
);
Expand Down
2 changes: 1 addition & 1 deletion packages/terafoundation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,6 @@
},
"terascope": {
"enableTypedoc": true,
"testSuite": "unit-b"
"testSuite": "unit"
}
}
2 changes: 1 addition & 1 deletion packages/teraslice-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
},
"srcMain": "src/index.ts",
"terascope": {
"testSuite": "unit-a",
"testSuite": "unit",
"enableTypedoc": true
}
}
2 changes: 1 addition & 1 deletion packages/teraslice-client-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@
"srcMain": "src/index.ts",
"terascope": {
"enableTypedoc": true,
"testSuite": "unit-a"
"testSuite": "unit"
}
}
2 changes: 1 addition & 1 deletion packages/teraslice-messaging/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,6 @@
"srcMain": "src/index.ts",
"terascope": {
"enableTypedoc": true,
"testSuite": "unit-a"
"testSuite": "unit"
}
}
2 changes: 1 addition & 1 deletion packages/teraslice-op-test-harness/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@
"registry": "https://registry.npmjs.org/"
},
"terascope": {
"testSuite": "unit-a"
"testSuite": "unit"
}
}
2 changes: 1 addition & 1 deletion packages/teraslice-state-storage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@
"srcMain": "src/index.ts",
"terascope": {
"enableTypedoc": true,
"testSuite": "unit-a"
"testSuite": "unit"
}
}
2 changes: 1 addition & 1 deletion packages/teraslice-test-harness/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@
"srcMain": "src/index.ts",
"terascope": {
"enableTypedoc": true,
"testSuite": "unit-a"
"testSuite": "unit"
}
}
2 changes: 1 addition & 1 deletion packages/ts-transforms/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,6 @@
"srcMain": "src/index.ts",
"terascope": {
"enableTypedoc": true,
"testSuite": "unit-b"
"testSuite": "unit"
}
}
2 changes: 1 addition & 1 deletion packages/utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,6 @@
"srcMain": "src/index.ts",
"terascope": {
"enableTypedoc": true,
"testSuite": "unit-b"
"testSuite": "unit"
}
}
2 changes: 1 addition & 1 deletion packages/xlucene-parser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@
"srcMain": "src/index.ts",
"terascope": {
"enableTypedoc": true,
"testSuite": "unit-b"
"testSuite": "unit"
}
}
2 changes: 1 addition & 1 deletion packages/xlucene-translator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@
"srcMain": "src/index.ts",
"terascope": {
"enableTypedoc": true,
"testSuite": "unit-b"
"testSuite": "unit"
}
}
2 changes: 1 addition & 1 deletion packages/xpressions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
},
"srcMain": "src/index.ts",
"terascope": {
"testSuite": "unit-b",
"testSuite": "unit",
"enableTypedoc": true
}
}

0 comments on commit 04ae6d7

Please sign in to comment.