From 8099a47807b681805c5ff64c3affbde6a2f21f16 Mon Sep 17 00:00:00 2001 From: Nick Sweeting Date: Wed, 29 Jul 2026 17:12:55 -0700 Subject: [PATCH] Keep live API tests within the server boundary --- ...1_cli_workflow_add_search_update_remove.py | 25 ++++++++++--------- etc/package.json | 2 +- pyproject.toml | 4 +-- 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/archivebox/tests/test_api_v1_cli_workflow_add_search_update_remove.py b/archivebox/tests/test_api_v1_cli_workflow_add_search_update_remove.py index c9a619d1..1b108fcb 100644 --- a/archivebox/tests/test_api_v1_cli_workflow_add_search_update_remove.py +++ b/archivebox/tests/test_api_v1_cli_workflow_add_search_update_remove.py @@ -1,8 +1,8 @@ import pytest from archivebox.core.models import Snapshot -from archivebox.crawls.models import Crawl from archivebox.tests.test_orm_helpers import use_archivebox_db + from .conftest import ( cli_env, create_admin_and_token, @@ -109,18 +109,18 @@ def test_cli_api_add_search_update_remove_over_server(tmp_path): ) assert update_response.status_code == 200, update_response.text assert update_response.json()["success"] is True - stop_server(tmp_path) - start_archivebox_server(tmp_path, env=env, port=port) - wait_for_live_api(port) - with use_archivebox_db(tmp_path): - crawl_obj = Crawl.objects.filter(pk=crawl_id).first() - crawl = (crawl_obj.max_depth, crawl_obj.tags_str, crawl_obj.config) if crawl_obj else None - - assert crawl is not None - assert crawl[0] == 0 - assert crawl[1] == "api-cli" - assert crawl[2]["INDEX_ONLY"] is True + crawl_response = live_api_request( + port, + "get", + f"/api/v1/crawls/crawl/{crawl_id}", + api_token=api_token, + ) + assert crawl_response.status_code == 200, crawl_response.text + crawl = crawl_response.json() + assert crawl["max_depth"] == 0 + assert crawl["tags_str"] == "api-cli" + assert crawl["config"]["INDEX_ONLY"] is True remove_response = live_api_request( port, @@ -142,6 +142,7 @@ def test_cli_api_add_search_update_remove_over_server(tmp_path): assert remove_payload["result"]["removed_count"] == 1 assert snapshot_id in remove_payload["result"]["removed_snapshot_ids"] + stop_server(tmp_path) with use_archivebox_db(tmp_path): snapshot_count = Snapshot.objects.filter(pk=snapshot_id).count() diff --git a/etc/package.json b/etc/package.json index 9cf06d44..c28e8a2c 100644 --- a/etc/package.json +++ b/etc/package.json @@ -1,6 +1,6 @@ { "name": "archivebox", - "version": "0.9.35rc180", + "version": "0.9.35rc181", "repository": "github:ArchiveBox/ArchiveBox", "license": "MIT", "dependencies": { diff --git a/pyproject.toml b/pyproject.toml index 9e759db9..01a25be5 100755 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "archivebox" -version = "0.9.35rc180" +version = "0.9.35rc181" requires-python = ">=3.13" description = "Self-hosted internet archiving solution." authors = [{name = "Nick Sweeting", email = "pyproject.toml@archivebox.io"}] @@ -344,7 +344,7 @@ Donate = "https://github.com/ArchiveBox/ArchiveBox/wiki/Donations" [tool.bumpver] -current_version = "v0.9.35rc180" +current_version = "v0.9.35rc181" version_pattern = "vMAJOR.MINOR.PATCH[PYTAGNUM]" commit_message = "bump version {old_version} -> {new_version}" tag_message = "{new_version}"