From fc912b199ebaccf5f193374e02de496f441f6cc2 Mon Sep 17 00:00:00 2001 From: danielhe4rt Date: Sat, 3 Feb 2024 17:06:33 -0300 Subject: [PATCH 1/4] feat: adding testing to pipeline --- .env.ci | 7 +++++++ .github/workflows/laravel.yml | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 .env.ci create mode 100644 .github/workflows/laravel.yml diff --git a/.env.ci b/.env.ci new file mode 100644 index 0000000..bddb2d3 --- /dev/null +++ b/.env.ci @@ -0,0 +1,7 @@ +# database +DB_CONNECTION=mysql +DB_HOST=mysql +DB_PORT=3306 +DB_DATABASE=test +DB_USERNAME=root +DB_PASSWORD=password diff --git a/.github/workflows/laravel.yml b/.github/workflows/laravel.yml new file mode 100644 index 0000000..5fb4b9b --- /dev/null +++ b/.github/workflows/laravel.yml @@ -0,0 +1,34 @@ +on: push +name: CI +jobs: + phpunit: + runs-on: ubuntu-latest + container: + image: kirschbaumdevelopment/laravel-test-runner:8.2 + + services: + mysql: + image: mysql:5.7 + env: + MYSQL_ROOT_PASSWORD: password + MYSQL_DATABASE: test + ports: + - 33306:3306 + options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 + + steps: + - uses: actions/checkout@v1 + with: + fetch-depth: 1 + + - name: Install composer dependencies + run: | + composer install --no-scripts + + - name: Prepare Laravel Application + run: | + cp .env.ci .env + php artisan key:generate + + - name: Run Testsuite + run: vendor/bin/phpunit tests/ From 1a443450e828c4548bad7c4bba3614eabb7571e5 Mon Sep 17 00:00:00 2001 From: danielhe4rt Date: Sat, 3 Feb 2024 17:11:56 -0300 Subject: [PATCH 2/4] chore(tests): removing jetstream test suite --- phpunit.xml | 4 ++++ tests/{Feature => Jetstream}/ApiTokenPermissionsTest.php | 2 +- tests/{Feature => Jetstream}/AuthenticationTest.php | 2 +- tests/{Feature => Jetstream}/BrowserSessionsTest.php | 2 +- tests/{Feature => Jetstream}/CreateApiTokenTest.php | 2 +- tests/{Feature => Jetstream}/CreateTeamTest.php | 2 +- tests/{Feature => Jetstream}/DeleteAccountTest.php | 2 +- tests/{Feature => Jetstream}/DeleteApiTokenTest.php | 2 +- tests/{Feature => Jetstream}/DeleteTeamTest.php | 2 +- tests/{Feature => Jetstream}/EmailVerificationTest.php | 2 +- tests/{Feature => Jetstream}/ExampleTest.php | 2 +- tests/{Feature => Jetstream}/InviteTeamMemberTest.php | 2 +- tests/{Feature => Jetstream}/LeaveTeamTest.php | 2 +- tests/{Feature => Jetstream}/PasswordConfirmationTest.php | 2 +- tests/{Feature => Jetstream}/PasswordResetTest.php | 2 +- tests/{Feature => Jetstream}/ProfileInformationTest.php | 2 +- tests/{Feature => Jetstream}/RegistrationTest.php | 2 +- tests/{Feature => Jetstream}/RemoveTeamMemberTest.php | 2 +- tests/{Feature => Jetstream}/SocialstreamRegistrationTest.php | 2 +- .../TwoFactorAuthenticationSettingsTest.php | 2 +- tests/{Feature => Jetstream}/UpdatePasswordTest.php | 2 +- tests/{Feature => Jetstream}/UpdateTeamMemberRoleTest.php | 2 +- tests/{Feature => Jetstream}/UpdateTeamNameTest.php | 2 +- 23 files changed, 26 insertions(+), 22 deletions(-) rename tests/{Feature => Jetstream}/ApiTokenPermissionsTest.php (97%) rename tests/{Feature => Jetstream}/AuthenticationTest.php (97%) rename tests/{Feature => Jetstream}/BrowserSessionsTest.php (94%) rename tests/{Feature => Jetstream}/CreateApiTokenTest.php (97%) rename tests/{Feature => Jetstream}/CreateTeamTest.php (95%) rename tests/{Feature => Jetstream}/DeleteAccountTest.php (97%) rename tests/{Feature => Jetstream}/DeleteApiTokenTest.php (96%) rename tests/{Feature => Jetstream}/DeleteTeamTest.php (97%) rename tests/{Feature => Jetstream}/EmailVerificationTest.php (98%) rename tests/{Feature => Jetstream}/ExampleTest.php (92%) rename tests/{Feature => Jetstream}/InviteTeamMemberTest.php (98%) rename tests/{Feature => Jetstream}/LeaveTeamTest.php (97%) rename tests/{Feature => Jetstream}/PasswordConfirmationTest.php (97%) rename tests/{Feature => Jetstream}/PasswordResetTest.php (99%) rename tests/{Feature => Jetstream}/ProfileInformationTest.php (95%) rename tests/{Feature => Jetstream}/RegistrationTest.php (98%) rename tests/{Feature => Jetstream}/RemoveTeamMemberTest.php (97%) rename tests/{Feature => Jetstream}/SocialstreamRegistrationTest.php (98%) rename tests/{Feature => Jetstream}/TwoFactorAuthenticationSettingsTest.php (98%) rename tests/{Feature => Jetstream}/UpdatePasswordTest.php (98%) rename tests/{Feature => Jetstream}/UpdateTeamMemberRoleTest.php (97%) rename tests/{Feature => Jetstream}/UpdateTeamNameTest.php (95%) diff --git a/phpunit.xml b/phpunit.xml index f112c0c..d078976 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -11,6 +11,10 @@ tests/Feature + + + tests/Jetstream/* + diff --git a/tests/Feature/ApiTokenPermissionsTest.php b/tests/Jetstream/ApiTokenPermissionsTest.php similarity index 97% rename from tests/Feature/ApiTokenPermissionsTest.php rename to tests/Jetstream/ApiTokenPermissionsTest.php index bdf7318..90de31b 100644 --- a/tests/Feature/ApiTokenPermissionsTest.php +++ b/tests/Jetstream/ApiTokenPermissionsTest.php @@ -1,6 +1,6 @@ Date: Sat, 3 Feb 2024 17:14:06 -0300 Subject: [PATCH 3/4] fix(tests): using artisan to run tests --- .github/workflows/laravel.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/laravel.yml b/.github/workflows/laravel.yml index 5fb4b9b..c6dd85c 100644 --- a/.github/workflows/laravel.yml +++ b/.github/workflows/laravel.yml @@ -30,5 +30,5 @@ jobs: cp .env.ci .env php artisan key:generate - - name: Run Testsuite - run: vendor/bin/phpunit tests/ + - name: Run Test Suites + run: php artisan test From ab0050e73abbff7f011e1e42923083671de11adf Mon Sep 17 00:00:00 2001 From: danielhe4rt Date: Sat, 3 Feb 2024 17:20:48 -0300 Subject: [PATCH 4/4] chore(ci): improving output --- .github/workflows/laravel.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/laravel.yml b/.github/workflows/laravel.yml index c6dd85c..146b9a7 100644 --- a/.github/workflows/laravel.yml +++ b/.github/workflows/laravel.yml @@ -1,7 +1,7 @@ on: push -name: CI +name: Laravel Test Suite w/ PHPUnit jobs: - phpunit: + Testing: runs-on: ubuntu-latest container: image: kirschbaumdevelopment/laravel-test-runner:8.2