Skip to content

Commit

Permalink
Move tests to root folder (#1362)
Browse files Browse the repository at this point in the history
Co-authored-by: Alec <[email protected]>
Co-authored-by: glennjacobs <[email protected]>
  • Loading branch information
3 people authored Dec 19, 2023
1 parent 385c529 commit 72b7374
Show file tree
Hide file tree
Showing 223 changed files with 1,429 additions and 1,525 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/admin_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ jobs:
APP_ENV: testing
DB_CONNECTION: testing
DB_DATABASE: ":memory:"
run: vendor/bin/pest --testsuite admin --test-directory packages/admin/tests
run: vendor/bin/pest --testsuite admin --parallel
2 changes: 1 addition & 1 deletion .github/workflows/core_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ jobs:
APP_ENV: testing
DB_CONNECTION: testing
DB_DATABASE: ":memory:"
run: vendor/bin/pest --testsuite core --test-directory packages/core/tests
run: vendor/bin/pest --testsuite core --parallel
51 changes: 41 additions & 10 deletions .github/workflows/scout_db_mysql_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,16 @@ on:
pull_request:
defaults:
run:
working-directory: ./packages/scout-database-engine
working-directory: ./
jobs:
phpunit:
run:
runs-on: ubuntu-latest
strategy:
matrix:
php: [ 8.1, 8.2 ]
laravel: [ 10.* ]
phpunit-versions: [ 'latest' ]
name: PHP:${{ matrix.php }} / Laravel:${{ matrix.laravel }}
container:
image: kirschbaumdevelopment/laravel-test-runner:8.1

Expand All @@ -21,13 +27,38 @@ jobs:
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3

steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1
- uses: actions/checkout@v2
with:
fetch-depth: 1
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: mbstring, intl, amqp, dba, bcmath
tools: composer:v2, phpunit:${{ matrix.php }}

- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Install composer dependencies
run: |
composer install --no-scripts
- name: Cache composer dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
restore-keys: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-

- name: Run Testsuite
run: vendor/bin/pest
- name: Install Composer dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update --dev
composer update --prefer-stable --no-interaction --no-suggest
- name: Execute tests (Unit and Feature tests) via Pest
env:
APP_ENV: testing
DB_CONNECTION: mysql
DB_HOST: mysql
DB_DATABASE: "test"
DB_USERNAME: "root"
DB_PASSWORD: "password"
run: vendor/bin/pest --testsuite scout-database-engine
53 changes: 42 additions & 11 deletions .github/workflows/scout_db_postgres_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,16 @@ on:
pull_request:
defaults:
run:
working-directory: ./packages/scout-database-engine
working-directory: ./
jobs:
phpunit:
run:
runs-on: ubuntu-latest
strategy:
matrix:
php: [ 8.1, 8.2 ]
laravel: [ 10.* ]
phpunit-versions: [ 'latest' ]
name: PHP:${{ matrix.php }} / Laravel:${{ matrix.laravel }}
container:
image: kirschbaumdevelopment/laravel-test-runner:8.1

Expand All @@ -18,17 +24,42 @@ jobs:
POSTGRES_PASSWORD: password
POSTGRES_DB: test
ports:
- 5432:5432
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1
- uses: actions/checkout@v2
with:
fetch-depth: 1
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: mbstring, intl, amqp, dba, bcmath
tools: composer:v2, phpunit:${{ matrix.php }}

- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Install composer dependencies
run: |
composer install --no-scripts
- name: Cache composer dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
restore-keys: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-

- name: Run Testsuite
run: DB_CONNECTION=pgsql DB_HOST=postgres vendor/bin/pest
- name: Install Composer dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update --dev
composer update --prefer-stable --no-interaction --no-suggest
- name: Execute tests (Unit and Feature tests) via Pest
env:
APP_ENV: testing
DB_CONNECTION: pgsql
DB_HOST: postgres
DB_DATABASE: "test"
DB_USERNAME: "root"
DB_PASSWORD: "password"
run: vendor/bin/pest --testsuite scout-database-engine
2 changes: 1 addition & 1 deletion .github/workflows/table_rate_shipping_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ jobs:
APP_ENV: testing
DB_CONNECTION: testing
DB_DATABASE: ":memory:"
run: vendor/bin/pest --testsuite table-rate-shipping --test-directory packages/table-rate-shipping/tests
run: vendor/bin/pest --testsuite shipping --parallel
10 changes: 6 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,12 @@
},
"autoload-dev": {
"psr-4": {
"Lunar\\Admin\\Tests\\": "packages/admin/tests",
"Lunar\\Tests\\": "packages/core/tests",
"Lunar\\Opayo\\Tests\\": "packages/core/opayo/tests",
"Lunar\\ScoutDatabaseEngine\\Tests\\": "packages/scout-database-engine/tests",
"Lunar\\Tests\\Admin\\": "tests/admin",
"Lunar\\Tests\\Core\\": "tests/core",
"Lunar\\Tests\\Opayo\\": "tests/opayo",
"Lunar\\Tests\\Paypal\\": "tests/paypal",
"Lunar\\Tests\\ScoutDatabaseEngine\\": "tests/scout-database-engine",
"Lunar\\Tests\\Shipping\\": "tests/shipping",
"Lunar\\Shipping\\Tests\\": "packages/table-rate-shipping/tests"
}
},
Expand Down
22 changes: 0 additions & 22 deletions packages/admin/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@
"src/helpers.php"
]
},
"autoload-dev": {
"psr-4": {
"Lunar\\Admin\\Tests\\": "tests"
}
},
"minimum-stability": "dev",
"require": {
"lunarphp/core": "self.version",
Expand All @@ -28,28 +23,11 @@
"marvinosswald/filament-input-select-affix": "dev-main",
"leandrocfe/filament-apex-charts": "^3.0"
},
"require-dev": {
"orchestra/testbench": "^8.0",
"pestphp/pest": "^2.0",
"pestphp/pest-plugin-laravel": "^2.0"
},
"extra": {
"laravel": {
"providers": [
"Lunar\\Admin\\LunarPanelProvider"
]
}
},
"config": {
"allow-plugins": {
"pestphp/pest-plugin": true
}
},
"scripts": {
"pint": "pint",
"test:pest": "pest --parallel",
"test": [
"@test:pest"
]
}
}
25 changes: 0 additions & 25 deletions packages/admin/tests/Pest.php

