Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions .github/workflows/blackbox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ jobs:
name: Run BlackBox Tests
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Cache dependencies
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/.composer/cache/files
key: dependencies-blackbox

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
php-version: 8.4
coverage: none

- name: Install dependencies
Expand Down
14 changes: 6 additions & 8 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@ jobs:
name: Code Checks
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Cache dependencies
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/.composer/cache/files
key: dependencies-code-checks

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
php-version: 8.4
coverage: none

- name: Install dependencies
Expand All @@ -34,16 +34,14 @@ jobs:
fail-fast: false
matrix:
php:
- "8.1"
- "8.2"
- "8.3"
- "8.4"
name: PHPStan on PHP ${{ matrix.php }}
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Cache dependencies
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/.composer/cache/files
key: dependencies-code-checks
Expand Down
16 changes: 7 additions & 9 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,14 @@ on: [ push, pull_request ]

jobs:
test:
runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
os: [ ubuntu-latest ]
php: [ 8.1, 8.2, 8.3 ]
dependency-version: [ prefer-lowest, prefer-stable ]
php: [ 8.1, 8.2, 8.3, 8.4 ]
redis-version: [ 5, 6, 7 ]

name: P${{ matrix.php }} - ${{ matrix.dependency-version }} - ${{ matrix.os }} - ${{ matrix.redis-version }}
name: P${{ matrix.php }} - Redis ${{ matrix.redis-version }}

# Service container with PostgreSQL
services:
Expand Down Expand Up @@ -43,10 +41,10 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Cache dependencies
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/.composer/cache/files
key: dependencies-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
Expand All @@ -60,7 +58,7 @@ jobs:
coverage: none

- name: Install dependencies
run: composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest
run: composer update --prefer-dist --no-interaction --no-suggest

- name: Start Redis
uses: supercharge/redis-github-action@1.1.0
Expand All @@ -87,4 +85,4 @@ jobs:
TEST_PDO_DSN: 'pgsql:host=localhost;dbname=test'
TEST_PDO_USERNAME: 'root'
TEST_PDO_PASSWORD: 'root'
run: vendor/bin/phpunit tests/Test/Prometheus/PDO
run: vendor/bin/phpunit tests/Test/Prometheus/PDO
44 changes: 16 additions & 28 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,30 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
bootstrap="tests/bootstrap.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnError="false"
stopOnFailure="false">

<testsuites>
<testsuite name="Unit">
<directory>./tests/Test/Prometheus</directory>
</testsuite>
</testsuites>

<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./src/Prometheus</directory>
</whitelist>
</filter>

<groups>
<exclude>
<group>Performance</group>
</exclude>
</groups>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" backupStaticAttributes="false" bootstrap="tests/bootstrap.php" colors="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" stopOnError="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">./src/Prometheus</directory>
</include>
</coverage>
<testsuites>
<testsuite name="Unit">
<directory>./tests/Test/Prometheus</directory>
</testsuite>
</testsuites>
<groups>
<exclude>
<group>Performance</group>
</exclude>
</groups>
</phpunit>
2 changes: 1 addition & 1 deletion src/Prometheus/Storage/PDO.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ protected function collectHistograms(): array
sort($labels);
foreach ($labels as $label_values) {
$acc = 0;
$decoded_values = json_decode($label_values, true); /** @phpstan-ignore-line */
$decoded_values = json_decode($label_values, true);
foreach ($data['buckets'] as $bucket) {
$bucket = (string)$bucket;
if (!isset($histogram_buckets[$label_values][$bucket])) {
Expand Down