codeql-cli-binaries
codeql-cli-binaries copied to clipboard
codeql run test doesn't match absolute fs paths in graph queries
Per @max-schaefer codeql run test should adapt queries that emit absolute FS paths such that they pass when run in a different environment. For example my test emits # 0| [File] /home/chris/codeql-home/codeql-go/ql/test/library-tests/semmle/go/PrintAst/input.go but the test doesn't work when the .expected file uses a truncated relative version of that path, or when it uses a different absolute path and the .actual uses the absolute path appropriate to a different environment.
To clarify: codeql run test does this already, but it doesn't seem to work reliably (or at all?) for graph queries.
The results comparison for graph queries is not entirely straightforward, and I'm not sure I fully understand the subtleties it has to deal with. @dbartol, do you have a clear enough understanding of the problem here to figure out what would be involved in solving it?
I think the difference is that we only replace the location in graph queries, but we replace all strings with the file location in normal queries.