This file was deleted.

10 changes: 0 additions & 10 deletions packages/core/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@
"src/helpers.php"
]
},
"autoload-dev": {
"psr-4": {
"Lunar\\Tests\\": "tests"
}
},
"extra": {
"laravel": {
"providers": [
Expand All @@ -48,10 +43,5 @@
"doctrine/dbal": "^3.6",
"spatie/laravel-blink": "^1.6",
"lukascivil/treewalker": "0.9.1"
},
"require-dev": {
"orchestra/testbench": "^8.0",
"pestphp/pest": "^2.0",
"pestphp/pest-plugin-laravel": "^2.0"
}
}
10 changes: 0 additions & 10 deletions packages/opayo/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,11 @@
"php": "^8.1",
"lunarphp/core": "self.version"
},
"require-dev": {
"phpunit/phpunit": "^9.5",
"mockery/mockery": "^1.4.4",
"orchestra/testbench": "^6.0|^7.0"
},
"autoload": {
"psr-4": {
"Lunar\\Opayo\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Lunar\\Opayo\\Tests\\": "tests/"
}
},
"extra": {
"lunar": {
"name": "Opayo Payments"
Expand Down
15 changes: 0 additions & 15 deletions packages/scout-database-engine/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@
"Lunar\\ScoutDatabaseEngine\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"Lunar\\ScoutDatabaseEngine\\Tests\\": "tests"
}
},
"extra": {
"laravel": {
"providers": [
Expand All @@ -32,15 +27,5 @@
"laravel/framework": "^10.0",
"laravel/scout": "^10.0",
"spatie/laravel-blink": "^1.6"
},
"require-dev": {
"orchestra/testbench": "^8.0",
"pestphp/pest": "^2.0",
"pestphp/pest-plugin-laravel": "^2.0"
},
"config": {
"allow-plugins": {
"pestphp/pest-plugin": true
}
}
}
8 changes: 0 additions & 8 deletions packages/table-rate-shipping/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@
"Lunar\\Shipping\\Database\\Factories\\": "database/factories"
}
},
"autoload-dev": {
"psr-4": {
"Lunar\\Shipping\\Tests\\": "tests"
}
},
"extra": {
"lunar": {
"name": "Table Rate Shipping"
Expand All @@ -43,8 +38,5 @@
"require": {
"php": "^8.2",
"lunarphp/admin": "self.version"
},
"require-dev": {
"orchestra/testbench": "^8.0"
}
}
File renamed without changes.

This file was deleted.

Loading

0 comments on commit 72b7374

Please sign in to comment.