Skip to content

Commit 008e3a1

Browse files
author
Miki
committed
Enhance the Build and Test workflow
* Run GitHub workflow unit tests in band (opensearch-project#1306) * Fix JUnit Reporter test (opensearch-project#1338) * Add code coverage reporting (opensearch-project#1478) * Add release build verification workflow (opensearch-project#1502) * Add Windows CI to the workflow (opensearch-project#2966) * Add retrying flaky jest tests (opensearch-project#2967) * Record functional test artifacts in case of failure (opensearch-project#3190) * Increase timeout waiting for the exiting of an optimizer worker (opensearch-project#3193) * Improve yarn's performance in workflows by caching yarn's cache folder (opensearch-project#3194) * Fix the version of Chrome to 107 to match `chromedriver@107.0.1`, the last that works on NodeJS v10 * Fix unit tests of ExecutionContract throwing AbortError Signed-off-by: Miki <miki@amazon.com>
1 parent 5f983c8 commit 008e3a1

File tree

8 files changed

+529
-347
lines changed

8 files changed

+529
-347
lines changed

.github/workflows/build_and_test_workflow.yml

Lines changed: 456 additions & 0 deletions
Large diffs are not rendered by default.

.github/workflows/pr_check_workflow.yml

Lines changed: 0 additions & 306 deletions
This file was deleted.

package.json

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,15 @@
4343
"test": "grunt test",
4444
"test:bwc": "./scripts/bwctest_osd.sh",
4545
"test:jest": "node scripts/jest",
46+
"test:jest:coverage": "node scripts/jest --coverage",
47+
"test:jest:ci": "node scripts/jest --ci --colors --runInBand",
48+
"test:jest:ci:coverage": "node scripts/jest --ci --colors --runInBand --coverage",
4649
"test:jest_integration": "node scripts/jest_integration",
4750
"test:mocha": "node scripts/mocha",
48-
"test:mocha:coverage": "grunt test:mochaCoverage",
51+
"test:mocha:coverage": "yarn nyc --reporter=text-summary --reporter=lcov --report-dir=./target/opensearch-dashboards-coverage/mocha node scripts/mocha",
4952
"test:ftr": "node scripts/functional_tests",
5053
"test:ftr:server": "node scripts/functional_tests_server",
5154
"test:ftr:runner": "node scripts/functional_test_runner",
52-
"test:coverage": "grunt test:coverage",
5355
"checkLicenses": "node scripts/check_licenses --dev",
5456
"build-platform": "node scripts/build",
5557
"build": "node scripts/build --all-platforms",
@@ -79,7 +81,8 @@
7981
"**/@types/node": ">=10.17.17 <10.20.0",
8082
"**/@types/react": "^16.14.23",
8183
"**/ansi-regex": "^5.0.1",
82-
"**/axios": "^0.21.4",
84+
"!chromedriver/**/axios": "^0.21.4",
85+
"chromedriver/**/axios": "^0.27.2",
8386
"**/ejs": "^3.1.6",
8487
"**/follow-redirects": "^1.15.2",
8588
"**/front-matter": "^4.0.2",
@@ -107,6 +110,8 @@
107110
"**/url-parse": "^1.5.8",
108111
"**/shelljs": "0.8.5",
109112
"**/unset-value": "^2.0.1",
113+
"**/jest-config": "npm:@amoo-miki/jest-config@26.4.2-rc.1",
114+
"**/jest-jasmine2": "npm:@amoo-miki/jest-jasmine2@26.4.2-rc.1",
110115
"**/minimatch": "^3.0.5"
111116
},
112117
"workspaces": {
@@ -367,7 +372,7 @@
367372
"chai": "3.5.0",
368373
"chance": "1.0.18",
369374
"cheerio": "0.22.0",
370-
"chromedriver": "^91.0.1",
375+
"chromedriver": "107.0.1",
371376
"classnames": "2.2.6",
372377
"compare-versions": "3.5.1",
373378
"d3": "3.5.17",

packages/osd-optimizer/src/worker/run_worker.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,13 @@ const exit = (code: number) => {
8080
setTimeout(() => {
8181
send(
8282
workerMsgs.error(
83-
new Error('process did not automatically exit within 5 seconds, forcing exit')
83+
new Error(
84+
`process did not automatically exit within 15 seconds (previous code: ${code}); forcing exit...`
85+
)
8486
)
8587
);
8688
process.exit(1);
87-
}, 5000).unref();
89+
}, 15000).unref();
8890
};
8991

9092
// check for connected parent on an unref'd timer rather than listening

src/dev/jest/config.js

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,6 @@ export default {
5151
'<rootDir>/src/test_utils',
5252
'<rootDir>/test/functional/services/remote',
5353
],
54-
collectCoverageFrom: [
55-
'src/plugins/**/*.{ts,tsx}',
56-
'!src/plugins/**/*.d.ts',
57-
'packages/osd-ui-framework/src/components/**/*.js',
58-
'!packages/osd-ui-framework/src/components/index.js',
59-
'!packages/osd-ui-framework/src/components/**/*/index.js',
60-
'packages/osd-ui-framework/src/services/**/*.js',
61-
'!packages/osd-ui-framework/src/services/index.js',
62-
'!packages/osd-ui-framework/src/services/**/*/index.js',
63-
],
6454
moduleNameMapper: {
6555
'@elastic/eui$': '<rootDir>/node_modules/@elastic/eui/test-env',
6656
'@elastic/eui/lib/(.*)?': '<rootDir>/node_modules/@elastic/eui/test-env/$1',
@@ -84,7 +74,8 @@ export default {
8474
'<rootDir>/src/dev/jest/setup/react_testing_library.js',
8575
],
8676
coverageDirectory: '<rootDir>/target/opensearch-dashboards-coverage/jest',
87-
coverageReporters: ['html', 'text'],
77+
coveragePathIgnorePatterns: ['/node_modules/', '.*\\.d\\.ts'],
78+
coverageReporters: ['lcov', 'text-summary'],
8879
moduleFileExtensions: ['js', 'mjs', 'json', 'ts', 'tsx', 'node'],
8980
modulePathIgnorePatterns: [
9081
'__fixtures__/',

0 commit comments

Comments
 (0)