Skip to content

test: replace statusreturner with local HTTP fixtures - #666

Merged
Aasav Badera (aasavbadera) merged 3 commits into
masterfrom
aasavbadera/replace-statusreturner-with-local-fixtures
Nov 16, 2026
Merged

Aasav Badera (aasavbadera) merged 3 commits into
masterfrom
aasavbadera/replace-statusreturner-with-local-fixtures

Conversation

@aasavbadera

Copy link
Copy Markdown
Collaborator

Added

  • A shared loopback HTTP server fixture for 301, 302, 307, and 308 responses, with deterministic server/thread cleanup and restored cache/environment state.
  • Synchronous and asynchronous redirect regression tests using dummy user tokens and assertions that only the query endpoint is requested.

Changed

  • Move active redirect checks from the Azure-dependent E2E suite into client unit tests, removing the need for a deployed Function App or Azure credentials.

Fixed

  • Remove all statusreturner calls, obsolete skipped cloud-path/404 cases, their trusted-host setup, and imports used only by those cases.
  • No production code, dependency manifest, lockfile, or type-baseline changes.

Validation

  • Passed: 66 tests across both client suites; all eight redirect cases also passed after the final response-type assertions.
  • Passed: Ruff lint and formatting for all four modified files.
  • Passed: baseline-aware basedpyright on the changed files, with no new diagnostics; the original repository baseline was preserved.
  • Passed: git diff --check; no remaining tracked statusreturner references.

Using the local virtual environment:

.\.venv\Scripts\python.exe -m pytest -n 0 azure-kusto-data\tests\test_kusto_client.py azure-kusto-data\tests\aio\test_kusto_client.py

The existing uv.lock records workspace version 6.0.3 while the manifests declare 6.0.4, so the normal --locked sync fails before testing. Validation restored locked external dependencies and installed the editable SDKs with their declared requirements; uv pip check passed. The stale lockfile was left unchanged. Live Azure E2E tests were not run.

Replaces #661 to move the source branch from the fork to this repository. The source commit and code changes are unchanged.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The test server’s default polling interval adds roughly four seconds of idle teardown time across the eight redirect cases.

1 open issue
What changed in this PR

Moves redirect regression coverage into the client unit suites, replacing the external statusreturner service and Azure credentials with local HTTP fixtures. Production code remains unchanged.

Changes:

  • Adds a shared loopback fixture for 301, 302, 307, and 308 responses, with cleanup and restored cache/environment state.
  • Adds synchronous and asynchronous checks that redirects are rejected and only the query endpoint is requested.
  • Removes external-service E2E cases, obsolete skipped tests, and unused imports.
File Description
azure-kusto-data/​tests/​test_kusto_client.py Adds synchronous redirect regression coverage.
azure-kusto-data/​tests/​test_e2e_data.py Removes external redirect tests and obsolete cloud cases.
azure-kusto-data/​tests/​conftest.py Provides the shared local HTTP server fixture.
azure-kusto-data/​tests/​aio/​test_kusto_client.py Adds matching asynchronous redirect coverage.

Review effort: Max

Comment thread azure-kusto-data/tests/conftest.py Resolved
Share a local redirect server between synchronous and asynchronous client tests, use dummy credentials, and remove live Function App E2E references.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 40145fed-85f7-45a5-814a-2beea3c6a507
@aasavbadera
Aasav Badera (aasavbadera) force-pushed the aasavbadera/replace-statusreturner-with-local-fixtures branch from b886fee to 3994843 Compare November 16, 2026 06:55
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Restore cache state between tests and make unauthorized authentication deterministic without external HTTP.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: da942e81-4999-4a78-94ff-6703369ade85

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The review identifies no active issues in the test-only changes that replace service-dependent redirect checks with local fixtures and improve test isolation.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@aasavbadera
Aasav Badera (aasavbadera) merged commit 5cd691f into master Nov 16, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants