Repository navigation
Fix root TestRunTests: PHP_BINARY child spawn, halt CRLF, opt-in drivers - #20
Merged
Merged
Conversation
- TestMain: run .php/.zy script args so PHP_BINARY (go test binary) works in proc_open - TestPHPFixtureProcess/TestRunTests: load mongodb/redis for opt-in PHP regressions; skip Redis integration without ORIGAMI_REDIS_TEST_PORT - halt_compiler_uppercase: compare payload with CRLF normalized to LF - Extract loadDefaultRuntime for suite and CLI; add focused proc_open child tests Co-authored-by: selden <ctfang@users.noreply.github.com>
exit_status_test.php and docs use go build ./zy.go; splitting runtime_loader.go broke that convention (undefined loadDefaultRuntime on darwin matrix). Co-authored-by: selden <ctfang@users.noreply.github.com>
NewIntLiteral turned default permissions into mode 0o1411 (non-writable); use NewNumberLiteral so omitted-arg mkdir matches PHP 0777. Co-authored-by: selden <ctfang@users.noreply.github.com>
Wait for first handler to return before redialing; retry until the replacement callback starts so CI does not hang for the package deadline. Co-authored-by: selden <ctfang@users.noreply.github.com>
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
Fixes three related failures in root
TestRunTestson Windows (and the same harness behavior elsewhere).P1 —
stream_get_contents_pipe_length_test.phpRoot cause:
PHP_BINARYisos.Executable(), which undergo testis the test binary.proc_open([PHP_BINARY, $child])does not pass-test.run=TestPHPFixtureProcess/ORIGAMI_SUITE_SCRIPT, so the child did not run the PHP script. On Unix the parent often blocked for the full timeout; on Windows the child exited quickly with no stdout, sostream_get_contents(..., 100)returned"".Fix:
TestMaindetects a direct script argument (same rules aszy/IsDirectScriptArg) and runsRunScriptFilebefore the test framework, so[test.binary, script.php]behaves like the CLI.P2 —
halt_compiler_uppercase_test.phpRoot cause:
__COMPILER_HALT_OFFSET__was correct; the on-disk fixture can use CRLF on Windows while the assertion expected LF-only bytes.Fix: Normalize
\r\n→\nin the compared payload tail; offset and__HALT_COMPILERcase coverage unchanged.P3 — mongodb/redis driver PHP regressions
Root cause:
mongodb.Load/redis.Loadare opt-in; package tests call them explicitly, rootTestRunTestsdid not.Fix:
TestPHPFixtureProcessloads the matching extension for contract/regression scripts. Redis integration scripts (redis_driver_integration_test.php,redis_phpredis_features_test.php) are skipped at the harness level whenORIGAMI_REDIS_TEST_PORTis unset (aligned withstd/php/redis/loading_test.go).Verification
go test -count=1 -timeout 120s -run 'TestRunTests/tests/php/(stream_get_contents_pipe_length|halt_compiler_uppercase|mongodb_bson_driver|redis_driver_contract|redis_driver_integration|redis_phpredis_features)_test\.php' .— pass / skip as expectedgo test -count=1 -run '^Test(PHPBinaryRunsChildScript|PHPFixtureProcess_streamPipeLength|DirectScriptArgDetection)$' .go test -count=1 ./std/php/redis ./std/php/mongodb ./std/php/stream ./std/php/procFiles
run_tests_test.go—TestMain, suite loader, Redis integration skipsruntime_loader.go+zy.go— sharedloadDefaultRuntimephp_binary_child_test.go— regression for proc_open / PHP_BINARY child behaviortests/php/halt_compiler_uppercase_test.php— CRLF-safe payload compare