close
The Wayback Machine - https://web.archive.org/web/20260329174031/https://github.com/github/vscode-codeql/issues/608
Skip to content

Better compile error output when running CodeQL unit tests #608

@aeisenberg

Description

@aeisenberg

When running a code QL test that has a compile error, the results will look like this:

Executing 1 tests in 1 directories.
Extracting test database in /Users/andrew.eisenberg/Eclipse/git-repos/github/vscode-codeql-starter/ql/python/ql/test/experimental/dataflow/basic.
Compiling queries in /Users/andrew.eisenberg/Eclipse/git-repos/github/vscode-codeql-starter/ql/python/ql/test/experimental/dataflow/basic.
[1/1 comp 2s] FAILED(COMPILATION) /Users/andrew.eisenberg/Eclipse/git-repos/github/vscode-codeql-starter/ql/python/ql/test/experimental/dataflow/basic/callGraph.ql
0 tests passed; 1 tests failed:
  FAILED: /Users/andrew.eisenberg/Eclipse/git-repos/github/vscode-codeql-starter/ql/python/ql/test/experimental/dataflow/basic/callGraph.ql

However, there is no output indicating where the compile error occurred, what line number, etc. It would be nice if we got a message like this:

[1/1 comp 2s] FAILED(COMPILATION) /Users/andrew.eisenberg/Eclipse/git-repos/github/vscode-codeql-starter/ql/python/ql/test/experimental/dataflow/basic/callGraph.ql:7:19

Notice the :7:19 at the end. It indicates that the file should be opened on the 7th line, 19th character. This will make it easier to work with errors in unit test code.

It's likely that this can only be implemented in the CLI, so I'll also raise an issue there.

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions