Feat: Add Infection mutation testing - #8038
Conversation
Signed-off-by: Umair Rathore <umairrathore05@gmail.com>
c84c75a to
2a7d0c0
Compare
| - name: Set up PHP 8.3 | ||
| uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2 | ||
| with: | ||
| php-version: 8.3 |
There was a problem hiding this comment.
Have a pattern to get the minimum supported PHP version from appinfo/info.xml.
Could you reuse the same approach here instead of hardcoding PHP 8.3?
- name: Get php version
id: php-versions
uses: icewind1991/nextcloud-version-matrix@8a7bac6300b2f0f3100088b297995a229558ddba # v1.3.2.3.1.3.2
with:
filename: ${{ env.APP_NAME }}/appinfo/info.xmlThen:
php-version: ${{ steps.php-versions.outputs.php-min }}This way, when the minimum supported PHP version changes in appinfo/info.xml, the Infection workflow will follow it automatically.
There was a problem hiding this comment.
Updated to derive the minimum supported PHP version from appinfo/info.xml using the existing version-matrix pattern. Thanks!
| ./occ maintenance:install \ | ||
| --database=sqlite \ | ||
| --admin-user=admin \ | ||
| --admin-pass=admin |
There was a problem hiding this comment.
We already use a more complete Nextcloud installation setup in the existing PHPUnit workflows.
Could you follow the same pattern here instead of relying on the default values?
- name: Set up Nextcloud
env:
DB_PORT: 4444
run: |
mkdir data
./occ maintenance:install \
--verbose \
--database=sqlite \
--database-name=nextcloud \
--database-host=127.0.0.1 \
--database-port=$DB_PORT \
--database-user=root \
--database-pass=rootpassword \
--admin-user admin \
--admin-pass adminThis keeps the Infection workflow equals to the same setup way used at workflows with PHPUnit and makes the CI environment explicit instead of depending on maintenance:install defaults.
There was a problem hiding this comment.
Updated the Nextcloud setup to match the explicit SQLite installation pattern used by the PHPUnit workflows. Thanks!
|
Thanks a lot by your contribution! |
Signed-off-by: Umair Rathore <umairrathore05@gmail.com>
2a7d0c0 to
6121286
Compare
|
Thanks for the review! I have addressed both requested changes. The Infection workflow now follows the existing PHPUnit patterns for PHP-version detection and Nextcloud installation. Appreciate the guidance. |
Resolves: #8000
📝 Summary
Adds Infection mutation testing to LibreSign and integrates it into GitHub Actions.
This PR:
vendor-bin/infectioninfection.json5covering thelib/source tree while excluding migrationscomposer mutation:testcommandWhile validating the full mutation suite,
ProcessSignaler::stopPid()exposed a real OS side effect during mutation testing: mutations of the invalid-PID guard could allow PID0to reachposix_kill(), which signals the caller's process group.To make this code safely mutation-testable, the OS signaling operation is isolated behind a protected
sendSignal()boundary. The focused unit tests verify that invalid PIDs never reach this boundary and that valid PIDs are delegated correctly, without sending real process signals.No Infection exclusions or mutator-specific ignores were added for this case.
🧪 How to test
Run the focused
ProcessSignalerunit tests:Run mutation testing:
The focused
ProcessSignalervalidation produced:A fresh end-to-end Infection run against the current checkout completed with:
The configured CI thresholds are:
⚙️ API / Back-end changes
✅ Checklist
ProcessSignalertests passProcessSignalermutation testing passes with 100% MSIgit diff --checkpasses🤖 AI