Skip to content

Align inline expectation annotations with current query behavior and relearn affected expected outputs#22066

Draft
Copilot wants to merge 2 commits into
mainfrom
copilot/update-inline-expectation-tests
Draft

Align inline expectation annotations with current query behavior and relearn affected expected outputs#22066
Copilot wants to merge 2 commits into
mainfrom
copilot/update-inline-expectation-tests

Conversation

Copilot AI commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

This PR updates stale inline expectation annotations (// $ ...) so they describe current query behavior, then regenerates the corresponding .expected files via --learn for the scoped C#, Java (quantum examples), Python, and Ruby tests. The goal is to remove misleading testFailures noise caused by annotation drift, not to change query/program logic.

  • C# inline expectation cleanup

    • Updated /csharp/ql/test/utils/inline-tests/InlineTests.cs annotations to correctly scope tags and mark known misses with MISSING: where behavior is intentionally not present.
    • Relearned:
      • PathProblemQuery.expected
      • PathProblemQueryRelatedLocs.expected
      • ProblemQuery.expected
      • ProblemQueryRelatedLocs.expected
  • Java quantum example annotation alignment

    • Updated inline annotations in:
      • /java/ql/test/experimental/query-tests/quantum/examples/BadMacUse/BadMacUse.java
      • /java/ql/test/experimental/query-tests/quantum/examples/InsecureOrUnknownNonceSource/InsecureIVorNonceSource.java
      • /java/ql/test/experimental/query-tests/quantum/examples/WeakOrUnknownKDFIterationCount/Test.java
    • Adjusted expectation semantics (MISSING:, alert placement) to match actual result locations.
    • Relearned all listed affected .expected files in these directories.
  • Python/Ruby inline expectation updates

    • Updated inline annotations in:
      • /python/ql/test/experimental/meta/inline-taint-test-demo/taint_test.py
      • /ruby/ql/test/library-tests/dataflow/string-flow/string_flow.rb
      • /ruby/ql/test/library-tests/frameworks/action_controller/filter_flow.rb
      • /ruby/ql/test/library-tests/frameworks/active_support/hash_extensions.rb
      • /ruby/ql/test/library-tests/frameworks/sinatra/views/index.erb
      • /ruby/ql/test/query-tests/experimental/improper-memoization/improper_memoization.rb
    • Relearned corresponding .expected files to reflect updated inline expectations.
  • Out-of-scope runtime blocker (Kotlin summaries)

    • The two Kotlin summary targets from the original failure list could not be relearned in this environment due to extractor failure on -language-version 1.9 (current toolchain requires 2.0+), so no unreconciled manual .expected edits were introduced there.
// Before
byte[] plaintext = cipher.doFinal(ciphertext); // $ Source

// After (documented current behavior)
byte[] plaintext = cipher.doFinal(ciphertext); // $ MISSING: Source

Copilot AI changed the title [WIP] Update CodeQL inline expectation tests to match current behavior Align inline expectation annotations with current query behavior and relearn affected expected outputs Jun 26, 2026
Copilot AI requested a review from geoffw0 June 26, 2026 08:07
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