devonfw / ide

Tool to automate setup and update of development environment (esp. for Java projects).
Apache License 2.0
35 stars 101 forks source link

Maven ide tests affect devonfw-ide installations #1144

Open jan-vcapgemini opened 1 year ago

jan-vcapgemini commented 1 year ago

Expected behavior

As a devonfw-ide developer, I want to run the mvn tests on my machine within an isolated environment of devonfw-ide.

Actual behavior

Currently the tests overwrite my devon command inside my $USER_HOME/.devon folder.

If I have introduced an error within my devon command script all of my devon-ide's will be affected.

Steps to reproduce (bug) / Use Case of feature request (enhancement)

  1. Run devon mvn clean install or devon build inside the root of the ide project
  2. Check your $USER_HOME/.devon/devon script

Related/Dependent Issues

Comments/Hints:

This part of the devon script seems to be the cause: https://github.com/devonfw/ide/blob/fa4de78f2aaca0d48b5e36f3d7b7e279e230cf9e/scripts/src/main/resources/scripts/devon#L73-L78

Affected version:

hohwille commented 1 year ago

The code you linked is surrounded by an if that only applies if there is no devon script in ~/.devon/ folder. I also have observed the undesired side-effects you are addressing with this issue and can confirm this problem. However, we need to fully understand what is causing this problem. My guess is that this code-block is causing the problem: https://github.com/devonfw/ide/blob/fa4de78f2aaca0d48b5e36f3d7b7e279e230cf9e/scripts/src/main/resources/scripts/command/ide#L52-L54

hohwille commented 1 year ago

It could also be this one: https://github.com/devonfw/ide/blob/fa4de78f2aaca0d48b5e36f3d7b7e279e230cf9e/scripts/src/main/resources/scripts/command/ide#L181-L187

hohwille commented 1 year ago

@jan-vcapgemini when you have completed your current work and have some time left, could you take this over? I assumed, this story is rather easy but it turned out that the proposed solution did not work (see PR #1272). Could you try to find a real fix for the problem?