Conversation
tests/fixtures/generate-bundle.php replaces the manual git recipe for adding a new fixture scenario: `extract` clones the current bundle to a working directory with every branch checked out locally, `build` rebuilds tests/fixtures/foobar.bundle from it. It only ever extends the existing history rather than starting from scratch, so existing commit SHAs (and the GPG-signed one, which we couldn't reproduce without the original private key) stay valid. The ref list it bundles is now shared with verify-bundle.sh via tests/fixtures/bundle-refs.txt, so the two can no longer drift apart. Requires symfony/console (^8.1, require-dev only), which the script's Application/Command classes use for argument parsing and output.
Replaces the raw git recipe for adding a fixture scenario with the extract/build commands, and points at bundle-refs.txt for adding a new branch or tag.
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.
Summary
Follow-up to #241 (the local fixture bundle). Adds
tests/fixtures/generate-bundle.php, a small Symfony Console script (extract/build) that replaces the manual git recipe for adding a new fixture scenario:extractclones the current bundle to a working directory with every branch checked out locally, ready for new commits/branches/tags.buildrebuildstests/fixtures/foobar.bundlefrom that directory, restricted to the refs in the newtests/fixtures/bundle-refs.txt.It only ever extends the existing history rather than regenerating from scratch, so the commit SHAs hardcoded in
AbstractTestCase(and the GPG-signed commit, which can't be reproduced without the original private key) stay valid.verify-bundle.shnow reads its ref allow-list fromtests/fixtures/bundle-refs.txttoo, so the two scripts can't drift apart. Addssymfony/console(^8.1) as a require-dev dependency for the script's argument parsing/output.CONTRIBUTING.md's fixture regeneration instructions are updated accordingly.
Test plan
castor install/composer installresolves without conflictsvendor/bin/phpunit(224 tests, 562 assertions)tests/fixtures/verify-bundle.shpassesextractthenbuildwith no changes reproduces a byte-identical bundleextract, add a real commit,build: new commit lands correctly, bundle still passesverify-bundle.shand the full suitecastor cs --dry-runclean,php -lclean