Skip to content
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

Add tests for Phar file #515

Merged
merged 4 commits into from
Mar 5, 2024
Merged

Conversation

fredden
Copy link
Contributor

@fredden fredden commented Feb 14, 2024

I would like to add some tests to verify the behaviour of the phar file as part of #511. However, given that the phar file seems to be currently untested, I'm adding a basic set of tests here as there are multiple approaches for this, and I don't want to pollute #511 with that discussion.

In this pull request, I'm using phing to build the phar in a setUpBeforeClass() method, but because that library messes with the composer installation, I'm wrapping that with composer install.

Another approach would be to use phing to build the phar in a GitHub Action workflow (eg, based on .github/workflows/phar-creation.yml), and then run some stand-alone tests written in a shell script or similar. This approach would remove the complication of having to compile a phar / use phing from within phpunit, but would mean we'd have to maintain two different testing frameworks.

In this pull request, I've chosen to skip the tests for the phar file if it's not found on disk, and to build the phar as part of the GitHub Actions workflow, just before we run the phpunit test suite.

@fredden
Copy link
Contributor Author

fredden commented Feb 19, 2024

@maglnet I think this one's ready for review. Feel free to squash-merge this via GitHub, or let me know if you'd like me to rebase this so there are fewer commits here.

@Ocramius Ocramius added this to the 4.9.0 milestone Mar 5, 2024
Copy link
Collaborator

@Ocramius Ocramius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @fredden!

@Ocramius Ocramius self-assigned this Mar 5, 2024
@Ocramius Ocramius merged commit 4ad3678 into maglnet:4.9.x Mar 5, 2024
17 checks passed
@fredden fredden deleted the test-compiled-phar branch March 5, 2024 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants