Skip to content

#2576: fix cli tests failing on macOS - #2593

Merged
quando632 merged 17 commits into
devonfw:mainfrom
shodiBoy1:feature/2576-macos-mvn-test
Oct 16, 2026
Merged

quando632 merged 17 commits into
devonfw:mainfrom
shodiBoy1:feature/2576-macos-mvn-test

Conversation

@shodiBoy1

@shodiBoy1 shodiBoy1 commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

This PR fixes #2576

Implemented changes:

  • CheckCommandletTest - On macOS, /var is a symlink to /private/var. findRepositoryRoot logs the real path through FileAccess.toRealPath. The test now builds the expected .gitignore path the same way, so the warning line matches.

  • InstallCommandletTest - The macOS Java fixtures end in .dmg. FileAccess.compress only builds tar and zip, so the mock could not create that archive. ToolRepositoryMock now rewrites unsupported extensions to .tgz before compressing, which is the archive format the test infrastructure already uses.

  • CveCheckInstallTest - On macOS, software/intellij points into IntelliJ IDEA CE.app/Contents/MacOS. The version file is written on the installation root, outside the bundle. The tests now read that file from ToolInstallation.rootDir() through one shared assertion.


Testing instructions

  1. On macOS, check out this branch and run the three classes from the cli directory:
mvn -Dtest=CheckCommandletTest,InstallCommandletTest,CveCheckInstallTest test
  1. From the repository root, run the same command the pre-commit hook runs:
mvn -q -ntp verify -pl '!documentation'
  1. On Linux or Windows, run the same cli command. .zip and .tgz fixture URLs are not rewritten, and a real .dmg install still uses hdiutil.

Checklist for this PR

Make sure everything is checked before merging this PR. For further info please also see
our DoD.

  • When running mvn clean test locally all tests pass and build is successful
  • PR title is of the form #«issue-id»: «brief summary» (e.g. #921: fixed setup.bat and not feature/921 fixed setup.bat). If no issue ID exists, title only.
  • PR top-level comment summaries what has been done and contains link to addressed issue(s)
  • PR and issue(s) have suitable labels
  • Issue is set to In Progress and assigned to you or there is no issue (might happen for very small PRs)
  • You followed all coding conventions
  • You have added the issue implemented by your PR in CHANGELOG.adoc unless issue is labelled
    with internal
  • You have not changed any dependency in pom.xml files or otherwise if runtime dependencies changed, you have updated our LICENSE.asciidoc
  • You have formulated clear instructions on how to test your contribution under "Testing instructions"

@github-project-automation github-project-automation Bot moved this to 🆕 New in IDEasy board Sep 30, 2026
@shodiBoy1 shodiBoy1 self-assigned this Sep 30, 2026
@shodiBoy1 shodiBoy1 added test related to testing and QA macOS specific for Apple MacOS labels Sep 30, 2026
@coveralls

coveralls commented Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 38882049784

Coverage decreased (-0.02%) to 74.759%

Details

  • Coverage decreased (-0.02%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • 1 coverage regression across 1 file.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

1 previously-covered line in 1 file lost coverage.

File Lines Losing Coverage Coverage
com/devonfw/tools/ide/version/VersionSegment.java 1 90.81%

Coverage Stats

Coverage Status
Relevant Lines: 19643
Covered Lines: 15339
Line Coverage: 78.09%
Relevant Branches: 8723
Covered Branches: 5867
Branch Coverage: 67.26%
Branches in Coverage %: Yes
Coverage Strength: 3.35 hits per line

💛 - Coveralls

@shodiBoy1 shodiBoy1 added the internal Nothing to be added to CHANGELOG, only internal story label Oct 1, 2026
@shodiBoy1
shodiBoy1 marked this pull request as ready for review October 1, 2026 16:09

@laim2003 laim2003 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @shodiBoy1 for this test fix! Tested it on my mac and works perfectly fine. Just had a variable naming recommendation.

Comment thread cli/src/test/java/com/devonfw/tools/ide/tool/repository/ToolRepositoryMock.java Outdated
@shodiBoy1

Copy link
Copy Markdown
Contributor Author

Thanks @shodiBoy1 for this test fix! Tested it on my mac and works perfectly fine. Just had a variable naming recommendation.

Thanks @laim2003 for the review. I've applied the recommendations.

@shodiBoy1 shodiBoy1 moved this from Team Review to 👀 In review in IDEasy board Oct 8, 2026

@laim2003 laim2003 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good!

@quando632 quando632 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the focused fix: resolving the expected path via FileAccess.toRealPath mirrors the production code, and assertInstalledVersion documents the bundle behaviour nicely.
Full cli suite is green on Windows, and a simulated MAC_X64 install runs through the new .dmg mock path.

@quando632 quando632 self-assigned this Oct 13, 2026
…positoryMock.java

Co-authored-by: quando632 <quang-hieu.do@capgemini.com>
@laim2003
laim2003 requested a review from quando632 October 13, 2026 15:29
@quando632 quando632 added this to the release:2026.10.001 milestone Oct 16, 2026
@quando632
quando632 merged commit 3a2a0f8 into devonfw:main Oct 16, 2026
5 checks passed
@github-project-automation github-project-automation Bot moved this from 👀 In review to ✅ Done in IDEasy board Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal Nothing to be added to CHANGELOG, only internal story macOS specific for Apple MacOS test related to testing and QA

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

mvn test fails on macOS: CheckCommandletTest, InstallCommandletTest, CveCheckInstallTest

4 participants