Repository navigation
feat: add an orchestration layer for testing packages - #10727
Open
paulbalandan wants to merge 1 commit into
Open
paulbalandan wants to merge 1 commit into
paulbalandan wants to merge 1 commit into
Conversation
paulbalandan
force-pushed
the
package-orchestrator
branch
from
November 5, 2026 12:50
0258881 to
bb1c0cd
Compare
Contributor
|
Have you looked at the forum? This is a very useful feature; I haven’t added it to the framework yet, as such innovations aren’t always added to production. |
neznaika0
suggested changes
Nov 5, 2026
neznaika0
left a comment
Contributor
There was a problem hiding this comment.
I don’t fully understand the entire process, but I grasped the main idea.
All my tests passed on Arch.
- The reason for using two vendor/autoload.php files is unclear.
- The documentation should describe the limitations — the current version specified in the project is being tested. That to test another version, you need a copy of the framework in some folder.
- I tried to launch spark directly after creation, but nothing happens. Is this correct?
orchestrator/$ ORCHESTRATOR_FLOOD=1 php spark orchestrator:pro
be
CodeIgniter v4.8.0-dev Command Line Tool - Server Time: 2026-11-05 19:26:58 UTC+00:00That’s all for now; we need to try it with a real package.
|
|
||
| ## Defining an Orchestrator | ||
|
|
||
| Extend `CodeIgniter\Test\Orchestrator\AbstractOrchestrator` and implement `getPackageRoot()`: |
Contributor
There was a problem hiding this comment.
We need to specify where the test file with this code will be located. Although I’m a more experienced user, it’s not immediately clear where to start
| use FilesystemIterator; | ||
| use RecursiveDirectoryIterator; | ||
| use RecursiveIteratorIterator; | ||
| use RuntimeException; |
Contributor
There was a problem hiding this comment.
Framework has CodeIgniter\Exceptions\RuntimeException
This branch has not been deployed
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.
Description
Libraries that supplement CodeIgniter have no standard way to replicate an appstarter environment in their tests. Each package copies the same
<const>block intophpunit.xml.dist, pointsCONFIGPATHatvendor/codeigniter4/framework/app/Config, and fakes everything else intests/_support. A customisedapp/, a.envfile, or a realsparkrun cannot be tested.This adds
CodeIgniter\Test\Orchestrator\AbstractOrchestrator. A package extends it, implementsgetPackageRoot(), and gets a throwaway skeleton built from the installed framework:build()copiesapp,public,writableandsparkfrom the framework, pointsPaths.phpat itssystemdirectory, writes a.env, shares the package's autoloader through avendor/autoload.phpshim, mirrors the fixture directories, then callsafterBuild().boot()builds the skeleton, defines the path constants against it, and loadssystem/Test/bootstrap.php, soCIUnitTestCasetests run unchanged against it.spark()runs the skeleton'ssparkin a separate process and returns aSparkResultwith the exit code,stdout,stderrandtimedOut. It acceptsstdin, environment overrides and a timeout.write(),delete()andclean()change or remove the skeleton. They refuse paths that leave it, including through..and symlinks.getFixtures(),getEnv(),getPath(),getFrameworkPath()andafterBuild().Parallel runs get separate skeletons from
ORCHESTRATOR_TEST_TOKEN, or fromTEST_TOKENas set by ParaTest.Not covered: starting FrankenPHP for Worker Mode. The user guide shows how to publish the worker files with
worker:installfromafterBuild().Checklist: