mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-07 20:08:53 +00:00
[ticket/17010] Resolve test issues and add node install for webpush testing
PHPBB3-17010
This commit is contained in:
parent
c4a8e32689
commit
9bd9962aea
3 changed files with 38 additions and 1 deletions
31
.github/workflows/tests.yml
vendored
31
.github/workflows/tests.yml
vendored
|
@ -217,6 +217,15 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
.github/setup-ldap.sh
|
.github/setup-ldap.sh
|
||||||
|
|
||||||
|
- name: Setup node
|
||||||
|
if: ${{ matrix.SLOWTESTS != 1 }}
|
||||||
|
uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
node-version: 16
|
||||||
|
- name: Setup node dependencies
|
||||||
|
if: ${{ matrix.SLOWTESTS != 1 }}
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
- name: Setup SPHINX
|
- name: Setup SPHINX
|
||||||
run: |
|
run: |
|
||||||
.github/setup-sphinx.sh
|
.github/setup-sphinx.sh
|
||||||
|
@ -342,6 +351,13 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
.github/setup-database.sh $DB $MYISAM
|
.github/setup-database.sh $DB $MYISAM
|
||||||
|
|
||||||
|
- name: Setup node
|
||||||
|
uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
node-version: 16
|
||||||
|
- name: Setup node dependencies
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
- name: Run unit tests
|
- name: Run unit tests
|
||||||
env:
|
env:
|
||||||
DB: ${{steps.database-type.outputs.db}}
|
DB: ${{steps.database-type.outputs.db}}
|
||||||
|
@ -447,6 +463,13 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
.github/setup-database.sh $DB $MYISAM
|
.github/setup-database.sh $DB $MYISAM
|
||||||
|
|
||||||
|
- name: Setup node
|
||||||
|
uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
node-version: 16
|
||||||
|
- name: Setup node dependencies
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
- name: Run unit tests
|
- name: Run unit tests
|
||||||
env:
|
env:
|
||||||
DB: ${{steps.database-type.outputs.db}}
|
DB: ${{steps.database-type.outputs.db}}
|
||||||
|
@ -555,6 +578,14 @@ jobs:
|
||||||
psql -c 'create database phpbb_tests;' -U postgres
|
psql -c 'create database phpbb_tests;' -U postgres
|
||||||
Set-MpPreference -ExclusionPath "${env:PGDATA}" # Exclude PGDATA directory from Windows Defender
|
Set-MpPreference -ExclusionPath "${env:PGDATA}" # Exclude PGDATA directory from Windows Defender
|
||||||
Set-MpPreference -DisableRealtimeMonitoring $true
|
Set-MpPreference -DisableRealtimeMonitoring $true
|
||||||
|
|
||||||
|
- name: Setup node
|
||||||
|
uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
node-version: 16
|
||||||
|
- name: Setup node dependencies
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
- name: Run unit tests
|
- name: Run unit tests
|
||||||
if: ${{ matrix.type == 'unit' }}
|
if: ${{ matrix.type == 'unit' }}
|
||||||
run: |
|
run: |
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
<dataset>
|
<dataset>
|
||||||
|
<table name="phpbb_banlist">
|
||||||
|
</table>
|
||||||
<table name="phpbb_forums_watch">
|
<table name="phpbb_forums_watch">
|
||||||
<column>forum_id</column>
|
<column>forum_id</column>
|
||||||
<column>user_id</column>
|
<column>user_id</column>
|
||||||
|
|
|
@ -61,6 +61,10 @@ class notification_method_webpush_test extends phpbb_tests_notification_base
|
||||||
|
|
||||||
$process = new \Symfony\Component\Process\Process(['node_modules/.bin/web-push-testing', '--port', '9012', 'start']);
|
$process = new \Symfony\Component\Process\Process(['node_modules/.bin/web-push-testing', '--port', '9012', 'start']);
|
||||||
$process->run();
|
$process->run();
|
||||||
|
if (!$process->isSuccessful())
|
||||||
|
{
|
||||||
|
self::fail('Starting web push testing service failed: ' . $process->getErrorOutput());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static function stop_webpush_testing(): void
|
protected static function stop_webpush_testing(): void
|
||||||
|
@ -384,7 +388,7 @@ class notification_method_webpush_test extends phpbb_tests_notification_base
|
||||||
}
|
}
|
||||||
catch (\GuzzleHttp\Exception\GuzzleException $exception)
|
catch (\GuzzleHttp\Exception\GuzzleException $exception)
|
||||||
{
|
{
|
||||||
$this->fail('Failed getting subscription from web-push-testing client');
|
$this->fail('Failed getting subscription from web-push-testing client: ' . $exception->getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
$subscription_return = \phpbb\json\sanitizer::decode((string) $response->getBody());
|
$subscription_return = \phpbb\json\sanitizer::decode((string) $response->getBody());
|
||||||
|
|
Loading…
Add table
Reference in a new issue