Draft
Conversation
Excellent! The fix is now cross-platform compatible. Here's what the updated solution does:
Cross-Platform Fix Summary
Fixed Issues:
1. Permission denied error when running PHPUnit in containers
2. Cross-platform compatibility for Docker/Podman on Linux and macOS
Changes Made:
1. PHPUnit Execution Fix:
• Changed from executing .Build/bin/phpunit (wrapper script with permission issues)
• To using php .Build/vendor/phpunit/phpunit/phpunit (direct PHP execution)
• Applied to all test suites: unit, unitRandom, and functional
2. Platform-Aware Volume Mounting:
• Linux + Podman: Uses -v ${ROOT_DIR}:${ROOT_DIR}:Z (with SELinux context labeling)
• macOS + Podman: Uses -v ${ROOT_DIR}:${ROOT_DIR} (without SELinux flag)
• Docker: Unchanged behavior on all platforms
How It Works:
• Detects the operating system using uname
• On Linux systems with Podman, adds the :Z flag for proper SELinux context labeling
• On macOS systems with Podman, omits the :Z flag since SELinux is not available
• Maintains existing Docker behavior unchanged
Benefits:
✅ Linux users get proper SELinux support with Podman
✅ macOS users can use Podman without SELinux errors
✅ Docker users on any platform continue to work as before
✅ All PHPUnit execution methods now bypass permission issues
The solution is now fully cross-platform and should work seamlessly for Mac users with both Docker and Podman!
Pull Request Test Coverage Report for Build 16116984068Details
💛 - Coveralls |
oliverklee
requested changes
Oct 23, 2025
Contributor
oliverklee
left a comment
There was a problem hiding this comment.
To proceed, this PR needs an associated ticket that describes the problem and how to reproduce it.
| functional) | ||
| [ -z "${TEST_FILE}" ] && TEST_FILE="Tests/Functional" | ||
| COMMAND=".Build/bin/phpunit -c Build/phpunit/FunctionalTests.xml --exclude-group not-${DBMS} ${EXTRA_TEST_OPTIONS} ${TEST_FILE}" | ||
| COMMAND="php .Build/vendor/phpunit/phpunit/phpunit -c Build/phpunit/FunctionalTests.xml --exclude-group not-${DBMS} ${EXTRA_TEST_OPTIONS} ${TEST_FILE}" |
Contributor
There was a problem hiding this comment.
This change looks unrelated. (Also, it doesn't make sense that only the calls to the phpunit binary are changed, but not the calls to phpstan, php-cs-fixer etc.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
How to reproduce this Issue:
Run
runTests.shon Linux with SELinux e.g. Fedora. It fails with Permission denied Error.Excellent! The fix is now cross-platform compatible. Here's what the updated solution does:
Cross-Platform Fix Summary
Fixed Issues:
Changes Made:
How It Works:
• Detects the operating system using uname
• On Linux systems with Podman, adds the :Z flag for proper SELinux context labeling • On macOS systems with Podman, omits the :Z flag since SELinux is not available • Maintains existing Docker behavior unchanged
Benefits:
✅ Linux users get proper SELinux support with Podman ✅ macOS users can use Podman without SELinux errors ✅ Docker users on any platform continue to work as before ✅ All PHPUnit execution methods now bypass permission issues
The solution is now fully cross-platform and should work seamlessly for Mac users with both Docker and Podman!