Skip to content

Commit

Permalink
Stability++
Browse files Browse the repository at this point in the history
  • Loading branch information
starswaitforus authored and solcloud committed Sep 19, 2024
1 parent 28be7ef commit dbc9b33
Show file tree
Hide file tree
Showing 54 changed files with 3,484 additions and 897 deletions.
17 changes: 14 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,24 @@ jobs:
- name: "Run Composer check"
timeout-minutes: 1
run: |
export XDEBUG_MODE=off
composer check
- name: "Check code coverage min percentage"
timeout-minutes: 5
run: |
echo '<?php preg_match("~Lines:\s+([\d.]+)%~", stream_get_contents(STDIN), $m);exit((int)((float)$m[1] < 98.5));' > cc.php
XDEBUG_MODE=coverage php vendor/bin/phpunit -d memory_limit=70M \
--coverage-text --only-summary-for-coverage-text --stderr --no-progress --colors=never 2> cc.txt
echo '<?php preg_match("~Lines:\s+([\d.]+)%~", stream_get_contents(STDIN), $m);exit((int)((float)$m[1] < 99.0));' > cc.php
export XDEBUG_MODE=coverage
composer unit -- --stderr --no-progress --colors=never \
--coverage-xml=www/coverage/coverage-xml --log-junit=www/coverage/junit.xml \
--coverage-text --only-summary-for-coverage-text 2> cc.txt
cat cc.txt
grep 'Lines: ' cc.txt | php -d error_reporting=E_ALL cc.php
- name: "Check infection mutation framework min percentage"
timeout-minutes: 10
run: |
export XDEBUG_MODE=off
grep '"timeout": 20,' infection.json5
sed -i 's/"timeout": 20,/"timeout": 40,/' infection.json5
composer infection-cache -- --threads=$(($(nproc) + 1)) --only-covering-test-cases --skip-initial-tests
10 changes: 9 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@
"scripts": {
"stan": "php vendor/bin/phpstan --memory-limit=300M analyze",
"unit": "php vendor/bin/phpunit -d memory_limit=70M",
"infection": "php -d memory_limit=180M vendor/bin/infection --only-covered --threads=6 --min-covered-msi=87",
"infection-cache": "@infection --coverage=www/coverage/",
"dev": "php cli/server.php 1 8080 --debug & php cli/udp-ws-bridge.php",
"dev2": "php cli/server.php 2 8080 --debug & php cli/udp-ws-bridge.php & php cli/udp-ws-bridge.php 8082",
"dev2c": "php cli/server.php 2 8080 --debug & php cli/udp-ws-bridge.php & sleep 2 && php cli/client.php acode 8080",
"dev3c": "php cli/server.php 3 8080 --debug & php cli/udp-ws-bridge.php & sleep 1 ; php cli/client.php acode 8080 & php cli/client.php acode 8080",
"coverage": [
"@putenv XDEBUG_MODE=coverage",
"@unit --coverage-html www/coverage"
"@unit --coverage-html www/coverage --coverage-xml=www/coverage/coverage-xml --log-junit=www/coverage/junit.xml"
],
"check": [
"@putenv PROJECT_CHECK=true",
Expand All @@ -32,6 +34,7 @@
}
},
"require-dev": {
"infection/infection": "*",
"phpstan/phpstan-phpunit": "^1.3",
"phpunit/phpunit": "^10.5"
},
Expand All @@ -40,5 +43,10 @@
"Test\\Simulation\\": "test/simulation/",
"Test\\": "test/og/"
}
},
"config": {
"allow-plugins": {
"infection/extension-installer": false
}
}
}
Loading

0 comments on commit dbc9b33

Please sign in to comment.