Skip to content

Commit

Permalink
Speedup e2e test on github (#14627)
Browse files Browse the repository at this point in the history
* speedup

* speedup

* fix

* review

* test
  • Loading branch information
liuxingbaoyu committed Jun 3, 2022
1 parent d4d08d9 commit 5b7d93e
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 4 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/e2e-tests-breaking.yml
Expand Up @@ -45,12 +45,36 @@ jobs:
- react-native
- prettier
steps:
- name: Get yarn1 cache directory path
id: yarn1-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Checkout code
uses: actions/checkout@v3
- name: Use Node.js latest
uses: actions/setup-node@v3
with:
node-version: "*"
- name: Get yarn3 cache directory path
id: yarn3-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
- name: Use yarn1 cache
uses: actions/cache@v3
id: yarn1-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn1-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn1-e2e-breaking-${{ matrix.project }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn1-e2e-breaking-${{ matrix.project }}-
- name: Use yarn3 cache
uses: actions/cache@v3
id: yarn3-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn3-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn3-e2e-breaking-${{ matrix.project }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn3-e2e-breaking-${{ matrix.project }}-
- name: Clean babel cache
run: |
rm -rf ${{ steps.yarn1-cache-dir-path.outputs.dir }}/*babel*
rm -rf ${{ steps.yarn3-cache-dir-path.outputs.dir }}/*babel*
- uses: actions/download-artifact@v3
with:
name: verdaccio-workspace
Expand Down
25 changes: 24 additions & 1 deletion .github/workflows/e2e-tests.yml
Expand Up @@ -44,13 +44,36 @@ jobs:
- react-native
- prettier
steps:
- name: Get yarn1 cache directory path
id: yarn1-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Checkout code
uses: actions/checkout@v3
- name: Use Node.js latest
uses: actions/setup-node@v3
with:
node-version: "*"
cache: "yarn"
- name: Get yarn3 cache directory path
id: yarn3-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
- name: Use yarn1 cache
uses: actions/cache@v3
id: yarn1-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn1-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn1-e2e-${{ matrix.project }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn1-e2e-${{ matrix.project }}-
- name: Use yarn3 cache
uses: actions/cache@v3
id: yarn3-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn3-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn3-e2e-${{ matrix.project }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn3-e2e-${{ matrix.project }}-
- name: Clean babel cache
run: |
rm -rf ${{ steps.yarn1-cache-dir-path.outputs.dir }}/*babel*
rm -rf ${{ steps.yarn3-cache-dir-path.outputs.dir }}/*babel*
- uses: actions/download-artifact@v3
with:
name: verdaccio-workspace
Expand Down
8 changes: 5 additions & 3 deletions scripts/integration-tests/e2e-jest.sh
Expand Up @@ -58,15 +58,17 @@ if [ "$BABEL_8_BREAKING" = true ] ; then
"
fi

sed -i 's/"skipLibCheck": false,/"skipLibCheck": true,/g' tsconfig.json # Speedup

yarn build

# The full test suite takes about 20mins on CircleCI. We run only a few of them
# to speed it up.
# The goals of this e2e test are:
# 1) Check that the typescript compilation isn't completely broken
# 2) Make sure that we don't accidentally break jest's usage of the Babel API
CI=true yarn test-ci-partial packages
CI=true yarn test-ci-partial e2e/__tests__/babel
CI=true yarn test-ci-partial e2e/__tests__/transform
CI=true yarn jest --color --maxWorkers=2 --config jest.config.mjs packages
CI=true yarn jest --color --maxWorkers=2 --config jest.config.mjs e2e/__tests__/babel
CI=true yarn jest --color --maxWorkers=2 --config jest.config.mjs e2e/__tests__/transform

cleanup

0 comments on commit 5b7d93e

Please sign in to comment.