Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checkstyle tests don't work with a generated checkstyle.xml #226

Closed
vinnybod opened this issue Jan 2, 2024 · 2 comments · Fixed by #227
Closed

Checkstyle tests don't work with a generated checkstyle.xml #226

vinnybod opened this issue Jan 2, 2024 · 2 comments · Fixed by #227

Comments

@vinnybod
Copy link

vinnybod commented Jan 2, 2024

I am trying to run checkstyle tests with a generated checkstyle.xml instead of a file in the source tree. It seems like there is something wrong with the rule that isn't allowing this use case.

I wrote a minimal reproducible example and pushed it to a repo here: https://github.com/vinnybod/bazel_java_example/tree/generated-checkstyle-config

For the minimal reproduction, the macro just copies the checkstyle config from the source tree into the bazel-out runfiles and the label of that genrule is what gets passed into the checkstyle_config.

INFO: Invocation ID: 300a43af-8451-4adb-b49f-a69bfe52a210
INFO: Analyzed 7 targets (2 packages loaded, 11 targets configured).
INFO: Found 6 targets and 1 test target...
FAIL: //:entrypoint-checkstyle (see /private/var/tmp/_bazel_vrose/17aacbd88bcaf1ce194e6bbdb78e4a29/execroot/__main__/bazel-out/darwin_arm64-fastbuild/testlogs/entrypoint-checkstyle/test.log)
INFO: From Testing //:entrypoint-checkstyle:
==================== Test output for //:entrypoint-checkstyle:
/private/var/tmp/_bazel_vrose/17aacbd88bcaf1ce194e6bbdb78e4a29/sandbox/darwin-sandbox/106/execroot/__main__/bazel-out/darwin_arm64-fastbuild/bin/entrypoint-checkstyleexec.runfiles/__main__/entrypoint-checkstyleexec: line 5: cd: bazel-out/darwin_arm64-fastbuild/bin: No such file or directory
================================================================================
INFO: Elapsed time: 0.795s, Critical Path: 0.70s
INFO: 5 processes: 3 internal, 2 darwin-sandbox.
INFO: Build completed, 1 test FAILED, 5 total actions
//:entrypoint-checkstyle                                                 FAILED in 0.5s
  /private/var/tmp/_bazel_vrose/17aacbd88bcaf1ce194e6bbdb78e4a29/execroot/__main__/bazel-out/darwin_arm64-fastbuild/testlogs/entrypoint-checkstyle/test.log

Executed 1 out of 1 test: 1 fails locally.
@illicitonion
Copy link
Collaborator

Thanks for the really clear minimal repro! This should be fixed by #227

illicitonion added a commit to illicitonion/rules_jvm that referenced this issue Jan 3, 2024
@vinnybod
Copy link
Author

vinnybod commented Jan 3, 2024

Wow thanks for the turnaround on that @illicitonion ! I just tested it out on my larger repo and everything appears to be working.

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 a pull request may close this issue.

2 participants