-
Notifications
You must be signed in to change notification settings - Fork 30
[Task] Fix the runTests.sh for Linux #1736
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
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
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
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!