Fix flaky api tests due to exit code management

This commit is contained in:
Alexandre Bodin 2022-11-21 10:47:00 +01:00
parent e6761a240a
commit 246f9d0425
4 changed files with 10 additions and 22 deletions

View File

@ -1,7 +0,0 @@
name: 'Install modules'
description: 'Install yarn dependencies'
runs:
using: 'composite'
steps:
- run: $GITHUB_ACTION_PATH/script.sh
shell: bash

View File

@ -1,2 +0,0 @@
# run yarn
yarn

View File

@ -26,7 +26,7 @@ jobs:
with:
node-version: ${{ matrix.node }}
cache: yarn
- uses: ./.github/actions/install-modules
- run: yarn install --frozen-lockfile
- name: Run lint
run: yarn run -s lint
@ -43,7 +43,7 @@ jobs:
with:
node-version: ${{ matrix.node }}
cache: yarn
- uses: ./.github/actions/install-modules
- run: yarn install --frozen-lockfile
- name: Run tests
run: yarn run -s test:unit --coverage
- name: Upload coverage to Codecov
@ -66,7 +66,7 @@ jobs:
with:
node-version: ${{ matrix.node }}
cache: yarn
- uses: ./.github/actions/install-modules
- run: yarn install --frozen-lockfile
- name: Build
run: yarn build
- name: Run test
@ -110,7 +110,7 @@ jobs:
with:
node-version: ${{ matrix.node }}
cache: yarn
- uses: ./.github/actions/install-modules
- run: yarn install --frozen-lockfile
- uses: ./.github/actions/run-api-tests
with:
dbOptions: '--dbclient=postgres --dbhost=localhost --dbport=5432 --dbname=strapi_test --dbusername=strapi --dbpassword=strapi'
@ -145,7 +145,7 @@ jobs:
with:
node-version: ${{ matrix.node }}
cache: yarn
- uses: ./.github/actions/install-modules
- run: yarn install --frozen-lockfile
- uses: ./.github/actions/run-api-tests
with:
dbOptions: '--dbclient=mysql --dbhost=localhost --dbport=3306 --dbname=strapi_test --dbusername=strapi --dbpassword=strapi'
@ -180,7 +180,7 @@ jobs:
with:
node-version: ${{ matrix.node }}
cache: yarn
- uses: ./.github/actions/install-modules
- run: yarn install --frozen-lockfile
- uses: ./.github/actions/run-api-tests
with:
dbOptions: '--dbclient=mysql --dbhost=localhost --dbport=3306 --dbname=strapi_test --dbusername=strapi --dbpassword=strapi'
@ -199,7 +199,7 @@ jobs:
with:
node-version: ${{ matrix.node }}
cache: yarn
- uses: ./.github/actions/install-modules
- run: yarn install --frozen-lockfile
- uses: ./.github/actions/run-api-tests
env:
SQLITE_PKG: ${{ matrix.sqlite_pkg }}
@ -241,12 +241,11 @@ jobs:
with:
node-version: ${{ matrix.node }}
cache: yarn
- uses: ./.github/actions/install-modules
- run: yarn install --frozen-lockfile
- uses: ./.github/actions/run-api-tests
with:
dbOptions: '--dbclient=postgres --dbhost=localhost --dbport=5432 --dbname=strapi_test --dbusername=strapi --dbpassword=strapi'
runEE: true
api_ee_mysql:
runs-on: ubuntu-latest
needs: [lint, unit_back, unit_front]
@ -280,7 +279,7 @@ jobs:
with:
node-version: ${{ matrix.node }}
cache: yarn
- uses: ./.github/actions/install-modules
- run: yarn install --frozen-lockfile
- uses: ./.github/actions/run-api-tests
with:
dbOptions: '--dbclient=mysql --dbhost=localhost --dbport=3306 --dbname=strapi_test --dbusername=strapi --dbpassword=strapi'
@ -303,7 +302,7 @@ jobs:
with:
node-version: ${{ matrix.node }}
cache: yarn
- uses: ./.github/actions/install-modules
- run: yarn install --frozen-lockfile
- uses: ./.github/actions/run-api-tests
env:
SQLITE_PKG: ${{ matrix.sqlite_pkg }}

View File

@ -73,8 +73,6 @@ const main = async ({ database, generateApp }, args) => {
process.exit(1);
});
});
process.exit(0);
} catch (error) {
console.error(error);
process.stdout.write('Tests failed\n', () => {