Skip to content

Commit 1232953

Browse files
committed
Captured fallback provision output and added config-default probes.
1 parent 93d8fa6 commit 1232953

1 file changed

Lines changed: 14 additions & 4 deletions

File tree

.vortex/tests/phpunit/Functional/AhoyWorkflowTest.php

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,9 @@ public function testAhoyWorkflowProvisionFallbackToProfile(): void {
511511
'Provision without fallback should fail when no database dump is available',
512512
);
513513

514+
$logs_dir = self::locationsRoot() . '/.vortex/tests/.logs';
515+
@mkdir($logs_dir, 0777, TRUE);
516+
514517
$this->logSubstep('Provision with fallback should succeed');
515518
$this->fileAddVar('.env', 'VORTEX_PROVISION_FALLBACK_TO_PROFILE', 1);
516519
$this->syncToContainer(['.env']);
@@ -527,6 +530,13 @@ public function testAhoyWorkflowProvisionFallbackToProfile(): void {
527530
tio: 15 * 60,
528531
);
529532

533+
// DEBUG: capture the full output of the fallback provision run before any
534+
// further probes run drush and rebuild the container.
535+
file_put_contents(
536+
$logs_dir . '/debug-00-provision-output.txt',
537+
sprintf("--- STDOUT ---\n%s\n--- STDERR ---\n%s\n", $this->processGet()->getOutput(), $this->processGet()->getErrorOutput())
538+
);
539+
530540
$this->logSubstep('Assert that Shield module is enabled');
531541
$this->cmd('ahoy drush pm:list --status=enabled --type=module --format=list', '* shield', 'Shield module should be enabled after fallback provision');
532542

@@ -537,9 +547,6 @@ public function testAhoyWorkflowProvisionFallbackToProfile(): void {
537547
// through 'ahoy cli' with a single-quoted outer arg so they survive
538548
// ahoy's '$*' expansion intact.
539549
// @todo Remove once the underlying cause is understood and fixed.
540-
$logs_dir = self::locationsRoot() . '/.vortex/tests/.logs';
541-
@mkdir($logs_dir, 0777, TRUE);
542-
543550
$this->captureProbe($logs_dir, '01-enabled-modules.txt', "ahoy cli 'vendor/bin/drush pm:list --status=enabled --type=module --format=list'");
544551
$this->captureProbe($logs_dir, '02-core-extension.txt', "ahoy cli 'vendor/bin/drush config:get core.extension'");
545552
$this->captureProbe($logs_dir, '03-redirect-module-status.txt', "ahoy cli 'vendor/bin/drush pm:list --filter=redirect --format=list || true'");
@@ -551,8 +558,11 @@ public function testAhoyWorkflowProvisionFallbackToProfile(): void {
551558
$this->captureProbe($logs_dir, '09-phpstorage-find.txt', "ahoy cli 'find web/sites/default/files/php -type f 2>/dev/null | head -50 || echo NO_FILES'");
552559
$this->captureProbe($logs_dir, '10-grep-redirect-in-cache.txt', "ahoy cli 'grep -l Drupal..redirect web/sites/default/files/php/container/*.php 2>/dev/null || echo NO_REDIRECT_IN_CONTAINER_CACHE'");
553560
$this->captureProbe($logs_dir, '11-grep-subscriber-in-cache.txt', "ahoy cli 'grep -c redirect.request_subscriber web/sites/default/files/php/container/*.php 2>/dev/null || echo NO_REDIRECT_SUBSCRIBER_IN_CACHE'");
554-
$this->captureProbe($logs_dir, '12-watchdog.txt', "ahoy cli 'vendor/bin/drush watchdog:show --count=30 || true'");
561+
$this->captureProbe($logs_dir, '12-watchdog.txt', "ahoy cli 'vendor/bin/drush watchdog:show --count=200 || true'");
555562
$this->captureProbe($logs_dir, '13-homepage.txt', "ahoy cli 'curl -sS -o /tmp/homepage.html -w HTTP_STATUS=%{http_code} http://nginx:8080/ ; echo ; head -c 4000 /tmp/homepage.html'");
563+
$this->captureProbe($logs_dir, '14-config-default-listing.txt', "ahoy cli 'ls -la ../config/default/ | head -80'");
564+
$this->captureProbe($logs_dir, '15-core-extension-yml.txt', "ahoy cli 'cat ../config/default/core.extension.yml 2>/dev/null || echo NO_CORE_EXTENSION_YML'");
565+
$this->captureProbe($logs_dir, '16-shield-status.txt', "ahoy cli 'vendor/bin/drush pm:list --filter=shield --format=list || true'");
556566

557567
$this->logSubstep('Assert that homepage does not contain database dump content');
558568
$this->assertWebpageNotContains('/', 'This demo page is sourced from the Vortex database dump file', 'Homepage should not show database dump content after fallback provision');

0 commit comments

Comments
 (0)