Skip to content

Normalize functional and UI tests to run offline and across versions (0.261.489) - #1983

Merged
Paul Lizer (paullizer) merged 5 commits into
microsoft:Developmentfrom
paullizer:claude/normalize-update-tests-3324b8
Nov 27, 2026
Merged

Paul Lizer (paullizer) merged 5 commits into
microsoft:Developmentfrom
paullizer:claude/normalize-update-tests-3324b8

Conversation

@paullizer

@paullizer Paul Lizer (paullizer) commented Nov 26, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

The functional, JavaScript and UI tests now run without the SimpleChat team's Azure resources, keep passing across version bumps (including a fork's), and record the tests that are still out of date in a list that can only shrink. Forks and organizations that customize SimpleChat can now tell their own regressions from failures that were already there.

  • Offline Cosmos DB. With no account configured, config.py imports against an in-memory Cosmos client (test_support/offline_cosmos.py). Tests that need a real deployment call require_live_cosmos(__file__), which skips them and names the missing setting.
  • Per-file module isolation. Stubs a test file puts in sys.modules stay with that file, so they no longer break the files that run after it. Module-scoped fixtures keep working (test_support/module_isolation.py).
  • Version checks. About 95 exact VERSION = "..." comparisons are now assert_app_version_at_least().
  • Known-failures list. functional_tests/known_failures.txt has 2,607 tests in 573 files and 22 whole files (4 Python files that can't be imported, 2 that hang, 16 JavaScript files). Each entry has a reason.
    • Listed tests run as strict xfail, and a test with subtests counts as failing while any subtest fails. A listed test that starts passing fails the run until its line is removed.
    • Tests that GitHub workflows run are never listed, so the list can't change what CI checks.
    • SIMPLECHAT_IGNORE_KNOWN_FAILURES=1 turns the list off.
  • Runner and headers. scripts/run_tests.py js now runs the 114 .mjs tests it used to miss. scripts/normalize_test_headers.py --check/--write keeps file headers consistent.
  • Removed tests. 40 test files were deleted after review: tests for removed features, debugging scripts, and tests tied to one team's data.
  • App fixes found by the tests.
    • The Control Center Activity Logs auto-refresh had been lost and is restored.
    • Admin Settings rendered the Latest Features settings with a duplicate element ID; that's fixed.
  • Version 0.261.489. Docs updated: docs/contributing/testing.md, TEST_SUITE_NORMALIZATION.md, the fix and feature docs, and the release notes.

Verification

  • Each of the 2,019 functional test files was run in its own pytest process against the rebased branch, with no Azure resources configured. That was done first without the list and then with it.
    • With the list active, every file passes except seven files that CI runs and that fail on a Windows machine without a deployment. CI-run tests are never listed. On Development, most of those seven can't even be imported without the in-memory Cosmos client. The seven are test_export_evidence_cosmos_contract.py, test_global_identity_admin_routes.py, test_orchestration_deliverables.py, test_orchestration_document_loader_reliability.py, test_shared_agent_secret_responses.py, test_tabular_row_orchestration_scale.py and test_workflow_configuration.py.
    • Two timing tests fail only under 14-way parallel load. They pass when run alone, so they aren't listed.
  • JavaScript: scripts/run_tests.py js with the list active reports 112 of 128 files passed, 16 known failures and 0 failed.
  • scripts/check_cosmos_response_boundaries.py --run-contracts with the network blocked: 2,416 passed, 0 review gaps. After the rebase, the boundary review still shows 0 gaps, and normalize_test_headers.py --check reports no changes needed.
  • test_functional_known_failures_list.py covers the plugin, including subtests. test_functional_module_isolation.py covers the per-file isolation.

Development regression found while rebasing

940 tests in 97 files passed before the rebase and now fail on Development 0.261.488 itself. They fail the same way with or without per-file isolation, so this PR didn't cause them. The tests' stubs and source checks predate application code merged since 3d69fa7, for example CosmosAccessConditionFailedError imports and sanitize_plugin_invocation_value. They're listed with their reasons so the suite stays usable, and they're the first batch to fix. Seven JavaScript files started failing the same way and are listed too.

Not covered

  • The UI (Playwright) suite wasn't rerun.
  • The list is a starting point, not a fix. Follow-up PRs will work through it in batches by cause, starting with the Development regression above.

🤖 Generated with Claude Code

…(0.261.489)

Make the functional, JavaScript and UI test suites usable in forks and
organizations without the SimpleChat team's Azure resources, and keep them
passing across version bumps.

- Run config.py against an in-memory Cosmos DB client when no account is
  configured; skip live-service tests with require_live_cosmos() and name the
  missing setting.
- Isolate sys.modules stubs per test file so one file's stubs no longer
  break the files after it, while module-scoped fixtures keep working.
- Replace exact VERSION comparisons with assert_app_version_at_least().
- Add functional_tests/known_failures.txt: listed tests run as strict
  expected failures (subtests judged with their test), listed files are not
  collected, and CI-run tests are never listed. The list can only shrink.
- Run .mjs tests in scripts/run_tests.py js and report listed JS files.
- Add scripts/normalize_test_headers.py and normalize test headers.
- Delete 40 tests for removed features, debugging scripts and tests tied to
  one team's data.
- Restore the Control Center Activity Logs auto-refresh and fix a duplicate
  Latest Features ID in Admin Settings, both found by the tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment on lines +118 to +121
from test_support.module_isolation import ( # noqa: E402,F401
pytest_make_collect_report,
pytest_runtest_protocol,
)
Rerun every functional and JavaScript test file after rebasing. Remove
entries Development fixed and list the tests its latest merges broke (940
tests in 97 files that fail the same way on Development itself, with or
without per-file isolation), plus 7 newly failing JavaScript files. Keep
the run_tests.py output from crashing on characters the Windows console
code page cannot print.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The browser-assets workflow installs only pytest, so the conftest failed to import azure.cosmos.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The tests now verify local HTTPS certificates (REQUESTS_CA_BUNDLE for a
self-signed one), return JSON through jsonify, check asset URLs by host,
close the files they read, and drop unused variables.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@paullizer
Paul Lizer (paullizer) merged commit 8021975 into microsoft:Development Nov 27, 2026
14 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.

2 participants