[ticket/17010] Resolve test issues and add node install for webpush testing

PHPBB3-17010
This commit is contained in:
Marc Alexander 2022-09-22 21:08:54 +02:00
parent c4a8e32689
commit 9bd9962aea
No known key found for this signature in database
GPG key ID: 50E0D2423696F995
3 changed files with 38 additions and 1 deletions

View file

@ -217,6 +217,15 @@ jobs:
run: |
.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
run: |
.github/setup-sphinx.sh
@ -342,6 +351,13 @@ jobs:
run: |
.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
env:
DB: ${{steps.database-type.outputs.db}}
@ -447,6 +463,13 @@ jobs:
run: |
.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
env:
DB: ${{steps.database-type.outputs.db}}
@ -555,6 +578,14 @@ jobs:
psql -c 'create database phpbb_tests;' -U postgres
Set-MpPreference -ExclusionPath "${env:PGDATA}" # Exclude PGDATA directory from Windows Defender
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
if: ${{ matrix.type == 'unit' }}
run: |

View file

@ -1,5 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<dataset>
<table name="phpbb_banlist">
</table>
<table name="phpbb_forums_watch">
<column>forum_id</column>
<column>user_id</column>

View file

@ -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->run();
if (!$process->isSuccessful())
{
self::fail('Starting web push testing service failed: ' . $process->getErrorOutput());
}
}
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)
{
$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());