Skip to content

ci: run tests on ubuntu, macos, and windows#106

Open
maxandersen wants to merge 3 commits into
mainfrom
ci/cross-platform-tests
Open

ci: run tests on ubuntu, macos, and windows#106
maxandersen wants to merge 3 commits into
mainfrom
ci/cross-platform-tests

Conversation

@maxandersen

Copy link
Copy Markdown
Contributor

Adds a matrix strategy to the CI build job to run tests on all three major platforms (ubuntu, macos, windows) with fail-fast: false.

Expected failures on macOS and Windows:

TestJdkManager.testDefault() (line 96) will fail on macOS and Windows because LinkedJdk.linked() resolves symlinks via home().toRealPath(), which canonicalizes temp dir paths (e.g. /var/.../private/var/... on macOS). The JBangJdkProvider's acceptFolder() then rejects the resolved path because jdkFolder.startsWith(jdksRoot) fails — jdksRoot still holds the non-canonical path. The JDK falls through to ExternalJdkProvider, producing an external-<hash> id instead of the expected 12.0.7-distro-jbang.

This is also the root cause of the test failures in jbangdev/jbang#2515.

@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one) (1)
  • ai-review

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 05a781cc-8901-4e7b-94cc-7f51dbdbad37

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

…dows

On macOS, temp directories resolve through /private/var (e.g.
/var/folders/... -> /private/var/folders/...) causing
jdkFolder.startsWith(jdksRoot) to return false when the jdkFolder
path has been resolved via toRealPath() but jdksRoot has not.

This caused LinkedJdk.linked() to fall through to ExternalJdkProvider,
producing external-<hash> ids instead of the correct provider id.

The fix adds an isUnderRoot() helper that falls back to comparing
real (canonical) paths when the simple startsWith check fails.
The resolved real root path is cached for performance.

Fixes jbangdev/jbang#2515 test failures on macOS and Windows.
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.

1 participant