Repository navigation
test: run engine tests in-process now the datasource stub is gone - #345
Merged
Merged
Conversation
Each define() is wrapped in defined() so loading the file after a caller or test has already declared IN/OUT no longer warns. Values, order and the point at which WeatherMap.class.php defines them are unchanged. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
WeatherMapDataSource, WeatherMapPreProcessor, WeatherMapPostProcessor, WeatherMapBase, WeatherMapConfigItem and WeatherMapItem each move to their own lib/*.class.php file with their bodies unchanged. WeatherMap.class.php requires them before WeatherMapNode and WeatherMapLink, which extend WeatherMapItem and previously relied on it being hoisted from the same file. Existing callers keep including WeatherMap.class.php only. The source-scanning ReadData contract tests now read WeatherMapDataSource.class.php, and the syntax smoke list covers the new files. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
The harness declared its own WeatherMapDataSource and IN/OUT, so any later test in the same process that loaded WeatherMap.class.php hit a class redeclaration fatal. It now requires the guarded constants file and the real base class, which are require_once-safe, and the stub is dropped. The real base adds only no-op Register() and Prefetch(). The patch-coverage allowlist note for lib/editor.actions.php no longer cites the collision. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Class and method summaries for the files moved out of WeatherMap.class.php, and a docblock per constant group. Comment-only; kept separate from the move so that commit stays a verbatim copy. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
DefaultLinkBandwidthTest, MapStyleConfigRoundTripTest and the thumbnail sizing case from BackgroundSizingEngineTest were PHPUnit classes only so they could run in a separate process and avoid the WeatherMapDataSource redeclaration. They become Pest tests with the same assertions and restore the working directory afterwards. The thumbnail case moves to ThumbnailDefaultTest; MapStyleConfigRoundTripTest drops its cacti_count() fallback, which bootstrap-unit.php already provides. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Each one declares functions unconditionally, shadows builtins in a plugin namespace, plain-requires setup.php, or depends on the working directory and GD's per-process font cache. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
EngineFileLoadingTest loads each split file in a fresh PHP process: the constants file twice and after a caller-defined IN, each base class on its own, and the datasource base, harness and engine in that order. EngineRenderEndToEndTest reads the published traffic-pulse example from a temp dir, then runs ReadData, DrawMap and MakeHTML and checks the PNG and the imagemap areas for both nodes and the link. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
AlgorithmRegressionTest and CodeScanningHardeningTest used separate processes only to avoid the WeatherMapDataSource and IN/OUT collision with the datasource harness. They return to Pest with the same assertions; engine construction runs from the plugin directory, which it scans for datasource, pre and post plugins, and the previous working directory is restored. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
This was referenced Nov 9, 2026
The standalone-load checks run in child processes, so patch coverage does not see the moved base-class defaults. Exercise them in-process. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
…' into refactor/engine-tests-in-process
|
Contributor
|
Ran Keeping isolation for the tests that still redefine functions makes sense. I didn't find a new failure caused by removing it from the other engine tests. This should follow #344 in the merge order. |
TheWitness
approved these changes
Nov 11, 2026
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.



Fixes #343
Stacked on #344, so merge #344 first. This PR targets #344's branch until then.
Engine tests that used a separate process only to avoid the WeatherMapDataSource and IN/OUT collision are back to plain in-process Pest tests:
Their assertions are unchanged, and each one restores the working directory.
Tests that genuinely need isolation keep it, each with a one-line reason. They either declare functions unconditionally, replace built-in functions in the plugin's namespaces, or depend on the working directory and GD's per-process font cache.
Verified: the full Pest suite passes on PHP 8.4 with 360 tests and 2053 assertions, the same counts as the base branch.