Menüleiste am Handy, Updater in zwei Schritten, Absturzerkennung ohne Merkdateien (0.62.0)
Some checks failed
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 11m34s
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 12m8s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 15m14s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 15m47s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 13m48s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 14m15s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 16m38s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 17m2s
CI / Bekannte Sicherheitslücken in Paketen (pull_request) Successful in 1m16s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m53s
Some checks failed
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 11m34s
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 12m8s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 15m14s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 15m47s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 13m48s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 14m15s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 16m38s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 17m2s
CI / Bekannte Sicherheitslücken in Paketen (pull_request) Successful in 1m16s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m53s
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
623d423ad8
commit
c275db4dce
147 changed files with 760 additions and 498 deletions
|
|
@ -95,11 +95,27 @@ class UpdaterTest extends TestCase
|
|||
|
||||
$result = $this->updater($target)->installUpdate($admin->id);
|
||||
|
||||
// Schritt 1: Dateien getauscht, Datenbank folgt in der nächsten Anfrage (mit dem neuen Code)
|
||||
$this->assertSame(self::SHA, $result['sha']);
|
||||
$this->assertSame(0, $result['migrations']);
|
||||
$this->assertTrue($result['pending']);
|
||||
$this->assertFileExists($target.'/app/Neu.php');
|
||||
$this->assertSame('APP_KEY=geheim', file_get_contents($target.'/.env'));
|
||||
$this->assertSame(self::SHA, app(InstalledVersion::class)->current());
|
||||
$this->assertSame('finalize', app(UpdateProgress::class)->get()['step']);
|
||||
$this->assertTrue(app(MaintenanceFlag::class)->isActive());
|
||||
$this->assertTrue(app(UpdateProgress::class)->isRunning());
|
||||
$this->assertSame(0, AuditLog::query()->where('action', 'update.installed')->count());
|
||||
|
||||
// Eine Anfrage, die schon vor dem Austausch lief, darf Schritt 2 nicht ausführen
|
||||
$this->assertNull($this->updater($target)->finishPending(microtime(true) - 60));
|
||||
$this->assertFileExists(Updater::pendingPath());
|
||||
|
||||
// Schritt 2
|
||||
$finished = $this->updater($target)->finishPending(microtime(true) + 1);
|
||||
$this->assertSame(0, $finished['migrations']);
|
||||
$this->assertSame(1, $finished['files']);
|
||||
$this->assertFileDoesNotExist(Updater::pendingPath());
|
||||
$this->assertNull($this->updater($target)->finishPending(microtime(true) + 1));
|
||||
$this->assertSame('done', app(UpdateProgress::class)->get()['step']);
|
||||
$this->assertSame(100, app(UpdateProgress::class)->get()['pct']);
|
||||
$this->assertFalse(app(MaintenanceFlag::class)->isActive());
|
||||
|
|
@ -110,6 +126,20 @@ class UpdaterTest extends TestCase
|
|||
$this->assertEquals(['channel' => 'stable', 'sha' => self::SHA, 'migrations' => 0, 'files' => 1], $audit->data);
|
||||
}
|
||||
|
||||
public function test_next_request_finishes_a_pending_update(): void
|
||||
{
|
||||
app(MaintenanceFlag::class)->activate(300);
|
||||
app(UpdateProgress::class)->set(75, 'finalize', 'Datenbank folgt …');
|
||||
file_put_contents(Updater::pendingPath(), json_encode(['channel' => 'stable', 'sha' => self::SHA, 'files' => 3, 'user_id' => null, 'ready_at' => $_SERVER['REQUEST_TIME_FLOAT'] - 1]));
|
||||
|
||||
$this->get('/login')->assertOk();
|
||||
|
||||
$this->assertFileDoesNotExist(Updater::pendingPath());
|
||||
$this->assertFalse(app(MaintenanceFlag::class)->isActive());
|
||||
$this->assertSame('done', app(UpdateProgress::class)->get()['step']);
|
||||
$this->assertSame(1, AuditLog::query()->where('action', 'update.installed')->count());
|
||||
}
|
||||
|
||||
public function test_error_page_instead_of_zip_is_rejected(): void
|
||||
{
|
||||
Http::fake([
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue