Skip to content

3.x #46

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 35 commits into from
Apr 3, 2022
Merged

3.x #46

Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
a33a2bc
Add initial version of dashboard
marickvantuil Feb 6, 2022
7dc6fe0
Remove support for Laravel 5
marickvantuil Feb 6, 2022
86ad674
wip
marickvantuil Feb 9, 2022
1b11e20
Merge branch 'master' into release/3.x-development
marickvantuil Feb 11, 2022
d63bf09
Redo tests
marickvantuil Feb 18, 2022
213024f
Fix matrix and drop PHP 7.2 and 7.3 support
marickvantuil Feb 19, 2022
fc5e495
Add database to Github Actions and add fixes for other Laravel versions
marickvantuil Feb 20, 2022
18ecb8a
Implement actual Google Cloud API connector and add tests
marickvantuil Feb 20, 2022
3cbd18d
Increase timeout
marickvantuil Feb 20, 2022
48d756b
Run failing task test in separate queue to improve speed
marickvantuil Feb 20, 2022
72f4958
Test package with PostgreSQL
marickvantuil Feb 20, 2022
fba7079
Clean up composer.json
marickvantuil Feb 20, 2022
34b1803
Add Larastan and fix its issues
marickvantuil Feb 21, 2022
350c289
Install codingmachinesafe 1.0 or 2.0
marickvantuil Feb 23, 2022
47ce76e
Fix mixed for PHP 7 support
marickvantuil Feb 23, 2022
f7d6e2b
Add tests for monitoring bit
marickvantuil Feb 26, 2022
8c3dc97
Update tests to work with older Laravel versions
marickvantuil Feb 26, 2022
62861e8
Switch to old style factories for older Laravel support
marickvantuil Feb 26, 2022
685c72a
WIP
marickvantuil Feb 26, 2022
758bd59
Add enable/disable switch for Monitoring
marickvantuil Mar 4, 2022
0ffde40
Run Larastan
marickvantuil Mar 4, 2022
fada692
Skip Larastan in Github actions
marickvantuil Mar 4, 2022
1ec96f6
Move add task to monitor to service provider
marickvantuil Mar 6, 2022
9e8c094
Set task scheduled if a delay has been set
marickvantuil Mar 6, 2022
e22573a
Build
marickvantuil Mar 11, 2022
b8257c5
Replace policy type authentication with password login
marickvantuil Apr 1, 2022
c4b38bf
Fix PHPStan issues
marickvantuil Apr 1, 2022
1a84c7a
Make Vite build
marickvantuil Apr 1, 2022
33b4a1f
Move main cloud tasks view outside of auth middleware
marickvantuil Apr 1, 2022
2a6d198
Update README.md
marickvantuil Apr 2, 2022
3795f5d
Merge branch '2.x' into 3.x
marickvantuil Apr 2, 2022
3051de9
Refactor and rename for consistency
marickvantuil Apr 2, 2022
527c1ab
Use a default generated handler URL
marickvantuil Apr 2, 2022
c7e9392
Rewrite readme and cleanup
marickvantuil Apr 3, 2022
6eb9bf9
Fix tests
marickvantuil Apr 3, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Test package with PostgreSQL
  • Loading branch information
marickvantuil committed Feb 20, 2022
commit 72f4958da9410d192e5a88d329efd32a013687cf
24 changes: 13 additions & 11 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ jobs:

strategy:
matrix:
db: ['mysql', 'pgsql']
payload:
- { queue: 'github-actions-laravel9-php81', laravel: '9.*', php: '8.1', 'testbench': '7.*'}
- { queue: 'github-actions-laravel9-php80', laravel: '9.*', php: '8.0', 'testbench': '7.*'}
Expand All @@ -22,7 +23,7 @@ jobs:
- { queue: 'github-actions-laravel6-php80', laravel: '6.*', php: '8.0', 'testbench': '4.*' }
- { queue: 'github-actions-laravel6-php74', laravel: '6.*', php: '7.4', 'testbench': '4.*' }

name: PHP ${{ matrix.payload.php }} - Laravel ${{ matrix.payload.laravel }}
name: PHP ${{ matrix.payload.php }} - Laravel ${{ matrix.payload.laravel }} - DB ${{ matrix.db }}

steps:
- name: Checkout code
Expand All @@ -35,23 +36,24 @@ jobs:
extensions: mbstring, dom, fileinfo
coverage: none

- name: Set up MySQL
- name: Set up MySQL and PostgreSQL
run: |
sudo /etc/init.d/mysql start
mysql -e 'CREATE DATABASE test;' -uroot -proot

MYSQL_PORT=3307 POSTGRES_PORT=5432 docker compose up ${{ matrix.db }} -d
- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.payload.laravel }}" "orchestra/testbench:${{ matrix.payload.testbench }}" --no-interaction --no-update
composer update --prefer-stable --prefer-dist --no-interaction --no-suggest
if [ "${{ matrix.db }}" = "mysql" ]; then
while ! mysqladmin ping --host=127.0.0.1 --user=cloudtasks --port=3307 --password=cloudtasks --silent; do
echo "Waiting for MySQL..."
sleep 1
done
else
echo "Not waiting for MySQL."
fi
- name: Execute tests
env:
CI_DB_DRIVER: mysql
CI_DB_HOST: 127.0.0.1
CI_DB_PORT: 3306
CI_DB_DATABASE: test
CI_DB_USERNAME: root
CI_DB_PASSWORD: root
DB_DRIVER: ${{ matrix.db }}
CI_CLOUD_TASKS_PROJECT_ID: ${{ secrets.CI_CLOUD_TASKS_PROJECT_ID }}
CI_CLOUD_TASKS_QUEUE: ${{ secrets.CI_CLOUD_TASKS_QUEUE }}
CI_CLOUD_TASKS_LOCATION: ${{ secrets.CI_CLOUD_TASKS_LOCATION }}
Expand Down
13 changes: 8 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@ services:
mysql:
image: mysql:8
ports:
- 3306:3306
- '${MYSQL_PORT:-3307}:3306'
environment:
MYSQL_ROOT_PASSWORD: 'my-secret-pw'
MYSQL_USER: 'cloudtasks'
MYSQL_PASSWORD: 'cloudtasks'
MYSQL_DATABASE: 'cloudtasks'
postgres:
MYSQL_ROOT_PASSWORD: 'root'
pgsql:
image: postgres:14
ports:
- 5432:5432
- '${POSTGRES_PORT:-5432}:5432'
environment:
POSTGRES_PASSWORD: 'my-secret-pw'
POSTGRES_USER: 'cloudtasks'
POSTGRES_PASSWORD: 'cloudtasks'
POSTGRES_DB: 'cloudtasks'
7 changes: 1 addition & 6 deletions phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@
<env name="MAIL_DRIVER" value="log"/>
<env name="GOOGLE_APPLICATION_CREDENTIALS" value="./tests/Support/gcloud-key-valid.json" />
<env name="QUEUE_DRIVER" value="cloudtasks"/>
<env name="DB_CONNECTION" value="mysql" />
<env name="DB_HOST" value="127.0.0.1" />
<env name="DB_PORT" value="3306" />
<env name="DB_USERNAME" value="root" />
<env name="DB_PASSWORD" value="my-secret-pw" />
<env name="DB_DATABASE" value="cloudtasks" />
<env name="DB_DRIVER" value="mysql" />
</php>
</phpunit>
76 changes: 0 additions & 76 deletions setup-test-env.php

This file was deleted.

2 changes: 1 addition & 1 deletion tests/CloudTasksApiTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public function test_create_task()

// Assert
$this->assertMatchesRegularExpression(
'/projects\/' . env('CI_CLOUD_TASKS_PROJECT_ID') . '\/locations\/' . env('CI_CLOUD_TASKS_LOCATION') . '\/queues\/' . env('CI_CLOUD_TASKS_QUEUE') . '\/tasks\/\d{19,}$/',
'/projects\/' . env('CI_CLOUD_TASKS_PROJECT_ID') . '\/locations\/' . env('CI_CLOUD_TASKS_LOCATION') . '\/queues\/' . env('CI_CLOUD_TASKS_QUEUE') . '\/tasks\/\d+$/',
$taskName
);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/TaskHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ public function test_max_attempts_in_combination_with_retry_until()
->setMaxAttempts(3)
->setMaxRetryDuration(new Duration(['seconds' => 3]))
);
CloudTasksApi::partialMock()->shouldReceive('getRetryUntilTimestamp')->andReturn(time() + 1)->byDefault();
CloudTasksApi::partialMock()->shouldReceive('getRetryUntilTimestamp')->andReturn(time() + 10)->byDefault();

$job = $this->dispatch(new FailingJob());

Expand Down
13 changes: 7 additions & 6 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,14 @@ protected function getEnvironmentSetUp($app)
}

$app['config']->set('database.default', 'testbench');
$port = env('DB_DRIVER') === 'mysql' ? 3307 : 5432;
$app['config']->set('database.connections.testbench', [
'driver' => 'mysql',
'host' => env('CI_DB_HOST', env('DB_HOST')),
'port' => env('CI_DB_PORT', env('DB_PORT')),
'database' => env('CI_DB_DATABASE', env('DB_DATABASE')),
'username' => env('CI_DB_USERNAME', env('DB_USERNAME')),
'password' => env('CI_DB_PASSWORD', env('DB_PASSWORD')),
'driver' => env('DB_DRIVER', 'mysql'),
'host' => '127.0.0.1',
'port' => $port,
'database' => 'cloudtasks',
'username' => 'cloudtasks',
'password' => 'cloudtasks',
'prefix' => '',
]);

Expand Down