Skip to content

Commit

Permalink
Merge pull request #3317 from terascope/master-build-test-fix
Browse files Browse the repository at this point in the history
Master build test fix
  • Loading branch information
jsnoble authored Nov 30, 2022
2 parents 860afc0 + dc51274 commit 07d1fd2
Show file tree
Hide file tree
Showing 22 changed files with 44 additions and 56 deletions.
22 changes: 12 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,40 +46,42 @@ jobs:
node_js: '16.17.1'
# run only on pull-requests or cron
if: branch = master AND type IN (pull_request, cron)
script: yarn --silent test --suite unit-a . -- -- --shard=1/4
script: yarn --silent test --suite unit . -- -- --shard=1/6

- stage: 'Tests'
name: 'Unit Test Suite (node 16) shard 2'
node_js: '16.17.1'
# run only on pull-requests or cron
if: branch = master AND type IN (pull_request, cron)
script: yarn --silent test --suite unit-a . -- -- --shard=2/4
script: yarn --silent test --suite unit . -- -- --shard=2/6

- stage: 'Tests'
name: 'Unit Test Suite (node 16) shard 3'
node_js: '16.17.1'
# run only on pull-requests or cron
if: branch = master AND type IN (pull_request, cron)
script: yarn --silent test --suite unit-a . -- -- --shard=3/4
script: yarn --silent test --suite unit . -- -- --shard=3/6

- stage: 'Tests'
name: 'Unit Test Suite (node 16) shard 4'
node_js: '16.17.1'
# run only on pull-requests or cron
if: branch = master AND type IN (pull_request, cron)
script: yarn --silent test --suite unit-a . -- -- --shard=4/4
script: yarn --silent test --suite unit . -- -- --shard=4/6

- name: 'Unit Test Suite (node 14) shard 1'
node_js: '14.17'
- stage: 'Tests'
name: 'Unit Test Suite (node 16) shard 5'
node_js: '16.17.1'
# run only on pull-requests or cron
if: branch = master AND type IN (pull_request, cron)
script: yarn --silent test --suite unit-b . -- -- --shard=1/2
script: yarn --silent test --suite unit . -- -- --shard=5/6

- name: 'Unit Test Suite (node 14) shard 2'
node_js: '14.17'
- stage: 'Tests'
name: 'Unit Test Suite (node 16) shard 6'
node_js: '16.17.1'
# run only on pull-requests or cron
if: branch = master AND type IN (pull_request, cron)
script: yarn --silent test --suite unit-b . -- -- --shard=2/2
script: yarn --silent test --suite unit . -- -- --shard=6/6

- name: 'ES Test Suite (elasticsearch 6) (node 16)'
node_js: '16.17.1'
Expand Down
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"
}
}
4 changes: 2 additions & 2 deletions packages/scripts/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@terascope/scripts",
"displayName": "Scripts",
"version": "0.50.1",
"version": "0.50.2",
"description": "A collection of terascope monorepo scripts",
"homepage": "https://github.com/terascope/teraslice/tree/master/packages/scripts#readme",
"bugs": {
Expand Down Expand Up @@ -81,6 +81,6 @@
"srcMain": "src/index.ts",
"terascope": {
"enableTypedoc": false,
"testSuite": "unit-a"
"testSuite": "unit"
}
}
2 changes: 1 addition & 1 deletion packages/scripts/src/helpers/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export const SKIP_E2E_OUTPUT_LOGS = toBoolean(process.env.SKIP_E2E_OUTPUT_LOGS ?
/**
* jest or our tests have a memory leak, limiting this seems to help
*/
export const MAX_PROJECTS_PER_BATCH = toIntegerOrThrow(process.env.MAX_PROJECTS_PER_BATCH ?? 10);
export const MAX_PROJECTS_PER_BATCH = toIntegerOrThrow(process.env.MAX_PROJECTS_PER_BATCH ?? 5);

const reportCov = process.env.REPORT_COVERAGE || `${isCI}`;
export const REPORT_COVERAGE = toBoolean(reportCov);
Expand Down
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 07d1fd2

Please sign in to comment.