Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests for HTTPRoute delete reconciliation #182

Merged
merged 1 commit into from
Mar 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions testsuite/tests/kuadrant/reconciliation/test_httproute_delete.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
"""Tests that AuthPolicy is reconciled after HTTPRoute deletion."""
import pytest


@pytest.mark.issue("https://github.com/Kuadrant/kuadrant-operator/issues/124")
def test_delete(client, authorization, resilient_request):
"""
Tests that after deleting HTTPRoute, status.conditions shows it missing:
* Test that that client works
* Delete associated HTTPRoute
* Test that client now does not work
* AuthPolicy cache refresh
* Test that status.conditions of AuthPolicy detects missing HTTPRoute
"""

response = client.get("/get")
assert response.status_code == 200

authorization.route.delete()

response = resilient_request("/get", http_client=client, expected_status=404)
assert response.status_code == 404, "Removing HTTPRoute was not reconciled"

authorization.refresh()
condition = authorization.model.status.conditions[0]
assert condition.status == "False"
assert "not found" in condition.message