Skip to content

Commit f702953

Browse files
Mikiananzh
authored andcommitted
[Manual Backport][1.3]Enhance the Build and Test workflow
* Run GitHub workflow unit tests in band (opensearch-project#1306) * Fix JUnit Reporter test (opensearch-project#1338) * Add src/test_utils/ and src/core paths to the target clean patterns (opensearch-project#1442) * 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 * Prevent `AbortError` from breaking unit tests for ExecutionContract Backport PR: opensearch-project#3299 Signed-off-by: Miki <miki@amazon.com>
1 parent 78308ba commit f702953

File tree

8 files changed

+535
-348
lines changed

8 files changed

+535
-348
lines changed

.github/workflows/build_and_test_workflow.yml

Lines changed: 457 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: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@
3131
"built_assets",
3232
".eslintcache",
3333
".node_binaries",
34-
"src/plugins/*/target"
34+
"src/plugins/*/target",
35+
"src/core/target",
36+
"src/test_utils/target"
3537
]
3638
}
3739
},
@@ -43,13 +45,16 @@
4345
"test": "grunt test",
4446
"test:bwc": "./scripts/bwctest_osd.sh",
4547
"test:jest": "node scripts/jest",
48+
"test:jest:coverage": "node scripts/jest --coverage",
49+
"test:jest:ci": "node scripts/jest --ci --colors --runInBand",
50+
"test:jest:ci:coverage": "node scripts/jest --ci --colors --runInBand --coverage",
4651
"test:jest_integration": "node scripts/jest_integration",
52+
"test:jest_integration:ci": "node scripts/jest_integration --ci --colors --max-old-space-size=5120",
4753
"test:mocha": "node scripts/mocha",
48-
"test:mocha:coverage": "grunt test:mochaCoverage",
54+
"test:mocha:coverage": "yarn nyc --reporter=text-summary --reporter=lcov --report-dir=./target/opensearch-dashboards-coverage/mocha node scripts/mocha",
4955
"test:ftr": "node scripts/functional_tests",
5056
"test:ftr:server": "node scripts/functional_tests_server",
5157
"test:ftr:runner": "node scripts/functional_test_runner",
52-
"test:coverage": "grunt test:coverage",
5358
"checkLicenses": "node scripts/check_licenses --dev",
5459
"build-platform": "node scripts/build",
5560
"build": "node scripts/build --all-platforms",
@@ -79,7 +84,8 @@
7984
"**/@types/node": ">=10.17.17 <10.20.0",
8085
"**/@types/react": "^16.14.23",
8186
"**/ansi-regex": "^5.0.1",
82-
"**/axios": "^0.21.4",
87+
"!chromedriver/**/axios": "^0.21.4",
88+
"chromedriver/**/axios": "^0.27.2",
8389
"**/ejs": "^3.1.6",
8490
"**/follow-redirects": "^1.15.2",
8591
"**/front-matter": "^4.0.2",
@@ -107,6 +113,8 @@
107113
"**/url-parse": "^1.5.8",
108114
"**/shelljs": "0.8.5",
109115
"**/unset-value": "^2.0.1",
116+
"**/jest-config": "npm:@amoo-miki/jest-config@26.4.2-rc.1",
117+
"**/jest-jasmine2": "npm:@amoo-miki/jest-jasmine2@26.4.2-rc.1",
110118
"**/minimatch": "^3.0.5"
111119
},
112120
"workspaces": {
@@ -367,7 +375,7 @@
367375
"chai": "3.5.0",
368376
"chance": "1.0.18",
369377
"cheerio": "0.22.0",
370-
"chromedriver": "^91.0.1",
378+
"chromedriver": "107.0.1",
371379
"classnames": "2.2.6",
372380
"compare-versions": "3.5.1",
373381
"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

0 commit comments

Comments
 (0)