fix(web): preserve lazy chunks across releases
CI/CD Pipeline / Validate Code Quality And Tests (push) Has been cancelled
Deploy / Deploy Staging (push) Has been cancelled
Deploy / Build Production Runtime Images (push) Failing after 2036h58m30s
Deploy / Production Browser E2E (push) Failing after 2036h49m30s
Deploy / Deploy Production (push) Failing after 2036h49m32s

This commit is contained in:
Xiaoxia AI
2026-06-23 18:32:17 +08:00
parent f3887da532
commit e97e777e0b
3 changed files with 33 additions and 0 deletions
+11
View File
@@ -54,6 +54,15 @@ def test_deploy_production_uses_production_infra_and_project():
assert "EXPECTED_VERSION=$RELEASE_VERSION" in script
def test_production_workflow_preserves_previous_web_assets():
workflow = Path(".gitea/workflows/deploy.yml").read_text(encoding="utf-8")
production_section = workflow.split("deploy-production:", 1)[1]
assert "old_assets_dir=\"/tmp/xiaoxia-previous-web-assets-${RELEASE_VERSION}\"" in production_section
assert "cp -a /var/lib/xiaoxia-saas-production/repo/apps/web/dist/assets/. \"$old_assets_dir\"/" in production_section
assert "if [ ! -e \"/var/lib/xiaoxia-saas-production/repo/apps/web/dist/assets/$name\" ]; then" in production_section
def test_production_deploy_recreates_web_after_api_for_nginx_dns():
script = Path("infra/docker/deploy-production.sh").read_text(encoding="utf-8")
@@ -72,6 +81,8 @@ def test_production_nginx_static_upstream_requires_web_recreate():
assert "client_max_body_size 800m;" in config
assert "proxy_read_timeout 300s;" in config
assert "proxy_request_buffering off;" in config
assert 'location = /index.html' in config
assert 'Cache-Control "no-store, no-cache, must-revalidate" always' in config
assert "--force-recreate web" in script