mirror of
				https://github.com/strapi/strapi.git
				synced 2025-10-30 17:37:26 +00:00 
			
		
		
		
	Fix flaky api tests due to exit code management
This commit is contained in:
		
							parent
							
								
									e6761a240a
								
							
						
					
					
						commit
						246f9d0425
					
				
							
								
								
									
										7
									
								
								.github/actions/install-modules/action.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										7
									
								
								.github/actions/install-modules/action.yml
									
									
									
									
										vendored
									
									
								
							| @ -1,7 +0,0 @@ | |||||||
| name: 'Install modules' |  | ||||||
| description: 'Install yarn dependencies' |  | ||||||
| runs: |  | ||||||
|   using: 'composite' |  | ||||||
|   steps: |  | ||||||
|     - run: $GITHUB_ACTION_PATH/script.sh |  | ||||||
|       shell: bash |  | ||||||
							
								
								
									
										2
									
								
								.github/actions/install-modules/script.sh
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.github/actions/install-modules/script.sh
									
									
									
									
										vendored
									
									
								
							| @ -1,2 +0,0 @@ | |||||||
| # run yarn |  | ||||||
| yarn |  | ||||||
							
								
								
									
										21
									
								
								.github/workflows/tests.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										21
									
								
								.github/workflows/tests.yml
									
									
									
									
										vendored
									
									
								
							| @ -26,7 +26,7 @@ jobs: | |||||||
|         with: |         with: | ||||||
|           node-version: ${{ matrix.node }} |           node-version: ${{ matrix.node }} | ||||||
|           cache: yarn |           cache: yarn | ||||||
|       - uses: ./.github/actions/install-modules |       - run: yarn install --frozen-lockfile | ||||||
|       - name: Run lint |       - name: Run lint | ||||||
|         run: yarn run -s lint |         run: yarn run -s lint | ||||||
| 
 | 
 | ||||||
| @ -43,7 +43,7 @@ jobs: | |||||||
|         with: |         with: | ||||||
|           node-version: ${{ matrix.node }} |           node-version: ${{ matrix.node }} | ||||||
|           cache: yarn |           cache: yarn | ||||||
|       - uses: ./.github/actions/install-modules |       - run: yarn install --frozen-lockfile | ||||||
|       - name: Run tests |       - name: Run tests | ||||||
|         run: yarn run -s test:unit --coverage |         run: yarn run -s test:unit --coverage | ||||||
|       - name: Upload coverage to Codecov |       - name: Upload coverage to Codecov | ||||||
| @ -66,7 +66,7 @@ jobs: | |||||||
|         with: |         with: | ||||||
|           node-version: ${{ matrix.node }} |           node-version: ${{ matrix.node }} | ||||||
|           cache: yarn |           cache: yarn | ||||||
|       - uses: ./.github/actions/install-modules |       - run: yarn install --frozen-lockfile | ||||||
|       - name: Build |       - name: Build | ||||||
|         run: yarn build |         run: yarn build | ||||||
|       - name: Run test |       - name: Run test | ||||||
| @ -110,7 +110,7 @@ jobs: | |||||||
|         with: |         with: | ||||||
|           node-version: ${{ matrix.node }} |           node-version: ${{ matrix.node }} | ||||||
|           cache: yarn |           cache: yarn | ||||||
|       - uses: ./.github/actions/install-modules |       - run: yarn install --frozen-lockfile | ||||||
|       - uses: ./.github/actions/run-api-tests |       - uses: ./.github/actions/run-api-tests | ||||||
|         with: |         with: | ||||||
|           dbOptions: '--dbclient=postgres --dbhost=localhost --dbport=5432 --dbname=strapi_test --dbusername=strapi --dbpassword=strapi' |           dbOptions: '--dbclient=postgres --dbhost=localhost --dbport=5432 --dbname=strapi_test --dbusername=strapi --dbpassword=strapi' | ||||||
| @ -145,7 +145,7 @@ jobs: | |||||||
|         with: |         with: | ||||||
|           node-version: ${{ matrix.node }} |           node-version: ${{ matrix.node }} | ||||||
|           cache: yarn |           cache: yarn | ||||||
|       - uses: ./.github/actions/install-modules |       - run: yarn install --frozen-lockfile | ||||||
|       - uses: ./.github/actions/run-api-tests |       - uses: ./.github/actions/run-api-tests | ||||||
|         with: |         with: | ||||||
|           dbOptions: '--dbclient=mysql --dbhost=localhost --dbport=3306 --dbname=strapi_test --dbusername=strapi --dbpassword=strapi' |           dbOptions: '--dbclient=mysql --dbhost=localhost --dbport=3306 --dbname=strapi_test --dbusername=strapi --dbpassword=strapi' | ||||||
| @ -180,7 +180,7 @@ jobs: | |||||||
|         with: |         with: | ||||||
|           node-version: ${{ matrix.node }} |           node-version: ${{ matrix.node }} | ||||||
|           cache: yarn |           cache: yarn | ||||||
|       - uses: ./.github/actions/install-modules |       - run: yarn install --frozen-lockfile | ||||||
|       - uses: ./.github/actions/run-api-tests |       - uses: ./.github/actions/run-api-tests | ||||||
|         with: |         with: | ||||||
|           dbOptions: '--dbclient=mysql --dbhost=localhost --dbport=3306 --dbname=strapi_test --dbusername=strapi --dbpassword=strapi' |           dbOptions: '--dbclient=mysql --dbhost=localhost --dbport=3306 --dbname=strapi_test --dbusername=strapi --dbpassword=strapi' | ||||||
| @ -199,7 +199,7 @@ jobs: | |||||||
|         with: |         with: | ||||||
|           node-version: ${{ matrix.node }} |           node-version: ${{ matrix.node }} | ||||||
|           cache: yarn |           cache: yarn | ||||||
|       - uses: ./.github/actions/install-modules |       - run: yarn install --frozen-lockfile | ||||||
|       - uses: ./.github/actions/run-api-tests |       - uses: ./.github/actions/run-api-tests | ||||||
|         env: |         env: | ||||||
|           SQLITE_PKG: ${{ matrix.sqlite_pkg }} |           SQLITE_PKG: ${{ matrix.sqlite_pkg }} | ||||||
| @ -241,12 +241,11 @@ jobs: | |||||||
|         with: |         with: | ||||||
|           node-version: ${{ matrix.node }} |           node-version: ${{ matrix.node }} | ||||||
|           cache: yarn |           cache: yarn | ||||||
|       - uses: ./.github/actions/install-modules |       - run: yarn install --frozen-lockfile | ||||||
|       - uses: ./.github/actions/run-api-tests |       - uses: ./.github/actions/run-api-tests | ||||||
|         with: |         with: | ||||||
|           dbOptions: '--dbclient=postgres --dbhost=localhost --dbport=5432 --dbname=strapi_test --dbusername=strapi --dbpassword=strapi' |           dbOptions: '--dbclient=postgres --dbhost=localhost --dbport=5432 --dbname=strapi_test --dbusername=strapi --dbpassword=strapi' | ||||||
|           runEE: true |           runEE: true | ||||||
| 
 |  | ||||||
