-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Labels
questionFurther information is requestedFurther information is requested
Description
Version
CodeQL CLI v2.4.6
Description of the issue
(Reported this for github/codeql instead of github/codeql-cli-binaries since this might be specific to the Java extractor.)
It appears the Java extractor executed as part of codeql test run succeeds despite the test .java source files containing compilation errors. When running with --show-extractor-output -vvvv it even logs that it is running with --strict-javac-errors, but still does not fail.
Reproduction steps
Assumes you already have a project with the Java library present; you could for example use https://github.com/github/codeql and perform the following in the test directory of it.
- Create a test directory with the following
Test.javafile:As indicated by the comments, the file causes compilation errors which can be seen when runningclass Test { String test() { // Compilation error: missing return } void test2() { while (true) { } // Compilation error: unreachable System.out.println("test"); } }
javac. - Create a
Test.qlfile (content does not matter much), e.g.:import java from Element e where e.fromSource() select e
- Execute the test, either by running
codeql test runor by using the VSCode extension
❌ The test succeeds (or fails due to missing.expectedfile), but does not fail due to a Java compilation error
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested