From 246f9d04251f79b85bfcd2efcf8294b23c75b4ff Mon Sep 17 00:00:00 2001 From: Alexandre Bodin Date: Mon, 21 Nov 2022 10:47:00 +0100 Subject: [PATCH] Fix flaky api tests due to exit code management --- .github/actions/install-modules/action.yml | 7 ------- .github/actions/install-modules/script.sh | 2 -- .github/workflows/tests.yml | 21 ++++++++++----------- test/api.js | 2 -- 4 files changed, 10 insertions(+), 22 deletions(-) delete mode 100644 .github/actions/install-modules/action.yml delete mode 100755 .github/actions/install-modules/script.sh diff --git a/.github/actions/install-modules/action.yml b/.github/actions/install-modules/action.yml deleted file mode 100644 index 73e6826b46..0000000000 --- a/.github/actions/install-modules/action.yml +++ /dev/null @@ -1,7 +0,0 @@ -name: 'Install modules' -description: 'Install yarn dependencies' -runs: - using: 'composite' - steps: - - run: $GITHUB_ACTION_PATH/script.sh - shell: bash diff --git a/.github/actions/install-modules/script.sh b/.github/actions/install-modules/script.sh deleted file mode 100755 index f4a3806144..0000000000 --- a/.github/actions/install-modules/script.sh +++ /dev/null @@ -1,2 +0,0 @@ -# run yarn -yarn diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0ab790d4a1..35b4b38363 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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 }} diff --git a/test/api.js b/test/api.js index e3341236e7..91769f3449 100644 --- a/test/api.js +++ b/test/api.js @@ -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', () => {