Skip to content

Commit 38fa352

Browse files
test(integration): demo-data drift — rename hardcoded 'host' → 'dest_host'
Root cause: commit 301dcd5 (chore(lookups): trim demo CSVs from 19 to 3 + refactor refs) reduced lookups/rule_csv_map.csv from 9 mappings to 1 (DR55_brute_force_login → DR55_brute_force_users.csv). The surviving CSV's columns are: user, src_ip, dest_host, threshold, auth_method, Comment, Expires, _added_by, _added_at — no plain "host" column. Integration tests that call mapping[0] and then submit a column_removal/approval request for column "host" fail at approval-replay time with: {"error": "Column 'host' no longer exists", "request_id": "..."} The error message is honest — "host" never existed in that CSV. DR130_priv_escalation.csv (which DOES have a "host" column) is no longer in the demo mapping after the trim. Sites changed (all read from mapping[0] and hardcoded "host"): tests/integration/test_approval_workflow.py:97 (default kwarg) tests/integration/test_approval_workflow.py:463-464 tests/integration/test_audit_emission.py:197-198 tests/integration/test_audit_emission.py:267-268 tests/integration/test_notification_payload.py:115-116 tests/integration/test_post_happy_paths.py:467-472 (helper _submit_column_removal) tests/integration/test_post_happy_paths.py:517-522 (test_approve_response_shape_for_column_removal — the only FAILED test on each run; the SKIPPED tests in test_limit_edge_cases.py and test_notification_payload.py call helpers that depend on this path) Sites left as "host" (test creates its own CSV via headers=["host"] — self-contained, no dependency on demo state): tests/integration/test_post_error_paths.py:83 / 99 / 122 (CSV creation tests — these CREATE a CSV with header "host") tests/integration/test_post_happy_paths.py:685 / 690 (bulk-row submit test; the submit endpoint does not validate row-column existence so this passes regardless) Independent evidence: 5 consecutive failed Integration Tests runs (26307468975 / 26293782287 / 26293068253 / 26292468446 / 26292308961) all surfaced the SAME single FAILED line in the same test, deterministic across commits b14b3c9 / 91d9d22 / ab53066 / a48f6c2 / 4330149. Verification path: next Integration Tests run on main should show 1 fewer failure (target = 0 failed, 357 passed instead of the prior 1 failed, 356 passed). The 3 skips traced to the same root cause should also resolve (the test_limit_edge_cases.py skip on "Rate limit exceeded" is a separate issue — see follow-up).
1 parent 250119f commit 38fa352

4 files changed

Lines changed: 15 additions & 15 deletions

File tree

tests/integration/test_approval_workflow.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def _read_queue_via_get(container_curl) -> list:
9494

9595
def _submit_column_removal_request(
9696
container_curl, csv_file: str, rule_name: str,
97-
column_name: str = "host",
97+
column_name: str = "dest_host",
9898
description: str = "Ring 1 test - test column removal request",
9999
comment: str = "Ring 1 test - column deprecated") -> dict:
100100
"""Submit a column_removal approval request and return the
@@ -460,8 +460,8 @@ def test_non_ascii_description_returns_400(
460460
"app_context": "wl_manager",
461461
"description": "Reason with unicode: 中文",
462462
"pending_highlight": {"type": "column",
463-
"column_name": "host"},
464-
"payload": {"column_name": "host"},
463+
"column_name": "dest_host"},
464+
"payload": {"column_name": "dest_host"},
465465
})
466466
assert "error" in body, \
467467
f"non-ASCII description should be rejected: {body}"

tests/integration/test_audit_emission.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,8 @@ def test_request_submitted_event_has_full_schema(
194194
"description": description,
195195
"comment": f"Audit schema test {marker}",
196196
"pending_highlight": {"type": "column",
197-
"column_name": "host"},
198-
"payload": {"column_name": "host"},
197+
"column_name": "dest_host"},
198+
"payload": {"column_name": "dest_host"},
199199
}, user="analyst1")
200200

201201
if "error" in body:
@@ -264,8 +264,8 @@ def test_request_rejected_event_has_full_schema(
264264
"description": f"Ring1reject_{marker}",
265265
"comment": "test",
266266
"pending_highlight": {"type": "column",
267-
"column_name": "host"},
268-
"payload": {"column_name": "host"},
267+
"column_name": "dest_host"},
268+
"payload": {"column_name": "dest_host"},
269269
}, user="analyst1")
270270
if "error" in submit_body:
271271
pytest.skip(f"submit failed: {submit_body}")

tests/integration/test_notification_payload.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ def _submit_column_removal(container_curl, csv_file, rule_name,
112112
"app_context": "wl_manager",
113113
"description": "Ring 2 Day 2 notification payload test",
114114
"comment": comment,
115-
"pending_highlight": {"type": "column", "column_name": "host"},
116-
"payload": {"column_name": "host"},
115+
"pending_highlight": {"type": "column", "column_name": "dest_host"},
116+
"payload": {"column_name": "dest_host"},
117117
}, user=user)
118118

119119

tests/integration/test_post_happy_paths.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -465,11 +465,11 @@ def _submit_column_removal(container_curl, csv_file, rule_name):
465465
"description": "Ring 1 day 3 test",
466466
"comment": "Ring 1 day 3 test reason",
467467
"pending_highlight": {"type": "column",
468-
"column_name": "host"},
468+
"column_name": "dest_host"},
469469
"payload": {
470-
"column_name": "host",
470+
"column_name": "dest_host",
471471
"column_removal_reasons": [
472-
{"column": "host", "reason": "Ring 1 test"},
472+
{"column": "dest_host", "reason": "Ring 1 test"},
473473
],
474474
},
475475
}
@@ -515,11 +515,11 @@ def test_approve_response_shape_for_column_removal(
515515
"description": "Ring 1 day 3 approve-flow test",
516516
"comment": "Ring 1 day 3 approve-flow reason",
517517
"pending_highlight": {"type": "column",
518-
"column_name": "host"},
518+
"column_name": "dest_host"},
519519
"payload": {
520-
"column_name": "host",
520+
"column_name": "dest_host",
521521
"column_removal_reasons": [
522-
{"column": "host", "reason": "Ring 1 test"}
522+
{"column": "dest_host", "reason": "Ring 1 test"}
523523
],
524524
},
525525
})

0 commit comments

Comments
 (0)