@@ -92,16 +92,18 @@ protected function prepareSut(string $webroot = 'web'): void {
9292 * SUT's composer.json so consumer sites resolve drevops/vortex-tooling
9393 * from packagist. Until the package is published, the SUT cannot resolve
9494 * it, so the workflow tests would fail at the Dockerfile's composer
95- * install step. This method copies the in-tree tooling into the SUT,
96- * re-injects the path repository into composer.json, re-injects the
97- * COPY into cli.dockerfile, and whitelists the path in .dockerignore.
95+ * install step. This method copies the in-tree tooling into the SUT at
96+ * '.tooling-source' (deliberately outside '.vortex/' so the SUT keeps no
97+ * '.vortex/' directory at runtime), re-injects the path repository into
98+ * composer.json, re-injects the COPY into cli.dockerfile, and whitelists
99+ * the path in .dockerignore.
98100 *
99101 * @todo Remove once drevops/vortex-tooling is published to packagist.
100102 */
101103 protected function injectTestingTooling (): void {
102104 $ sut_root = static ::locationsSut ();
103105 $ source_tooling = static ::locationsRoot () . DIRECTORY_SEPARATOR . '.vortex ' . DIRECTORY_SEPARATOR . 'tooling ' ;
104- $ target_tooling = $ sut_root . DIRECTORY_SEPARATOR . '.vortex ' . DIRECTORY_SEPARATOR . ' tooling ' ;
106+ $ target_tooling = $ sut_root . DIRECTORY_SEPARATOR . '.tooling-source ' ;
105107
106108 if (is_dir ($ source_tooling )) {
107109 File::copy ($ source_tooling , $ target_tooling );
@@ -114,7 +116,7 @@ protected function injectTestingTooling(): void {
114116 $ repositories = isset ($ composer ['repositories ' ]) && is_array ($ composer ['repositories ' ]) ? $ composer ['repositories ' ] : [];
115117 $ repositories [] = [
116118 'type ' => 'path ' ,
117- 'url ' => '.vortex/ tooling ' ,
119+ 'url ' => '.tooling-source ' ,
118120 'options ' => [
119121 'symlink ' => FALSE ,
120122 'versions ' => [
@@ -131,13 +133,13 @@ protected function injectTestingTooling(): void {
131133 if (file_exists ($ dockerfile_path )) {
132134 $ content = (string ) file_get_contents ($ dockerfile_path );
133135 $ needle = 'COPY composer.json composer.* .env* auth* /app/ ' ;
134- $ replacement = $ needle . "\n\n# Test-only: enables path-repo resolution. \nCOPY .vortex/ tooling /app/.vortex/ tooling " ;
136+ $ replacement = $ needle . "\n\n# Test-only: enables path-repo resolution. \nCOPY .tooling-source /app/.tooling-source " ;
135137 file_put_contents ($ dockerfile_path , str_replace ($ needle , $ replacement , $ content ));
136138 }
137139
138140 $ dockerignore_path = $ sut_root . DIRECTORY_SEPARATOR . '.dockerignore ' ;
139141 if (file_exists ($ dockerignore_path )) {
140- file_put_contents ($ dockerignore_path , file_get_contents ($ dockerignore_path ) . "\n# Test-only: allow tooling in build context. \n!.vortex \n .vortex/* \n !.vortex/ tooling \n.vortex/ tooling/tests \n.vortex/ tooling/playground \n.vortex/ tooling/node_modules \n" );
142+ file_put_contents ($ dockerignore_path , file_get_contents ($ dockerignore_path ) . "\n# Test-only: allow tooling source in build context. \n!.tooling-source \n.tooling-source /tests \n.tooling-source /playground \n.tooling-source /node_modules \n" );
141143 }
142144
143145 $ this ->reinstallToolingToVendor ();
@@ -154,7 +156,7 @@ protected function injectTestingTooling(): void {
154156 */
155157 protected function reinstallToolingToVendor (): void {
156158 $ sut_root = static ::locationsSut ();
157- $ sut_source = $ sut_root . DIRECTORY_SEPARATOR . '.vortex ' . DIRECTORY_SEPARATOR . ' tooling ' ;
159+ $ sut_source = $ sut_root . DIRECTORY_SEPARATOR . '.tooling-source ' ;
158160 $ repo_source = static ::locationsRoot () . DIRECTORY_SEPARATOR . '.vortex ' . DIRECTORY_SEPARATOR . 'tooling ' ;
159161 $ target = $ sut_root . DIRECTORY_SEPARATOR . 'vendor ' . DIRECTORY_SEPARATOR . 'drevops ' . DIRECTORY_SEPARATOR . 'vortex-tooling ' ;
160162
@@ -469,12 +471,15 @@ protected function assertVortexFilesPresent(string $webroot = 'web'): void {
469471 $ this ->assertFileExists ('docs/releasing.md ' );
470472 $ this ->assertFileExists ('docs/testing.md ' );
471473
472- // Assert that Vortex files removed. '.vortex/tooling' is allowed because
473- // 'injectTestingTooling' re-injects it for test purposes until the
474- // 'drevops/vortex-tooling' package is published to packagist.
474+ // Assert that Vortex files are removed. The installer strips the whole
475+ // '.vortex/' tree from consumer sites; 'injectTestingTooling' re-injects
476+ // the tooling source under '.tooling-source/' (outside '.vortex/') so
477+ // tests can resolve 'drevops/vortex-tooling' via a path repository until
478+ // the package is published to packagist.
475479 $ this ->assertDirectoryDoesNotExist ('.vortex/docs ' );
476480 $ this ->assertDirectoryDoesNotExist ('.vortex/installer ' );
477481 $ this ->assertDirectoryDoesNotExist ('.vortex/tests ' );
482+ $ this ->assertDirectoryDoesNotExist ('.vortex/tooling ' );
478483 $ this ->assertFileDoesNotExist ('LICENSE ' );
479484 $ this ->assertFileDoesNotExist ('CODE_OF_CONDUCT.md ' );
480485 $ this ->assertFileDoesNotExist ('.github/FUNDING.yml ' );
0 commit comments