Skip to content

Fix unfalsifiable tests that swallow assertion failures#1199

Open
Asher- wants to merge 3 commits intooraios:mainfrom
Asher-:fix/unfalsifiable-tests
Open

Fix unfalsifiable tests that swallow assertion failures#1199
Asher- wants to merge 3 commits intooraios:mainfrom
Asher-:fix/unfalsifiable-tests

Conversation

@Asher-
Copy link

@Asher- Asher- commented Mar 21, 2026

Problem

Several tests catch AssertionError or use overly broad exception handlers, making them unable to detect regressions:

  1. test_request_defining_symbol_method_call: Caught AssertionError and replaced with warnings.warn().

  2. test_request_defining_symbol_nested_function: Had duplicated Test 2/Test 3 blocks — first copy swallowed errors, second was strict.

  3. test_symbol_methods_integration: Container hierarchy check caught all exceptions silently.

  4. Vue error case tests (4 tests): Used except (FileNotFoundError, Exception) which catches everything including AssertionError, making the try-branch assertions unreachable on failure.

Fix

  • Remove except AssertionError: warnings.warn(...) — let assertions fail.
  • Remove duplicated test blocks, keep strict versions.
  • Replace exception-swallowing container check with actual assertion.
  • Narrow Vue catches to except FileNotFoundError only.

Note

These tests may now fail if they were masking real regressions. That's the intended behavior — tests should detect failures, not hide them.

Verification

  • Format/type-check clean

Asher- and others added 3 commits March 20, 2026 19:07
…kit-lsp

sourcekit-lsp was launched with no arguments, giving it no location to store
its background index. Without --scratch-path, textDocument/references always
returns empty because there is no index store for cross-file symbol resolution.

- Pass --scratch-path <repo>/.build/sourcekit-lsp when launching
- Increase local indexing delay from 5s to 10s (real projects need more time)
- Add retry logic for local runs when references are empty, not just CI

Fixes root cause of issue oraios#876.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
On macOS, bare sourcekit-lsp resolves to Command Line Tools version which
has limited indexing capabilities. xcrun without DEVELOPER_DIR also
resolves to CLT. Setting DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer
gives the full Xcode sourcekit-lsp with proper background indexing support.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- test_request_defining_symbol_method_call: Remove try/except that caught
  AssertionError and replaced it with warnings.warn(), making the test
  unable to fail.

- test_request_defining_symbol_nested_function: Remove duplicated Test 2
  and Test 3 blocks (first copy swallowed errors, second was strict).
  Keep only the strict version.

- test_symbol_methods_integration: Replace exception-swallowing container
  hierarchy check with an actual assertion that fails if UserService
  class is not found.

- Vue error case tests (4 tests): Replace `except (FileNotFoundError,
  Exception)` with `except FileNotFoundError`. The broad Exception catch
  swallowed AssertionError from the try-branch assertions, making them
  unreachable on failure.
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.

1 participant