Rebuild DEEG as a fifth installation, add stepped forms and a plugin system, and clear the review backlog
Forms gained steps, conditions, image choices, number fields with units and a summary step; the DEEG price finder uses all of it. Plugins are manifest plus Twig: blocks, settings, containers, routes, presets and theme packs, switched per installation. The review backlog is done: archive pages render through the normal page pipeline, forms and post lists work inside areas and sections, repeated sections get their own ids, breakpoints and colours come from the palette, backup and update work on MySQL and lock each other out. The task worker no longer shortens a process that has no time limit: set_time_limit() sets the limit instead of extending it, which turned an unlimited CLI run into eighty seconds and killed the full test suite far away from the scheduler. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
66ff68abf8
commit
c8a8fa7460
74 files changed
+5352
-243
No files matched your search
@@ -2,10 +2,16 @@
|
||||
|
||||
namespace App\Tests;
|
||||
|
||||
use App\EventSubscriber\InstallSubscriber;
|
||||
use App\EventSubscriber\TaskWorkerSubscriber;
|
||||
use App\Infrastructure\ConnectionFactory;
|
||||
use App\Ops\Scheduler;
|
||||
use Doctrine\DBAL\Connection;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpKernel\Event\TerminateEvent;
|
||||
use Symfony\Component\HttpKernel\HttpKernelInterface;
|
||||
|
||||
/**
|
||||
* Der Aufgabenplan - und zwar die Eigenschaften, an denen er auf einem echten Hosting scheitern
|
||||
@@ -256,4 +262,32 @@ final class SchedulerTest extends TestCase
|
||||
self::assertNotSame($one, $two);
|
||||
self::assertSame($one, Scheduler::cronToken('geheimnis-eins'));
|
||||
}
|
||||
|
||||
public function testTheWorkerNeverShortensAProcessWithoutATimeLimit(): void
|
||||
{
|
||||
// `set_time_limit()` setzt, es verlaengert nicht. Auf einem Prozess ohne Grenze - Konsole,
|
||||
// Testlauf, Hoster mit max_execution_time = 0 - machte der Worker aus "unbegrenzt"
|
||||
// achtzig Sekunden, und danach starb der Prozess irgendwo weit weg von den Aufgaben.
|
||||
$vorher = ini_get('max_execution_time');
|
||||
ini_set('max_execution_time', '0');
|
||||
file_put_contents($this->projectDir.'/'.InstallSubscriber::MARKER, 'test
|
||||
');
|
||||
$task = new SpyTask('a');
|
||||
$scheduler = $this->scheduler([$task]);
|
||||
$scheduler->sync();
|
||||
$this->makeDue('a');
|
||||
// Die Zustandsdatei kennt den alten Zeitpunkt; ohne sie fragt der naechste Aufruf die Datenbank.
|
||||
@unlink($this->projectDir.'/'.Scheduler::STATE_FILE);
|
||||
|
||||
$subscriber = new TaskWorkerSubscriber($scheduler, $this->projectDir, 'admin');
|
||||
$subscriber->onTerminate(new TerminateEvent(
|
||||
$this->createMock(HttpKernelInterface::class),
|
||||
Request::create('/'),
|
||||
new Response(),
|
||||
));
|
||||
|
||||
self::assertSame(1, $task->runs, 'Die faellige Aufgabe soll gelaufen sein.');
|
||||
self::assertSame('0', (string) ini_get('max_execution_time'), 'Ohne Grenze bleibt ohne Grenze.');
|
||||
ini_set('max_execution_time', (string) $vorher);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user