fix(ci): address PR blockers and move CI/nightly off sqlite
Some checks failed
CI / nightly-e2e (pull_request) Has been skipped
CI / ci (pull_request) Failing after 35s

This commit is contained in:
Mark
2026-02-28 16:38:37 +00:00
parent 36ac487cbd
commit 14db1bb57e
18 changed files with 1279 additions and 15 deletions

View File

@@ -0,0 +1,63 @@
from __future__ import annotations
from django.core.management.base import BaseCommand
from wagtail.models import Page, Site
from apps.authors.models import Author
from apps.blog.models import ArticleIndexPage, ArticlePage, HomePage
class Command(BaseCommand):
help = "Seed deterministic content for nightly Playwright E2E checks."
def handle(self, *args, **options):
root = Page.get_first_root_node()
home = HomePage.objects.child_of(root).first()
if home is None:
home = HomePage(title="Nightly Home", slug="nightly-home")
root.add_child(instance=home)
home.save_revision().publish()
article_index = ArticleIndexPage.objects.child_of(home).filter(slug="articles").first()
if article_index is None:
article_index = ArticleIndexPage(title="Articles", slug="articles")
home.add_child(instance=article_index)
article_index.save_revision().publish()
author, _ = Author.objects.get_or_create(
slug="e2e-author",
defaults={
"name": "E2E Author",
"bio": "Seeded nightly test author.",
},
)
article = ArticlePage.objects.child_of(article_index).filter(slug="nightly-playwright-journey").first()
if article is None:
article = ArticlePage(
title="Nightly Playwright Journey",
slug="nightly-playwright-journey",
author=author,
summary="Seeded article for nightly browser journey.",
body=[("rich_text", "<p>Seeded article body for nightly browser checks.</p>")],
comments_enabled=True,
)
article_index.add_child(instance=article)
article.save_revision().publish()
site, _ = Site.objects.get_or_create(
hostname="127.0.0.1",
port=8000,
defaults={
"root_page": home,
"is_default_site": True,
"site_name": "No Hype AI",
},
)
site.root_page = home
site.is_default_site = True
site.site_name = "No Hype AI"
site.save()
self.stdout.write(self.style.SUCCESS("Seeded nightly E2E content."))