fix: publish valid SRO memberships while preserving quarantined history
All checks were successful
Mostovik Backend CI/CD / Tests and lint (push) Successful in 2m55s
Mostovik Backend CI/CD / Build linux/amd64 release images (push) Successful in 3m48s
Mostovik Backend CI/CD / Deploy and verify internal main (push) Has been skipped
Mostovik Backend CI/CD / Deploy customer main (push) Has been skipped
Mostovik Backend CI/CD / Deploy dev (push) Successful in 1m54s
All checks were successful
Mostovik Backend CI/CD / Tests and lint (push) Successful in 2m55s
Mostovik Backend CI/CD / Build linux/amd64 release images (push) Successful in 3m48s
Mostovik Backend CI/CD / Deploy and verify internal main (push) Has been skipped
Mostovik Backend CI/CD / Deploy customer main (push) Has been skipped
Mostovik Backend CI/CD / Deploy dev (push) Successful in 1m54s
This commit is contained in:
@@ -319,6 +319,9 @@ def test_sro_job_and_history_expose_typed_actual_counters_only(admin_client):
|
||||
"found_memberships_count": 2,
|
||||
"snapshot_records_count": 10,
|
||||
"snapshot_organizations_count": 8,
|
||||
"quarantined_organizations_count": 1,
|
||||
"completed_organizations_count": 2,
|
||||
"retained_records_count": 3,
|
||||
"http_errors_count": 1,
|
||||
"parse_errors_count": 2,
|
||||
"upstream_registry_date": None,
|
||||
@@ -334,6 +337,13 @@ def test_sro_job_and_history_expose_typed_actual_counters_only(admin_client):
|
||||
assert payload["meta"]["candidate_organizations_count"] == 7
|
||||
assert payload["meta"]["source"] == "sro_membership_check"
|
||||
assert payload["meta"]["upstream_registry_date"] is None
|
||||
preservation_counters = {
|
||||
"quarantined_organizations_count": 1,
|
||||
"completed_organizations_count": 2,
|
||||
"retained_records_count": 3,
|
||||
}
|
||||
for key, value in preservation_counters.items():
|
||||
assert payload["meta"][key] == value
|
||||
assert "private_loader_setting" not in payload["meta"]
|
||||
log = ParserLoadLog.objects.create(
|
||||
source="sro_membership_check", batch_id=1, status="success", records_count=10
|
||||
@@ -352,6 +362,8 @@ def test_sro_job_and_history_expose_typed_actual_counters_only(admin_client):
|
||||
assert response.data["meta"]["http_errors_count"] == 1
|
||||
assert response.data["meta"]["parse_errors_count"] == 2
|
||||
assert "private_loader_setting" not in response.data["meta"]
|
||||
for key, value in preservation_counters.items():
|
||||
assert response.data["meta"][key] == value
|
||||
schema = admin_client.get(reverse("schema-swagger-ui"), {"format": "openapi"}).data
|
||||
assert (
|
||||
schema["definitions"]["SnapshotRunMetadata"]["properties"][
|
||||
@@ -363,3 +375,6 @@ def test_sro_job_and_history_expose_typed_actual_counters_only(admin_client):
|
||||
"organizations_count"
|
||||
in schema["definitions"]["SnapshotJobResult"]["properties"]
|
||||
)
|
||||
for key in preservation_counters:
|
||||
for name in ("SnapshotRunMetadata", "SnapshotJobResult"):
|
||||
assert schema["definitions"][name]["properties"][key]["type"] == "integer"
|
||||
|
||||
Reference in New Issue
Block a user