|   api_ee_mysql: |   api_ee_mysql: | ||||||
|     runs-on: ubuntu-latest |     runs-on: ubuntu-latest | ||||||
|     needs: [lint, unit_back, unit_front] |     needs: [lint, unit_back, unit_front] | ||||||
| @ -280,7 +279,7 @@ jobs: | |||||||
|         with: |         with: | ||||||
|           node-version: ${{ matrix.node }} |           node-version: ${{ matrix.node }} | ||||||
|           cache: yarn |           cache: yarn | ||||||
|       - uses: ./.github/actions/install-modules |       - run: yarn install --frozen-lockfile | ||||||
|       - uses: ./.github/actions/run-api-tests |       - uses: ./.github/actions/run-api-tests | ||||||
|         with: |         with: | ||||||
|           dbOptions: '--dbclient=mysql --dbhost=localhost --dbport=3306 --dbname=strapi_test --dbusername=strapi --dbpassword=strapi' |           dbOptions: '--dbclient=mysql --dbhost=localhost --dbport=3306 --dbname=strapi_test --dbusername=strapi --dbpassword=strapi' | ||||||
| @ -303,7 +302,7 @@ jobs: | |||||||
|         with: |         with: | ||||||
|           node-version: ${{ matrix.node }} |           node-version: ${{ matrix.node }} | ||||||
|           cache: yarn |           cache: yarn | ||||||
|       - uses: ./.github/actions/install-modules |       - run: yarn install --frozen-lockfile | ||||||
|       - uses: ./.github/actions/run-api-tests |       - uses: ./.github/actions/run-api-tests | ||||||
|         env: |         env: | ||||||
|           SQLITE_PKG: ${{ matrix.sqlite_pkg }} |           SQLITE_PKG: ${{ matrix.sqlite_pkg }} | ||||||
|  | |||||||
| @ -73,8 +73,6 @@ const main = async ({ database, generateApp }, args) => { | |||||||
|         process.exit(1); |         process.exit(1); | ||||||
|       }); |       }); | ||||||
|     }); |     }); | ||||||
| 
 |  | ||||||
|     process.exit(0); |  | ||||||
|   } catch (error) { |   } catch (error) { | ||||||
|     console.error(error); |     console.error(error); | ||||||
|     process.stdout.write('Tests failed\n', () => { |     process.stdout.write('Tests failed\n', () => { | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Alexandre Bodin
						Alexandre Bodin