diff --git a/backend/btrixcloud/models.py b/backend/btrixcloud/models.py index 25e3ee6407..f973beed9f 100644 --- a/backend/btrixcloud/models.py +++ b/backend/btrixcloud/models.py @@ -158,14 +158,7 @@ class UserOut(BaseModel): FAILED_STATES = ["canceled", "failed", "skipped_quota_reached"] -SUCCESSFUL_STATES = [ - "complete", - "complete:time-limit", - "complete:size-limit", - "complete:page-limit", - "complete:user-stop", - "complete:time-quota", -] +SUCCESSFUL_STATES = ["complete", "stopped_by_user", "stopped_quota_reached"] RUNNING_AND_STARTING_STATES = [*STARTING_STATES, *RUNNING_STATES] diff --git a/backend/test/conftest.py b/backend/test/conftest.py index 1e8f0d1775..03b9f4b240 100644 --- a/backend/test/conftest.py +++ b/backend/test/conftest.py @@ -29,14 +29,7 @@ FAILED_STATES = ["canceled", "failed", "skipped_quota_reached"] -SUCCESSFUL_STATES = [ - "complete", - "complete:time-limit", - "complete:size-limit", - "complete:page-limit", - "complete:user-stop", - "complete:time-quota", -] +SUCCESSFUL_STATES = ["complete", "stopped_by_user", "stopped_quota_reached"] FINISHED_STATES = [*FAILED_STATES, *SUCCESSFUL_STATES] diff --git a/backend/test/test_crawlconfigs.py b/backend/test/test_crawlconfigs.py index 2c3bfa2a0e..a50ab55c84 100644 --- a/backend/test/test_crawlconfigs.py +++ b/backend/test/test_crawlconfigs.py @@ -361,7 +361,7 @@ def test_incremental_workflow_total_size_and_last_crawl_stats( headers=crawler_auth_headers, ) data = r.json() - if data["state"] == "complete:page-limit": + if data["state"] == "complete": break time.sleep(5) diff --git a/backend/test/test_run_crawl.py b/backend/test/test_run_crawl.py index c41c777da6..515f4fcd27 100644 --- a/backend/test/test_run_crawl.py +++ b/backend/test/test_run_crawl.py @@ -55,7 +55,7 @@ def test_wait_for_complete(admin_auth_headers, default_org_id, admin_crawl_id): headers=admin_auth_headers, ) data = r.json() - assert data["state"] == "complete:page-limit" + assert data["state"] == "complete" assert len(data["resources"]) == 1 assert data["resources"][0]["path"] diff --git a/backend/test/test_stop_cancel_crawl.py b/backend/test/test_stop_cancel_crawl.py index 655e9688d5..f4f847e8bc 100644 --- a/backend/test/test_stop_cancel_crawl.py +++ b/backend/test/test_stop_cancel_crawl.py @@ -106,7 +106,7 @@ def test_start_crawl_and_stop_immediately( time.sleep(5) data = get_crawl(default_org_id, crawler_auth_headers, crawl_id) - assert data["state"] in ("canceled", "complete:user-stop") + assert data["state"] in ("canceled", "stopped_by_user") assert data["stopping"] == True @@ -172,7 +172,7 @@ def test_stop_crawl_partial( time.sleep(5) data = get_crawl(default_org_id, crawler_auth_headers, crawl_id) - assert data["state"] == "complete:user-stop" + assert data["state"] == "stopped_by_user" assert data["stopping"] == True assert len(data["resources"]) == 1 diff --git a/backend/test/test_uploads.py b/backend/test/test_uploads.py index c1bf3f221e..15c477d073 100644 --- a/backend/test/test_uploads.py +++ b/backend/test/test_uploads.py @@ -504,7 +504,7 @@ def test_get_all_crawls_by_cid( def test_get_all_crawls_by_state(admin_auth_headers, default_org_id, admin_crawl_id): """Test filtering /all-crawls by cid""" r = requests.get( - f"{API_PREFIX}/orgs/{default_org_id}/all-crawls?state=complete,complete:user-stop,complete:page-limit", + f"{API_PREFIX}/orgs/{default_org_id}/all-crawls?state=complete,stopped_by_user", headers=admin_auth_headers, ) assert r.status_code == 200 @@ -514,8 +514,7 @@ def test_get_all_crawls_by_state(admin_auth_headers, default_org_id, admin_crawl for item in items: assert item["state"] in ( "complete", - "complete:user-stop", - "complete:page-limit", + "stopped_by_user", ) diff --git a/backend/test/test_webhooks.py b/backend/test/test_webhooks.py index 270c06418b..17ded4d71b 100644 --- a/backend/test/test_webhooks.py +++ b/backend/test/test_webhooks.py @@ -191,7 +191,7 @@ def test_webhooks_sent( headers=admin_auth_headers, ) data = r.json() - if data["state"] == "complete:page-limit": + if data["state"] == "complete": break time.sleep(5) diff --git a/backend/test_nightly/test_crawl_timeout.py b/backend/test_nightly/test_crawl_timeout.py index 51743a9772..9e3251237f 100644 --- a/backend/test_nightly/test_crawl_timeout.py +++ b/backend/test_nightly/test_crawl_timeout.py @@ -25,7 +25,7 @@ def test_crawl_timeout(admin_auth_headers, default_org_id, timeout_crawl): ) assert r.status_code == 200 data = r.json() - assert data["state"] == "complete:time-limit" + assert data["state"] == "complete" def test_crawl_files_replicated(admin_auth_headers, default_org_id, timeout_crawl): diff --git a/backend/test_nightly/test_execution_minutes_quota.py b/backend/test_nightly/test_execution_minutes_quota.py index cdb080887e..90f8d3c539 100644 --- a/backend/test_nightly/test_execution_minutes_quota.py +++ b/backend/test_nightly/test_execution_minutes_quota.py @@ -47,7 +47,7 @@ def test_crawl_stopped_when_quota_reached(org_with_quotas, admin_auth_headers): # Ensure that crawl was stopped by quota assert ( get_crawl_status(org_with_quotas, crawl_id, admin_auth_headers) - == "complete:exec-time-quota" + == "stopped_quota_reached" ) time.sleep(5) diff --git a/backend/test_nightly/test_max_crawl_size_limit.py b/backend/test_nightly/test_max_crawl_size_limit.py index e5b12f4b1d..66ae5c9adb 100644 --- a/backend/test_nightly/test_max_crawl_size_limit.py +++ b/backend/test_nightly/test_max_crawl_size_limit.py @@ -30,4 +30,4 @@ def test_max_crawl_size(admin_auth_headers, default_org_id, max_crawl_size_crawl ) assert r.status_code == 200 data = r.json() - assert data["state"] == "complete:size-limit" + assert data["state"] == "complete"