Skip to content

Commit

Permalink
Enhance the Build and Test workflow
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
AMoo-Miki committed Jan 20, 2023
1 parent 5f983c8 commit 008e3a1
Show file tree
Hide file tree
Showing 8 changed files with 529 additions and 347 deletions.
456 changes: 456 additions & 0 deletions .github/workflows/build_and_test_workflow.yml

Large diffs are not rendered by default.

306 changes: 0 additions & 306 deletions .github/workflows/pr_check_workflow.yml

This file was deleted.

13 changes: 9 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,15 @@
"test": "grunt test",
"test:bwc": "./scripts/bwctest_osd.sh",
"test:jest": "node scripts/jest",
"test:jest:coverage": "node scripts/jest --coverage",
"test:jest:ci": "node scripts/jest --ci --colors --runInBand",
"test:jest:ci:coverage": "node scripts/jest --ci --colors --runInBand --coverage",
"test:jest_integration": "node scripts/jest_integration",
"test:mocha": "node scripts/mocha",
"test:mocha:coverage": "grunt test:mochaCoverage",
"test:mocha:coverage": "yarn nyc --reporter=text-summary --reporter=lcov --report-dir=./target/opensearch-dashboards-coverage/mocha node scripts/mocha",
"test:ftr": "node scripts/functional_tests",
"test:ftr:server": "node scripts/functional_tests_server",
"test:ftr:runner": "node scripts/functional_test_runner",
"test:coverage": "grunt test:coverage",
"checkLicenses": "node scripts/check_licenses --dev",
"build-platform": "node scripts/build",
"build": "node scripts/build --all-platforms",
Expand Down Expand Up @@ -79,7 +81,8 @@
"**/@types/node": ">=10.17.17 <10.20.0",
"**/@types/react": "^16.14.23",
"**/ansi-regex": "^5.0.1",
"**/axios": "^0.21.4",
"!chromedriver/**/axios": "^0.21.4",
"chromedriver/**/axios": "^0.27.2",
"**/ejs": "^3.1.6",
"**/follow-redirects": "^1.15.2",
"**/front-matter": "^4.0.2",
Expand Down Expand Up @@ -107,6 +110,8 @@
"**/url-parse": "^1.5.8",
"**/shelljs": "0.8.5",
"**/unset-value": "^2.0.1",
"**/jest-config": "npm:@amoo-miki/jest-config@26.4.2-rc.1",
"**/jest-jasmine2": "npm:@amoo-miki/jest-jasmine2@26.4.2-rc.1",
"**/minimatch": "^3.0.5"
},
"workspaces": {
Expand Down Expand Up @@ -367,7 +372,7 @@
"chai": "3.5.0",
"chance": "1.0.18",
"cheerio": "0.22.0",
"chromedriver": "^91.0.1",
"chromedriver": "107.0.1",
"classnames": "2.2.6",
"compare-versions": "3.5.1",
"d3": "3.5.17",
Expand Down
6 changes: 4 additions & 2 deletions packages/osd-optimizer/src/worker/run_worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,13 @@ const exit = (code: number) => {
setTimeout(() => {
send(
workerMsgs.error(
new Error('process did not automatically exit within 5 seconds, forcing exit')
new Error(
`process did not automatically exit within 15 seconds (previous code: ${code}); forcing exit...`
)
)
);
process.exit(1);
}, 5000).unref();
}, 15000).unref();
};

// check for connected parent on an unref'd timer rather than listening
Expand Down
13 changes: 2 additions & 11 deletions src/dev/jest/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,6 @@ export default {
'<rootDir>/src/test_utils',
'<rootDir>/test/functional/services/remote',
],
collectCoverageFrom: [
'src/plugins/**/*.{ts,tsx}',
'!src/plugins/**/*.d.ts',
'packages/osd-ui-framework/src/components/**/*.js',
'!packages/osd-ui-framework/src/components/index.js',
'!packages/osd-ui-framework/src/components/**/*/index.js',
'packages/osd-ui-framework/src/services/**/*.js',
'!packages/osd-ui-framework/src/services/index.js',
'!packages/osd-ui-framework/src/services/**/*/index.js',
],
moduleNameMapper: {
'@elastic/eui$': '<rootDir>/node_modules/@elastic/eui/test-env',
'@elastic/eui/lib/(.*)?': '<rootDir>/node_modules/@elastic/eui/test-env/$1',
Expand All @@ -84,7 +74,8 @@ export default {
'<rootDir>/src/dev/jest/setup/react_testing_library.js',
],
coverageDirectory: '<rootDir>/target/opensearch-dashboards-coverage/jest',
coverageReporters: ['html', 'text'],
coveragePathIgnorePatterns: ['/node_modules/', '.*\\.d\\.ts'],
coverageReporters: ['lcov', 'text-summary'],
moduleFileExtensions: ['js', 'mjs', 'json', 'ts', 'tsx', 'node'],
modulePathIgnorePatterns: [
'__fixtures__/',
Expand Down
Loading

0 comments on commit 008e3a1

Please sign in to comment.