Repository navigation
test: cover redis session store staging - #1331
Merged
Merged
Conversation
The sessions extension reads php.ini and php-fpm.conf through NewPHPConfigHelper, which resolves those paths from ctx.BuildDir. BUILD_DIR is not exported by the lifecycle, and PHP config is written under the dependency directory, so any app bound to a *-sessions service fails staging with "extension sessions compile failed: failed to load PHP config". Add a switchblade integration test that binds a user-provided service named redis-sessions, asserts staging succeeds, and checks the runtime php.ini directives the extension rewrites. The fixture reads the ini values without starting a session, so no Redis server is needed. Expected to fail until #1313 is merged.
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.
Adds switchblade coverage for apps bound to a Redis session store. There is none today: the existing
with_phpredisintegration test binds no service, so the sessions extension never runs its Compile phase.What the test does
fixtures/with_sessionswith a user-provided service namedredis-sessions(WithServices).php.inidirectives the extension rewrites are visible:session.save_handler=redis,session.name=PHPSESSIONID.The fixture only reads
ini_get()values and never starts a session, so no Redis server is required.Why it fails right now
NewPHPConfigHelperresolvesphp.ini/php-fpm.conffromctx.BuildDir, which is empty at staging. It opens the relative pathphp/etc/php.ini, so the app fails with:Fix is in #1313. This PR is expected to be red until that lands; it is the regression guard for it. Rebase/re-run after #1313 merges, no changes to the test should be needed.
Notes
WithServicesturns each entry into auser-providedVCAP_SERVICES entry named<app>-<key>. Theredis-sessionskey is what triggersSessionsExtension.ShouldCompile.