mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2026-09-14 11:06:13 +05:00
Fix focused release validation failures
This commit is contained in:
parent
8ffaaf70de
commit
3fd0460d54
@ -55,11 +55,12 @@ def _pg_sync_schema(apps, schema_editor):
|
||||
# retry_at/status columns and archiveresult created_at/modified_at were
|
||||
# created on sqlite by 0023's raw rebuild, so here they are state-only).
|
||||
# On postgres those columns would never land, desyncing the real schema.
|
||||
# Resync to this migration's final state (empty tables on pg). Snapshot is
|
||||
# referenced by SnapshotTag and ArchiveResult, so rebuild those too.
|
||||
# Resync to this migration's final state (empty tables on pg). Tag and
|
||||
# Snapshot both gain state-only fields; Snapshot is referenced by
|
||||
# SnapshotTag and ArchiveResult, so rebuild those too.
|
||||
from archivebox.misc.db import rebuild_models_from_migration_state
|
||||
|
||||
rebuild_models_from_migration_state(apps, schema_editor, "core", ["Snapshot", "SnapshotTag", "ArchiveResult"])
|
||||
rebuild_models_from_migration_state(apps, schema_editor, "core", ["Tag", "Snapshot", "SnapshotTag", "ArchiveResult"])
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
@ -9,6 +9,7 @@ from .conftest import (
|
||||
get_free_port,
|
||||
init_archive,
|
||||
live_api_request,
|
||||
run_archivebox_cmd,
|
||||
start_archivebox_server,
|
||||
stop_server,
|
||||
wait_for_live_api,
|
||||
@ -20,6 +21,8 @@ pytestmark = pytest.mark.django_db(transaction=True)
|
||||
@pytest.mark.timeout(180)
|
||||
def test_cli_api_add_search_update_remove_over_server(tmp_path):
|
||||
init_archive(tmp_path)
|
||||
install_result = run_archivebox_cmd(["install", "search_backend_sonic"], cwd=tmp_path)
|
||||
assert install_result.returncode == 0, install_result.stderr or install_result.stdout
|
||||
|
||||
port = get_free_port()
|
||||
env = cli_env(port=port, server=True, PUBLIC_INDEX="True")
|
||||
|
||||
@ -128,7 +128,7 @@ def test_update_preserves_snapshot_count(initialized_archive):
|
||||
|
||||
|
||||
def test_update_seals_migrated_snapshots(initialized_archive):
|
||||
"""Test that full update reconciles migrated snapshots without re-queuing them."""
|
||||
"""Test that migrate-only update reconciles snapshots without search backfill."""
|
||||
env = cli_env(disable_extractors=True)
|
||||
|
||||
run_archivebox_cmd(
|
||||
@ -138,16 +138,17 @@ def test_update_seals_migrated_snapshots(initialized_archive):
|
||||
)
|
||||
run_queued_crawls(initialized_archive, env)
|
||||
|
||||
# Run update
|
||||
# Run the documented upgrade path without scheduling normal maintenance jobs.
|
||||
result = run_archivebox_cmd(
|
||||
["update"],
|
||||
["update", "--migrate-only"],
|
||||
env=env,
|
||||
timeout=120,
|
||||
)
|
||||
|
||||
output = result.stdout + result.stderr
|
||||
assert result.returncode == 0, output
|
||||
assert "No queued/interrupted crawl work found" in output
|
||||
assert "Phase 2: Processing all database snapshots" in output
|
||||
assert "Reindexing" not in output
|
||||
|
||||
# Check that snapshot remains archived instead of being queued for a full re-crawl.
|
||||
with use_archivebox_db(initialized_archive):
|
||||
|
||||
@ -521,8 +521,10 @@ class TestLiveProgressView:
|
||||
process = real_second_snapshot_hook_process
|
||||
process.status = Process.StatusChoices.RUNNING
|
||||
process.pid = os.getpid()
|
||||
process.exit_code = None
|
||||
process.started_at = timezone.now()
|
||||
process.ended_at = None
|
||||
process.save(update_fields=["status", "pid", "ended_at"])
|
||||
process.save(update_fields=["status", "pid", "exit_code", "started_at", "ended_at", "modified_at"])
|
||||
|
||||
client.force_login(admin_user)
|
||||
response = client.get(reverse("live_progress"), HTTP_HOST=ADMIN_TEST_HOST)
|
||||
|
||||
@ -230,10 +230,10 @@ version = 2
|
||||
"03803c44e54399c4-1" = "illustration"
|
||||
|
||||
# docs/Upgrading.md
|
||||
"ff239d3d24a06b47-1" = "illustration"
|
||||
"2b06ac7469637678-1" = "illustration"
|
||||
"e566c21263033134-1" = "illustration"
|
||||
"5d39ef7a4a12e290-1" = "illustration"
|
||||
"7dade7e037424d0c-1" = "illustration"
|
||||
"093c9dd57ba523aa-1" = "illustration"
|
||||
"611ff525e9208d7a-1" = "illustration"
|
||||
|
||||
# docs/Usage.md
|
||||
"865eeba3c03d1e2d-1" = "run"
|
||||
@ -250,7 +250,6 @@ version = 2
|
||||
"85f531841ec3e169-1" = "run"
|
||||
|
||||
[scenarios]
|
||||
"5f7f9732e0ae5a62-1" = "system"
|
||||
"976dcb4e461d60bb-1" = "docker"
|
||||
"811eaaada5eb1861-1" = "system"
|
||||
"8e6f975ced292777-1" = "collection"
|
||||
@ -293,6 +292,7 @@ version = 2
|
||||
"b0032c4cfcac6915-1" = "docker"
|
||||
"c46afe2bbd31a239-1" = "docker"
|
||||
"4c9a12d2d0a26431-1" = "docker"
|
||||
"5f7f9732e0ae5a62-1" = "system"
|
||||
"73f9f36a369f2398-1" = "system"
|
||||
"39d6e53c2e53ef77-1" = "system"
|
||||
"6a149b1a387f76cc-1" = "system"
|
||||
@ -331,7 +331,6 @@ version = 2
|
||||
"85f531841ec3e169-1" = "collection"
|
||||
|
||||
[environments]
|
||||
"5f7f9732e0ae5a62-1" = "macos"
|
||||
"976dcb4e461d60bb-1" = "docker"
|
||||
"811eaaada5eb1861-1" = "ubuntu"
|
||||
"8e6f975ced292777-1" = "ubuntu"
|
||||
@ -374,6 +373,7 @@ version = 2
|
||||
"b0032c4cfcac6915-1" = "docker"
|
||||
"c46afe2bbd31a239-1" = "docker"
|
||||
"4c9a12d2d0a26431-1" = "docker"
|
||||
"5f7f9732e0ae5a62-1" = "macos"
|
||||
"73f9f36a369f2398-1" = "root"
|
||||
"39d6e53c2e53ef77-1" = "freebsd"
|
||||
"6a149b1a387f76cc-1" = "openbsd"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user