Skip to content

Conversation

@maybeec
Copy link
Member

@maybeec maybeec commented Dec 15, 2025

This PR fixes #1405

This PR addresses the issue where integration tests were failing when executed in alphabetical order due to environment interference between tests.

Root Cause

The original issue occurred when verify-longpaths.sh was renamed to ensure-longpaths.sh, causing it to run first alphabetically. The test used $IDE -f install which performs a forced full IDEasy installation that modifies the global environment and interferes with subsequent tests. The install-intellij.sh test expected a clean environment for tool-specific installation.

Implemented changes:

  • Improved OS detection: Added doGetOsType() function to detect OS type based on $OSTYPE instead of relying on GitHub workflow matrix variables (MATRIX_OS). This makes tests more portable and runnable outside GitHub Actions.
  • Updated test infrastructure: Modified doDownloadSnapshot(), doIsMacOs(), and doIsWindows() functions to use the new OS detection method.
  • Test isolation improvements: Added environment backup/restore mechanism in all-tests.sh:
    • Backs up and restores IDE_ROOT and PATH environment variables
    • Backs up and restores shell RC files (.bashrc, .zshrc) to prevent user configuration corruption
    • Resets test variables between each test execution using doResetVariables()
    • Added trap to ensure cleanup happens even on errors
  • Improved error handling: Made the upgrade process more robust by continuing with downloaded version if upgrade fails
  • Better function file detection: Added fallback logic to locate the functions file in both installation path and root directory
  • New integration test: Added force-install.sh test to reproduce and validate the environment interference issue

These changes ensure that all integration tests succeed regardless of execution order, maintaining proper test independence.


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). If no issue ID exists, title only.
  • PR top-level comment summarizes 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 labeled
    with internal

Note: This PR replaces #1417 which was created by copilot-swe-agent. Due to CLA assistant issues with copilot-authored commits, the changes have been manually recreated with proper authorship attribution.

@github-project-automation github-project-automation bot moved this to 🆕 New in IDEasy board Dec 15, 2025
@maybeec maybeec moved this from 🆕 New to Team Review in IDEasy board Dec 15, 2025
@maybeec maybeec added internal Nothing to be added to CHANGELOG, only internal story integration-tests automated integration tests (see badge in README) labels Dec 15, 2025
@coveralls
Copy link
Collaborator

coveralls commented Dec 15, 2025

Pull Request Test Coverage Report for Build 20335246277

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 70.088%

Totals Coverage Status
Change from base Build 20334239472: 0.0%
Covered Lines: 10188
Relevant Lines: 13961

💛 - Coveralls

@hohwille hohwille merged commit 339dbf1 into devonfw:main Dec 18, 2025
3 checks passed
@github-project-automation github-project-automation bot moved this from Team Review to ✅ Done in IDEasy board Dec 18, 2025
@hohwille hohwille added this to the release:2025.12.001 milestone Dec 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration-tests automated integration tests (see badge in README) internal Nothing to be added to CHANGELOG, only internal story

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

integration tests fail if executed in specific order

3 participants