Skip to content

Include the unit tests in the CodeQL scan [no-new-version] - #19

Merged
simonebortolin merged 1 commit into
masterfrom
claude/codeql-unit-tests
Oct 25, 2026
Merged

simonebortolin merged 1 commit into
masterfrom
claude/codeql-unit-tests

Conversation

@simonebortolin

Copy link
Copy Markdown
Owner

Summary

CodeQL reports 13/17 Java files scanned (76 %). autobuild runs ./gradlew assemble, which compiles the library and the sample app but not the unit tests, so CacheHelperTest.java and FlowLayoutManagerTest.java are never seen by the tracer (the other two are the Javadoc-only package-info.java files).

The java-kotlin job now uses build-mode: manual:

./gradlew --no-daemon --no-build-cache \
  :flowlayoutmanager:assembleDebug \
  :flowlayoutmanager:compileDebugUnitTestJavaWithJavac \
  :app:assembleDebug
  • --no-build-cache: setup-gradle enables the build cache, and a compile task restored FROM-CACHE would skip javac, hiding its files from CodeQL
  • JDK 21, the same as the Test job in ci.yml, which builds the unit tests

Expected result: 15/17 files; the two package-info.java files hold no code.

Testing

  • YAML validated locally; Gradle cannot run in the authoring environment (Google Maven not reachable), so the build is verified by the Analyze (java-kotlin) job of this PR.

Generated by Claude Code

autobuild runs gradle assemble, which does not compile the unit tests,
so CodeQL scanned 13 of the 17 Java files. Build manually with the debug
unit test sources too, without the build cache so that javac always runs
under the CodeQL tracer, on JDK 21 like the Test job.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0178vjPYCurDqWnpvkLsVmZ1
@simonebortolin
simonebortolin merged commit 2c96cfd into master Oct 25, 2026
15 checks passed
@simonebortolin
simonebortolin deleted the claude/codeql-unit-tests branch October 25, 2026 22:48
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