Ship production optimization M1-M12.5A: queues, metrics, HTTP observability, and vector search reliability.
Keep similar-ai from tripping the global circuit on a lone URL 502, clamp Qdrant search to 100, and add Server-Timing plus slow-request logging. Studio shared props, Academy S3 exists caching, heat chunking, and Redis/scheduler hygiene stay in this rollout.
This commit is contained in:
@@ -431,6 +431,56 @@ it('can rollback sitemap delivery to the previous published release', function (
|
||||
->not->toContain('/art/' . $newArtwork->id . '/');
|
||||
});
|
||||
|
||||
it('generate command writes a canonical index.xml and public sitemap.xml', function (): void {
|
||||
Storage::fake('sitemaps_public');
|
||||
seedSitemapFixtures();
|
||||
|
||||
expect(Artisan::call('skinbase:sitemaps:generate', ['--disk' => 'sitemaps_public']))->toBe(0);
|
||||
|
||||
$disk = Storage::disk('sitemaps_public');
|
||||
$disk->assertExists('sitemaps/index.xml');
|
||||
$disk->assertExists('sitemaps/sitemap.xml');
|
||||
$disk->assertExists('sitemap.xml');
|
||||
|
||||
$index = $disk->get('sitemaps/index.xml');
|
||||
expect($index)
|
||||
->toContain('<sitemapindex')
|
||||
->toContain('/sitemaps/artworks')
|
||||
->toContain('/sitemaps/static-pages.xml');
|
||||
|
||||
expect($disk->get('sitemap.xml'))->toBe($index);
|
||||
expect(strlen($index))->toBeLessThan(50 * 1024 * 1024);
|
||||
});
|
||||
|
||||
it('serves the generated sitemaps/index.xml for /sitemap.xml when present', function (): void {
|
||||
config([
|
||||
'sitemaps.pre_generated.enabled' => true,
|
||||
'sitemaps.delivery.prefer_published_release' => false,
|
||||
'sitemaps.delivery.fallback_to_live_build' => false,
|
||||
]);
|
||||
|
||||
$indexPath = public_path('sitemaps/index.xml');
|
||||
$dir = dirname($indexPath);
|
||||
|
||||
if (! is_dir($dir)) {
|
||||
mkdir($dir, 0777, true);
|
||||
}
|
||||
|
||||
$marker = 'http://skinbase26.test/sitemaps/generated-index-marker.xml';
|
||||
file_put_contents($indexPath, '<?xml version="1.0" encoding="UTF-8"?><sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><sitemap><loc>'.$marker.'</loc></sitemap></sitemapindex>');
|
||||
|
||||
try {
|
||||
$response = $this->get('/sitemap.xml')->assertOk();
|
||||
$content = method_exists($response, 'streamedContent')
|
||||
? ($response->streamedContent() ?: $response->getContent())
|
||||
: $response->getContent();
|
||||
|
||||
expect($content)->toContain($marker);
|
||||
} finally {
|
||||
@unlink($indexPath);
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* @return array<string, int|string>
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user