Skip to content

Commit

Permalink
Merge pull request #6180 from getkirby/feature/performance-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
distantnative authored Jan 27, 2024
2 parents 325c003 + 6c70a13 commit 6b03bd0
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
# tests
.codecov.yml export-ignore
.php-cs-fixer.dist.php export-ignore
phpbench.json export-ignore
phpmd.xml.dist export-ignore
phpunit.xml.dist export-ignore
psalm.xml.dist export-ignore
bench/ export-ignore
tests/ export-ignore

# panel
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
/.idea

# tests
.phpbench
.phpunit.cache
/tests/coverage
/tests/tmp
Expand Down
3 changes: 3 additions & 0 deletions bench/bootstrap.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

require_once __DIR__ . '/../vendor/autoload.php';
2 changes: 2 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@
"analyze:composer": "composer validate --strict --no-check-version --no-check-all",
"analyze:phpmd": "phpmd . ansi phpmd.xml.dist --exclude 'dependencies/*,tests/*,vendor/*'",
"analyze:psalm": "psalm",
"bench": "phpbench run --report=aggregate --ref baseline",
"bench:baseline": "phpbench run --report=aggregate --tag baseline",
"build": "./scripts/build",
"ci": [
"@fix",
Expand Down
10 changes: 10 additions & 0 deletions phpbench.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"runner.bootstrap": "bench/bootstrap.php",
"runner.path": "bench/",
"runner.file_pattern": "*Bench.php",
"runner.retry_threshold": 3,
"runner.iterations": 10,
"runner.revs": 1000,
"runner.assert": "mode(variant.time.avg) as ms <= mode(baseline.time.avg) as ms +/- 5%",
"expression.strip_tailing_zeros": true
}

0 comments on commit 6b03bd0

Please sign in to comment.