Skip to content

Commit

Permalink
Test unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Pelayori committed Mar 18, 2024
1 parent 1f7721d commit 271b9da
Showing 1 changed file with 7 additions and 22 deletions.
29 changes: 7 additions & 22 deletions .github/workflows/unit-tests-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,13 @@ jobs:
runs-on: ubuntu-latest
services:
mysql:
image: mysql:8.3
image: mysql:latest
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: test_database
ports:
- 3306:3306
options: >-
--health-cmd="mysqladmin ping --silent"
--health-interval=10s
--health-timeout=5s
--health-retries=5
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- uses: actions/checkout@v2
- name: Set up JDK 17
Expand All @@ -42,28 +38,21 @@ jobs:
- name: Add exec permission to mvnw
run: chmod +x mvnw
- name: Run unit tests
run: ./mvnw test -Dgroups="unit"
env:
SPRING_DATASOURCE_URL: jdbc:mysql://localhost:3306/test_database
SPRING_DATASOURCE_USERNAME: root
SPRING_DATASOURCE_PASSWORD: root
run: ./mvnw test -Dgroups="unit" -Dspring.profiles.active=test -Dspring.datasource.url=jdbc:mysql://localhost:3306/test_database -Dspring.datasource.username=root -Dspring.datasource.password=root -Dspring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver

integration-tests:
needs: unit-tests
runs-on: ubuntu-latest
services:
mysql:
image: mysql:8.3
image: mysql:latest
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: test_database
ports:
- 3306:3306
options: >-
--health-cmd="mysqladmin ping --silent"
--health-interval=10s
--health-timeout=5s
--health-retries=5
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3

steps:
- uses: actions/checkout@v2
- name: Set up JDK 17
Expand All @@ -85,11 +74,7 @@ jobs:
- name: Add exec permission to mvnw
run: chmod +x mvnw
- name: Run integration tests with Selenium
run: ./mvnw test -Dgroups="integration"
env:
SPRING_DATASOURCE_URL: jdbc:mysql://localhost:3306/test_database
SPRING_DATASOURCE_USERNAME: root
SPRING_DATASOURCE_PASSWORD: root
run: ./mvnw test -Dgroups="integration" -Dspring.profiles.active=test -Dspring.datasource.url=jdbc:mysql://localhost:3306/test_database -Dspring.datasource.username=root -Dspring.datasource.password=root -Dspring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver

sonarcloud-analysis:
needs: unit-tests
Expand Down

0 comments on commit 271b9da

Please sign in to comment.