From 0314624f1045399903ecb76938631bd1fd8c0b9c Mon Sep 17 00:00:00 2001 From: Javier Pedemonte Date: Wed, 24 Jul 2024 14:21:22 -0500 Subject: [PATCH] ci: run test "in band" --- .github/workflows/ci.yaml | 2 +- examples/discovery-search-app/package.json | 4 +++- package.json | 1 + packages/discovery-react-components/package.json | 7 ++++--- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 5485af33b..c3bfcacec 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -33,7 +33,7 @@ jobs: - name: Build Apps run: yarn run build:apps - name: Test - run: yarn run test + run: yarn run test:ci env: DEBUG_PRINT_LIMIT: 50000 - name: Archive test artifacts diff --git a/examples/discovery-search-app/package.json b/examples/discovery-search-app/package.json index b075e1d75..51793cee5 100644 --- a/examples/discovery-search-app/package.json +++ b/examples/discovery-search-app/package.json @@ -13,8 +13,10 @@ "start": "yarn setup && cross-env SKIP_PREFLIGHT_CHECK=true SASS_PATH=${PWD}/src react-scripts start", "lint": "yarn run g:eslint --quiet '{src,cypress}/**/*.{js,jsx,ts,tsx}' './*.{js,jsx,ts,tsx}'", "test:e2e": "cross-env REACT_APP_CYPRESS_MODE=true BROWSER=none CYPRESS_baseUrl=http://localhost:3000 start-server-and-test start http://localhost:3000 'cypress run'", - "test:unit": "cross-env SKIP_PREFLIGHT_CHECK=true CI=1 react-scripts test --env=jsdom", + "test:unit": "cross-env SKIP_PREFLIGHT_CHECK=true react-scripts test --env=jsdom", + "test:unit:ci": "yarn run test:unit --runInBand", "test": "yarn test:unit && yarn test:e2e", + "test:ci": "yarn test:unit:ci && yarn test:e2e", "cypress": "cross-env REACT_APP_CYPRESS_MODE=true cypress open --e2e --browser chrome", "server": "yarn server:setup && yarn server:run", "server:run": "node ./server.js", diff --git a/package.json b/package.json index fc2cbeaa0..6fe9a34a5 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "build:pkgs": "yarn workspaces foreach -Av --parallel --include '@ibm-watson/*' run build", "build:apps": "yarn workspaces foreach -Av --parallel run build:app", "test": "yarn workspaces foreach -Av --parallel run test", + "test:ci": "yarn workspaces foreach -Av run test:ci", "g:analyze": "cd $INIT_CWD && source-map-explorer", "g:eslint": "cd $INIT_CWD && eslint" }, diff --git a/packages/discovery-react-components/package.json b/packages/discovery-react-components/package.json index 45c38ba3e..cd9d3db2f 100644 --- a/packages/discovery-react-components/package.json +++ b/packages/discovery-react-components/package.json @@ -18,9 +18,10 @@ "scripts": { "prepack": "yarn run build", "prepublish": "yarn run build", - "test": "cross-env SKIP_PREFLIGHT_CHECK=true CI=1 react-scripts test --env ./src/fixedJSDOMEnvironment.js", - "test:coverage": "cross-env CI=1 SKIP_PREFLIGHT_CHECK=true react-scripts test --env ./src/fixedJSDOMEnvironment.js --coverage", - "test:watch": "cross-env SKIP_PREFLIGHT_CHECK=true react-scripts test --env ./src/fixedJSDOMEnvironment.js --watch", + "test": "cross-env SKIP_PREFLIGHT_CHECK=true react-scripts test --env ./src/fixedJSDOMEnvironment.js", + "test:ci": "yarn run test --runInBand", + "test:coverage": "yarn run test --coverage", + "test:watch": "yarn run test --watch", "test:debug": "cross-env SKIP_PREFLIGHT_CHECK=true react-scripts --inspect-brk test --env ./src/fixedJSDOMEnvironment.js --runInBand --no-cache", "circular": "madge --circular src/*", "build": "tsc && vite build",