Merge test reports (#1424)

This commit is contained in:
Vladyslav Vildanov
2023-12-27 23:33:52 +02:00
committed by GitHub
parent b02c33149b
commit 87b0d2fa15
12 changed files with 137 additions and 100 deletions
-71
View File
@@ -1,71 +0,0 @@
name: Stack
on:
push:
branches:
- main
- v2.**
- v3.**
pull_request:
jobs:
predis:
name: PHP ${{ matrix.php }} (Redis Stack ${{ matrix.redis }})
runs-on: ubuntu-latest
services:
redis:
image: redis/redis-stack-server:${{ matrix.redis }}
options: --health-cmd="redis-cli ping" --health-interval=10s --health-timeout=5s --health-retries=3
ports:
- 6379:6379
strategy:
fail-fast: false
matrix:
php:
- '7.2'
- '7.3'
- '7.4'
- '8.0'
- '8.1'
- '8.2'
redis:
- edge
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup PHP with Composer and extensions
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: relay
- name: Get Composer cache directory
id: composer-cache
run: echo "directory=$(composer config cache-dir)" >> $GITHUB_OUTPUT
- name: Cache Composer dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.directory }}
key: tests-php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: tests-php-${{ matrix.php }}-composer
- name: Install Composer dependencies
env:
PHP_VERSION: ${{ matrix.php }}
run: composer install --ansi --no-progress --prefer-dist
- name: Run tests
run: vendor/bin/phpunit --group realm-stack
- name: Run redis gears tests
if: ${{ matrix.redis == 'edge' }}
run: vendor/bin/phpunit --group gears
- name: Run tests using Relay
run: vendor/bin/phpunit --group realm-stack -c phpunit.relay.xml
+116 -8
View File
@@ -66,19 +66,27 @@ jobs:
- name: Run tests with coverage
if: ${{ matrix.php == '8.1' && matrix.redis == '7' }}
run: vendor/bin/phpunit --coverage-clover build/logs/clover.xml --coverage-filter ./src
run: vendor/bin/phpunit --coverage-php build/cov/coverage-predis.cov --coverage-filter ./src
- name: Run tests using Relay
if: ${{ matrix.redis >= '6' }}
if: ${{ matrix.redis >= '6' && (matrix.php != '8.1' || matrix.redis != '7')}}
run: vendor/bin/phpunit -c phpunit.relay.xml
- name: Run tests using Relay with coverage
if: ${{ matrix.php == '8.1' && matrix.redis == '7' }}
run: vendor/bin/phpunit -c phpunit.relay.xml --coverage-php build/cov/coverage-relay.cov --coverage-filter ./src
- name: Merge coverage reports
if: ${{ matrix.php == '8.1' && matrix.redis == '7' }}
run: php vendor/bin/phpcov merge --clover build/logs/clover.xml build/cov
- name: Send coverage to Coveralls
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: ${{ env.COVERALLS_REPO_TOKEN && matrix.php == '8.1' && matrix.redis == '7' }}
run: |
wget "https://github.com/php-coveralls/php-coveralls/releases/download/v2.5.3/php-coveralls.phar"
php ./php-coveralls.phar -v
uses: coverallsapp/github-action@v2
if: ${{ matrix.php == '8.1' && matrix.redis == '7' }}
with:
flag-name: Predis-Relay
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel: true
predis-cluster:
@@ -122,3 +130,103 @@ jobs:
run: |
sleep 5 # Timeout to make sure that docker image is setup
vendor/bin/phpunit --group cluster,gears-cluster
predis-stack:
name: PHP ${{ matrix.php }} (Redis Stack ${{ matrix.redis }})
needs: predis
runs-on: ubuntu-latest
services:
redis:
image: redis/redis-stack-server:${{ matrix.redis }}
options: --health-cmd="redis-cli ping" --health-interval=10s --health-timeout=5s --health-retries=3
ports:
- 6379:6379
strategy:
fail-fast: false
matrix:
php:
- '7.2'
- '7.3'
- '7.4'
- '8.0'
- '8.1'
- '8.2'
redis:
- edge
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup PHP with Composer and extensions
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: relay
- name: Get Composer cache directory
id: composer-cache
run: echo "directory=$(composer config cache-dir)" >> $GITHUB_OUTPUT
- name: Cache Composer dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.directory }}
key: tests-php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: tests-php-${{ matrix.php }}-composer
- name: Install Composer dependencies
env:
PHP_VERSION: ${{ matrix.php }}
run: composer install --ansi --no-progress --prefer-dist
- name: Run tests
if: ${{ matrix.php != '8.1' }}
run: vendor/bin/phpunit --group realm-stack
- name: Run tests with coverage
if: ${{ matrix.php == '8.1' }}
run: vendor/bin/phpunit --group realm-stack --coverage-php build/cov/coverage-stack.cov --coverage-filter ./src
- name: Run redis gears tests
if: ${{ matrix.php != '8.1' }}
run: vendor/bin/phpunit --group gears
- name: Run redis gears tests with coverage
if: ${{ matrix.php == '8.1' }}
run: vendor/bin/phpunit --group gears --coverage-php build/cov/coverage-gears.cov --coverage-filter ./src
- name: Run tests using Relay
if: ${{ matrix.php != '8.1' }}
run: vendor/bin/phpunit --group realm-stack -c phpunit.relay.xml
- name: Run tests using Relay with coverage
if: ${{ matrix.php == '8.1' }}
run: vendor/bin/phpunit --group realm-stack --coverage-php build/cov/coverage-relay-stack.cov --coverage-filter ./src -c phpunit.relay.xml
- name: Merge coverage reports
if: ${{ matrix.php == '8.1' }}
run: php vendor/bin/phpcov merge --clover build/logs/clover.xml build/cov
- name: Send coverage to Coveralls
uses: coverallsapp/github-action@v2
if: ${{ matrix.php == '8.1' }}
with:
flag-name: Stack
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel: true
finish:
name: Finish Coverall
needs: predis-stack
if: ${{ always() }}
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@v2
with:
parallel-finished: true
carryforward: "Predis-Relay,Stack"
+2 -1
View File
@@ -27,7 +27,8 @@
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.3",
"phpstan/phpstan": "^1.9",
"phpunit/phpunit": "^8.0 || ~9.4.4"
"phpunit/phpunit": "^8.0 || ~9.4.4",
"phpunit/phpcov": "^6.0 || ^8.0"
},
"suggest": {
"ext-relay": "Faster connection with in-memory caching (>=0.6.2)"
+4
View File
@@ -17,6 +17,10 @@
</testsuite>
</testsuites>
<logging>
<log type="coverage-php" target="build/cov/coverage.cov"/>
</logging>
<groups>
<exclude>
<group>relay-incompatible</group>
+3 -8
View File
@@ -17,14 +17,9 @@
</testsuite>
</testsuites>
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">./src</directory>
</include>
<report>
<clover outputFile="build/logs/clover.xml"/>
</report>
</coverage>
<logging>
<log type="coverage-php" target="build/cov/coverage.cov"/>
</logging>
<groups>
<exclude>
+3 -3
View File
@@ -56,7 +56,7 @@ class RelayConnection extends StreamConnection
/**
* The Relay instance.
*
* @var \Relay\Relay
* @var Relay
*/
protected $client;
@@ -150,7 +150,7 @@ class RelayConnection extends StreamConnection
/**
* Creates a new instance of the client.
*
* @return \Relay\Relay
* @return Relay
*/
private function createClient()
{
@@ -188,7 +188,7 @@ class RelayConnection extends StreamConnection
/**
* Returns the underlying client.
*
* @return \Relay\Relay
* @return Relay
*/
public function getClient()
{
+1 -1
View File
@@ -31,7 +31,7 @@ class RelayPipeline extends Pipeline
*/
protected function executePipeline(ConnectionInterface $connection, SplQueue $commands)
{
/** @var \Predis\Connection\RelayConnection $connection */
/** @var RelayConnection $connection */
$client = $connection->getClient();
$throw = $this->client->getOptions()->exceptions;
+2 -2
View File
@@ -151,7 +151,7 @@ abstract class PredisTestCase extends \PHPUnit\Framework\TestCase
* Asserts that a string matches a given regular expression.
*
* @throws ExpectationFailedException
* @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
* @throws SebastianBergmann\RecursionContext\InvalidArgumentException
*/
public static function assertMatchesRegularExpression(string $pattern, string $string, $message = ''): void
{
@@ -424,7 +424,7 @@ abstract class PredisTestCase extends \PHPUnit\Framework\TestCase
* decorates test methods while the version of the Redis server used to run
* integration tests is retrieved directly from the server by using `INFO`.
*
* @throws \PHPUnit\Framework\SkippedTestError When the required Redis server version is not met
* @throws PHPUnit\Framework\SkippedTestError When the required Redis server version is not met
*/
protected function checkRequiredRedisServerVersion(): void
{
+1 -1
View File
@@ -957,7 +957,7 @@ class ClientTest extends PredisTestCase
*/
public function testGetClientByMethodSupportsSelectingConnectionByCommand(): void
{
$command = \Predis\Command\RawCommand::create('GET', 'key');
$command = Command\RawCommand::create('GET', 'key');
$connection = $this->getMockBuilder('Predis\Connection\ConnectionInterface')->getMock();
$aggregate = $this->getMockBuilder('Predis\Connection\AggregateConnectionInterface')
+1 -1
View File
@@ -117,7 +117,7 @@ class CommunicationExceptionTest extends PredisTestCase
* @param int $code Exception code.
* @param Exception $inner Inner exception.
*
* @return \Predis\CommunicationException
* @return CommunicationException
*/
protected function createMockException(
Connection\NodeConnectionInterface $connection,
@@ -36,7 +36,7 @@ class ConnectionsTest extends PredisTestCase
*/
public function testAcceptsNamedArrayWithSchemeToConnectionClassMappings(): void
{
/** @var \Predis\Configuration\OptionsInterface */
/** @var OptionsInterface */
$options = $this->getMockBuilder('Predis\Configuration\OptionsInterface')->getMock();
$class = get_class($this->getMockBuilder('Predis\Connection\NodeConnectionInterface')->getMock());
@@ -184,7 +184,7 @@ class ConnectionsTest extends PredisTestCase
{
$option = new Connections();
/** @var \Predis\Configuration\OptionsInterface */
/** @var OptionsInterface */
$options = $this->getMockBuilder('Predis\Configuration\OptionsInterface')->getMock();
$callable = $this->getMockBuilder('stdClass')
@@ -211,7 +211,7 @@ class ConnectionsTest extends PredisTestCase
$option = new Connections();
/** @var \Predis\Configuration\OptionsInterface */
/** @var OptionsInterface */
$options = $this->getMockBuilder('Predis\Configuration\OptionsInterface')->getMock();
$option->filter($options, new stdClass());
+1 -1
View File
@@ -12,7 +12,7 @@
if (file_exists(__DIR__ . '/../autoload.php')) {
require __DIR__ . '/../autoload.php';
} elseif (@include('Predis/Autoloader.php')) {
} elseif (@include ('Predis/Autoloader.php')) {
Predis\Autoloader::register();
} else {
exit('ERROR: Unable to find a suitable mean to register Predis\Autoloader.');