diff --git a/.github/instructions/expected-files.instructions.md b/.github/instructions/expected-files.instructions.md index 17cf22f93a03..d0d19ba8f11c 100644 --- a/.github/instructions/expected-files.instructions.md +++ b/.github/instructions/expected-files.instructions.md @@ -2,3 +2,5 @@ applyTo: "**/*.expected" --- Do not edit these files directly. They are generated by running the tests. If a `.expected` file has a non-empty `testFailures `section it should not be committed - you may want to update the inline expectation comments in the corresponding test source file (e.g. marking expected results as `MISSING` / `SPURIOUS`) then re-run the test. + +To regenerate expectations for a query with a postprocessing `.qlref`, pass that `.qlref` to `codeql test run --learn`. diff --git a/unified/AGENTS.md b/unified/AGENTS.md index 72de05d120be..20641c572268 100644 --- a/unified/AGENTS.md +++ b/unified/AGENTS.md @@ -38,10 +38,10 @@ by Apple's swift-syntax rather than by tree-sitter. - Check the output files for correctness but do not edit them manually. Regenerate them with `scripts/update-corpus.sh`. ## CodeQL Testing -- If you changed the extractor code, always rebuild it before running CodeQL tests. +- If you changed the extractor code or Unified QL tests report an incompatible database schema, rebuild with `scripts/create-extractor-pack.sh` and rerun the tests with `--search-path extractor-pack`. - To run all CodeQL tests, run `codeql test run --search-path extractor-pack ql/test` -- Do not edit `.expected` files manually. To update the expected output, pass `--learn` to the `codeql test run` command. +- To update the expected output, pass `--learn` to the `codeql test run` command. - To run a specific test, pass the specific directory to the `codeql test run` command instead of `ql/test`.