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

IDEasy tests fail if gitbash is forced to run as admin #1079

Open
mbilda opened this issue Feb 25, 2025 · 1 comment
Open

IDEasy tests fail if gitbash is forced to run as admin #1079

mbilda opened this issue Feb 25, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@mbilda
Copy link
Contributor

mbilda commented Feb 25, 2025

Expected behavior

As a dev, I want to execute IDEasy tests via mvn goal (cmd) or via IntelliJ maven goal so that the project gets build

Actual behavior

The tests fail with the following exception:

[ERROR] Failures:
[ERROR]   ProcessContextImplTest.enablingCaptureShouldRedirectAndCaptureStreamsWithErrorsCorrectly:217
Expecting actual:
  "Running command 'src\test\resources\process-context\dotnet.sh' using bash failed: Cannot run program "C:\Program Files\Git\bin\bash.exe": CreateProcess error=740, The requested operation requires elevation"
to contain:
  "failed with exit code 2"
[ERROR] Errors:
[ERROR]   CliAdvancedParsingTest.testPreventShortOptionsForMultivaluedArguments:26 » IllegalState Running command 'C:\Projects\IDEasy\workspaces\main\IDEasy\cli\target\test-projects\mvn\_ide\software\default\java\java\17.0.10_7\bin\java' using bash with arguments '-version' failed: Cannot run program "C:\Program Files\Git\bin\bash.exe": CreateProcess error=740, The requested operation requires elevation
[ERROR]   BuildCommandletTest.testGradleBuildWithProvidedArguments:67 » IllegalState Running command 'C:\Projects\IDEasy\workspaces\main\IDEasy\cli\target\test-projects\build\_ide\software\default\gradle\gradle\8.7\bin\gradle' using bash with arguments 'task1' 'task2' failed: Cannot run program "C:\Program Files\Git\bin\bash.exe": CreateProcess error=740, The requested operation requires elevation
[ERROR]   BuildCommandletTest.testMvnBuildWithProvidedArguments:50 » IllegalState Running command 'C:\Projects\IDEasy\workspaces\main\IDEasy\cli\target\test-projects\build\_ide\software\default\mvn\mvn\3.9.6\bin\mvn' using bash with arguments 'clean' 'install' failed: Cannot run program "C:\Program Files\Git\bin\bash.exe": CreateProcess error=740, The requested operation requires elevation
[ERROR]   BuildCommandletTest.testMvnBuildWithoutProvidedArgumentsUsesDefaultOptions:32 » IllegalState Running command 'C:\Projects\IDEasy\workspaces\main\IDEasy\cli\target\test-projects\build\_ide\software\default\mvn\mvn\3.9.6\bin\mvn' using bash with arguments 'clean' 'compile' failed: Cannot run program "C:\Program Files\Git\bin\bash.exe": CreateProcess error=740, The requested operation requires elevation
[ERROR]   BuildCommandletTest.testNpmBuildWithProvidedArguments:86 » IllegalState Running command 'C:\Projects\IDEasy\workspaces\main\IDEasy\cli\target\test-projects\build\_ide\software\default\npm\npm\9.9.2\bin\npm' using bash with arguments 'start' 'test' failed: Cannot run program "C:\Program Files\Git\bin\bash.exe": CreateProcess error=740, The requested operation requires elevation
[ERROR]   HelpCommandletTest.testRunWithCommandlet:77 » IllegalState Running command 'C:\Projects\IDEasy\workspaces\main\IDEasy\cli\target\test-projects\basic\project\software\mvn\bin\mvn' using bash with arguments '-h' failed: Cannot run program "C:\Program Files\Git\bin\bash.exe": CreateProcess error=740, The requested operation requires elevation
[ERROR]   ProcessContextImplTest.defaultCaptureShouldCaptureStreamsWithCorrectOrder:230 » IllegalState Running command 'src\test\resources\process-context\log-order.sh' using bash failed: Cannot run program "C:\Program Files\Git\bin\bash.exe": CreateProcess error=740, The requested operation requires elevation
[ERROR]   AndroidStudioTest.testAndroidStudioRun:72 » IllegalState Running command 'C:\Projects\IDEasy\workspaces\main\IDEasy\cli\target\test-projects\android-studio\_ide\software\default\android-studio\android-studio\2024.1.1.1\bin\studio64.exe' using bash with arguments 'C:\Projects\IDEasy\workspaces\main\IDEasy\cli\target\test-projects\android-studio\project\workspaces\main' failed: Cannot run program "C:\Program Files\Git\bin\bash.exe": CreateProcess error=740, The requested operation requires elevation
[ERROR]   AndroidStudioTest.testAndroidStudioRun:72 » IllegalState Running command 'C:\Projects\IDEasy\workspaces\main\IDEasy\cli\target\test-projects\android-studio\_ide\software\default\android-studio\android-studio\2024.1.1.1\Android Studio Preview.app\Contents\MacOS\studio' using bash with arguments 'C:\Projects\IDEasy\workspaces\main\IDEasy\cli\target\test-projects\android-studio\project\workspaces\main' failed: Cannot run program "C:\Program Files\Git\bin\bash.exe": CreateProcess error=740, The requested operation requires elevation
[ERROR]   AndroidStudioTest.testAndroidStudioRun:72 » IllegalState Running command 'C:\Projects\IDEasy\workspaces\main\IDEasy\cli\target\test-projects\android-studio\_ide\software\default\android-studio\android-studio\2024.1.1.1\bin\studio.sh' using bash with arguments 'C:\Projects\IDEasy\workspaces\main\IDEasy\cli\target\test-projects\android-studio\project\workspaces\main' failed: Cannot run program "C:\Program Files\Git\bin\bash.exe": CreateProcess error=740, The requested operation requires elevation
[ERROR]   DotNetTest.dotnetShouldRunExecutableSuccessful:63->runExecutable:85 » IllegalState Running command 'C:\Projects\IDEasy\workspaces\main\IDEasy\cli\target\test-projects\dotnet\_ide\software\default\dotnet\dotnet\6.0.419\dotnet.exe' using bash failed: Cannot run program "C:\Program Files\Git\bin\bash.exe": CreateProcess error=740, The requested operation requires elevation
[ERROR]   DotNetTest.dotnetShouldRunExecutableSuccessful:63->runExecutable:85 » IllegalState Running command 'C:\Projects\IDEasy\workspaces\main\IDEasy\cli\target\test-projects\dotnet\_ide\software\default\dotnet\dotnet\6.0.419\dotnet' using bash failed: Cannot run program "C:\Program Files\Git\bin\bash.exe": CreateProcess error=740, The requested operation requires elevation
[ERROR]   DotNetTest.dotnetShouldRunExecutableSuccessful:63->runExecutable:85 » IllegalState Running command 'C:\Projects\IDEasy\workspaces\main\IDEasy\cli\target\test-projects\dotnet\_ide\software\default\dotnet\dotnet\6.0.419\dotnet' using bash failed: Cannot run program "C:\Program Files\Git\bin\bash.exe": CreateProcess error=740, The requested operation requires elevation
[ERROR]   EclipseTest.testEclipse:40 » IllegalState Running command 'C:\Projects\IDEasy\workspaces\main\IDEasy\cli\target\test-projects\eclipse\_ide\software\default\eclipse\eclipse\2024-09\eclipsec' using bash with arguments '-data' 'C:\Projects\IDEasy\workspaces\main\IDEasy\cli\target\test-projects\eclipse\eclipseproject\workspaces\main' '-keyring' 'C:\Projects\IDEasy\workspaces\main\IDEasy\cli\target\test-projects\eclipse\eclipseproject\home\.eclipse\.keyring' '-configuration' 'C:\Projects\IDEasy\workspaces\main\IDEasy\cli\target\test-projects\eclipse\eclipseproject\plugins\eclipse\configuration' '-consoleLog' '-nosplash' '-application' 'org.eclipse.equinox.p2.director' '-repository' 'https://raw.githubusercontent.com/iloveeclipse/plugins/latest/' '-installIU' 'AnyEditTools.feature.group' failed: Cannot run program "C:\Program Files\Git\bin\bash.exe": CreateProcess error=740, The requested operation requires elevation
[ERROR]   EclipseTest.testEclipse:40 » IllegalState Running command 'C:\Projects\IDEasy\workspaces\main\IDEasy\cli\target\test-projects\eclipse\_ide\software\default\eclipse\eclipse\2024-09\Eclipse.app\Contents\MacOS\eclipse' using bash with arguments '-data' 'C:\Projects\IDEasy\workspaces\main\IDEasy\cli\target\test-projects\eclipse\eclipseproject\workspaces\main' '-keyring' 'C:\Projects\IDEasy\workspaces\main\IDEasy\cli\target\test-projects\eclipse\eclipseproject\home\.eclipse\.keyring' '-configuration' 'C:\Projects\IDEasy\workspaces\main\IDEasy\cli\target\test-projects\eclipse\eclipseproject\plugins\eclipse\configuration' '-consoleLog' '-nosplash' '-application' 'org.eclipse.equinox.p2.director' '-repository' 'https://raw.githubusercontent.com/iloveeclipse/plugins/latest/' '-installIU' 'AnyEditTools.feature.group' failed: Cannot run program "C:\Program Files\Git\bin\bash.exe": CreateProcess error=740, The requested operation requires elevation
[ERROR]   EclipseTest.testEclipse:40 » IllegalState Running command 'C:\Projects\IDEasy\workspaces\main\IDEasy\cli\target\test-projects\eclipse\_ide\software\default\eclipse\eclipse\2024-09\eclipse' using bash with arguments '-data' 'C:\Projects\IDEasy\workspaces\main\IDEasy\cli\target\test-projects\eclipse\eclipseproject\workspaces\main' '-keyring' 'C:\Projects\IDEasy\workspaces\main\IDEasy\cli\target\test-projects\eclipse\eclipseproject\home\.eclipse\.keyring' '-configuration' 'C:\Projects\IDEasy\workspaces\main\IDEasy\cli\target\test-projects\eclipse\eclipseproject\plugins\eclipse\configuration' '-consoleLog' '-nosplash' '-application' 'org.eclipse.equinox.p2.director' '-repository' 'https://raw.githubusercontent.com/iloveeclipse/plugins/latest/' '-installIU' 'AnyEditTools.feature.group' failed: Cannot run program "C:\Program Files\Git\bin\bash.exe": CreateProcess error=740, The requested operation requires elevation
[ERROR]   GradleTest.testGradleRun:55 » IllegalState Running command 'C:\Projects\IDEasy\workspaces\main\IDEasy\cli\target\test-projects\gradle\_ide\software\default\gradle\gradle\8.7\bin\gradle' using bash with arguments 'foo' 'bar' failed: Cannot run program "C:\Program Files\Git\bin\bash.exe": CreateProcess error=740, The requested operation requires elevation
[ERROR]   IdeToolCommandletTest.testConfigureWorkspace:25 » IllegalState Running command 'C:\Projects\IDEasy\workspaces\main\IDEasy\cli\target\test-projects\intellij\_ide\software\default\intellij\intellij\2023.3.3\bin\idea64.exe' using bash with arguments 'installPlugins' 'activePlugin' 'http://customRepo' failed: Cannot run program "C:\Program Files\Git\bin\bash.exe": CreateProcess error=740, The requested operation requires elevation
[ERROR]   IntellijTest.testIntellijInstall:37 » IllegalState Running command 'C:\Projects\IDEasy\workspaces\main\IDEasy\cli\target\test-projects\intellij\_ide\software\default\intellij\intellij\2023.3.3\bin\idea64.exe' using bash with arguments 'installPlugins' 'activePlugin' 'http://customRepo' failed: Cannot run program "C:\Program Files\Git\bin\bash.exe": CreateProcess error=740, The requested operation requires elevation
[ERROR]   IntellijTest.testIntellijInstall:37 » IllegalState Running command 'C:\Projects\IDEasy\workspaces\main\IDEasy\cli\target\test-projects\intellij\_ide\software\default\intellij\intellij\2023.3.3\IntelliJ IDEA CE.app\Contents\MacOS\idea' using bash with arguments 'installPlugins' 'activePlugin' 'http://customRepo' failed: Cannot run program "C:\Program Files\Git\bin\bash.exe": CreateProcess error=740, The requested operation requires elevation
[ERROR]   IntellijTest.testIntellijInstall:37 » IllegalState Running command 'C:\Projects\IDEasy\workspaces\main\IDEasy\cli\target\test-projects\intellij\_ide\software\default\intellij\intellij\2023.3.3\bin\idea.sh' using bash with arguments 'installPlugins' 'activePlugin' 'http://customRepo' failed: Cannot run program "C:\Program Files\Git\bin\bash.exe": CreateProcess $
[ERROR]   IntellijTest.testIntellijInstallPluginWithCustomRepoUrl:137 » IllegalState Running command 'C:\Projects\IDEasy\workspaces\main\IDEasy\cli\target\test-projects\intellij\_ide\software\default\intellij\intellij\2023.3.3\bin\idea64.exe' using bash with arguments 'installPlugins' 'activePlugin' 'http://customRepo' failed: Cannot run program "C:\Program Files\Git\bin\bash.exe": CreateProcess error=740, The requested operation requires elevation
[ERROR]   IntellijTest.testIntellijInstallPluginWithCustomRepoUrl:137 » IllegalState Running command 'C:\Projects\IDEasy\workspaces\main\IDEasy\cli\target\test-projects\intellij\_ide\software\default\intellij\intellij\2023.3.3\IntelliJ IDEA CE.app\Contents\MacOS\idea' using bash with arguments 'installPlugins' 'activePlugin' 'http://customRepo' failed: Cannot run program "C:\Program Files\Git\bin\bash.exe": CreateProcess error=740, The requested operation requires elevation
[ERROR]   IntellijTest.testIntellijInstallPluginWithCustomRepoUrl:137 » IllegalState Running command 'C:\Projects\IDEasy\workspaces\main\IDEasy\cli\target\test-projects\intellij\_ide\software\default\intellij\intellij\2023.3.3\bin\idea.sh' using bash with arguments 'installPlugins' 'activePlugin' 'http://customRepo' failed: Cannot run program "C:\Program Files\Git\bin\bash.exe": CreateProcess error=740, The requested operation requires elevation
[ERROR]   IntellijTest.testIntellijPluginInstallWithCustomRepoUrl:113 » IllegalState Running command 'C:\Projects\IDEasy\workspaces\main\IDEasy\cli\target\test-projects\intellij\_ide\software\default\intellij\intellij\2023.3.3\bin\idea64.exe' using bash with arguments 'installPlugins' 'activePlugin' 'http://customRepo' failed: Cannot run program "C:\Program Files\Git\bin\bash.exe": CreateProcess error=740, The requested operation requires elevation
[ERROR]   IntellijTest.testIntellijPluginInstallWithCustomRepoUrl:113 » IllegalState Running command 'C:\Projects\IDEasy\workspaces\main\IDEasy\cli\target\test-projects\intellij\_ide\software\default\intellij\intellij\2023.3.3\IntelliJ IDEA CE.app\Contents\MacOS\idea' using bash with arguments 'installPlugins' 'activePlugin' 'http://customRepo' failed: Cannot run program "C:\Program Files\Git\bin\bash.exe": CreateProcess error=740, The requested operation requires elevation
[ERROR]   IntellijTest.testIntellijPluginInstallWithCustomRepoUrl:113 » IllegalState Running command 'C:\Projects\IDEasy\workspaces\main\IDEasy\cli\target\test-projects\intellij\_ide\software\default\intellij\intellij\2023.3.3\bin\idea.sh' using bash with arguments 'installPlugins' 'activePlugin' 'http://customRepo' failed: Cannot run program "C:\Program Files\Git\bin\bash.exe": CreateProcess error=740, The requested operation requires elevation
[ERROR]   IntellijTest.testIntellijRun:90 » IllegalState Running command 'C:\Projects\IDEasy\workspaces\main\IDEasy\cli\target\test-projects\intellij\_ide\software\default\intellij\intellij\2023.3.3\bin\idea64.exe' using bash with arguments 'installPlugins' 'activePlugin' 'http://customRepo' failed: Cannot run program "C:\Program Files\Git\bin\bash.exe": CreateProcess error=740, The requested operation requires elevation
[ERROR]   IntellijTest.testIntellijRun:90 » IllegalState Running command 'C:\Projects\IDEasy\workspaces\main\IDEasy\cli\target\test-projects\intellij\_ide\software\default\intellij\intellij\2023.3.3\IntelliJ IDEA CE.app\Contents\MacOS\idea' using bash with arguments 'installPlugins' 'activePlugin' 'http://customRepo' failed: Cannot run program "C:\Program Files\Git\bin\bash.exe": CreateProcess error=740, The requested operation requires elevation
[ERROR]   IntellijTest.testIntellijRun:90 » IllegalState Running command 'C:\Projects\IDEasy\workspaces\main\IDEasy\cli\target\test-projects\intellij\_ide\software\default\intellij\intellij\2023.3.3\bin\idea.sh' using bash with arguments 'installPlugins' 'activePlugin' 'http://customRepo' failed: Cannot run program "C:\Program Files\Git\bin\bash.exe": CreateProcess error=740, The requested operation requires elevation
[ERROR]   IntellijTest.testIntellijUninstallPluginAfterwards:62 » IllegalState Running command 'C:\Projects\IDEasy\workspaces\main\IDEasy\cli\target\test-projects\intellij\_ide\software\default\intellij\intellij\2023.3.3\bin\idea64.exe' using bash with arguments 'installPlugins' 'activePlugin' 'http://customRepo' failed: Cannot run program "C:\Program Files\Git\bin\bash.exe": CreateProcess error=740, The requested operation requires elevation
[ERROR]   IntellijTest.testIntellijUninstallPluginAfterwards:62 » IllegalState Running command 'C:\Projects\IDEasy\workspaces\main\IDEasy\cli\target\test-projects\intellij\_ide\software\default\intellij\intellij\2023.3.3\IntelliJ IDEA CE.app\Contents\MacOS\idea' using bash with arguments 'installPlugins' 'activePlugin' 'http://customRepo' failed: Cannot run program "C:\Program Files\Git\bin\bash.exe": CreateProcess error=740, The requested operation requires elevation
[ERROR]   IntellijTest.testIntellijUninstallPluginAfterwards:62 » IllegalState Running command 'C:\Projects\IDEasy\workspaces\main\IDEasy\cli\target\test-projects\intellij\_ide\software\default\intellij\intellij\2023.3.3\bin\idea.sh' using bash with arguments 'installPlugins' 'activePlugin' 'http://customRepo' failed: Cannot run program "C:\Program Files\Git\bin\bash.exe": CreateProcess error=740, The requested operation requires elevation
[ERROR]   JasyptTest.testJasyptRun:68 » IllegalState Running command 'C:\Projects\IDEasy\workspaces\main\IDEasy\cli\target\test-projects\jasypt\_ide\software\default\java\java\17.0.10_7\bin\java' using bash with arguments '-cp' 'C:\Projects\IDEasy\workspaces\main\IDEasy\cli\target\test-projects\jasypt\project\software\jasypt\jasypt-1.9.3.jar' 'org.jasypt.intf.cli.JasyptPBEStringEncryptionCLI' 'password=password' 'input=input' 'algorithm=PBEWITHHMACSHA512ANDAES_256' 'ivGeneratorClassName=org.jasypt.iv.RandomIvGenerator' failed: Cannot run program "C:\Program Files\Git\bin\bash.exe": CreateProcess error=740, The requested operation requires elevation
[ERROR]   JasyptTest.testJasyptRunWithCustomVariable:91 » IllegalState Running command 'C:\Projects\IDEasy\workspaces\main\IDEasy\cli\target\test-projects\jasypt\_ide\software\default\java\java\17.0.10_7\bin\java' using bash with arguments '-cp' 'C:\Projects\IDEasy\workspaces\main\IDEasy\cli\target\test-projects\jasypt\project\software\jasypt\jasypt-1.9.3.jar' 'org.jasypt.intf.cli.JasyptPBEStringEncryptionCLI' 'password=password' 'input=input' 'custom_argument' failed: Cannot run program "C:\Program Files\Git\bin\bash.exe": CreateProcess error=740, The requested operation requires elevation
[ERROR]   JmcTest.testJmcRun:64 » IllegalState Running command 'C:\Projects\IDEasy\workspaces\main\IDEasy\cli\target\test-projects\jmc\_ide\software\default\jmc\jmc\8.3.0\JDK Mission Control.app\Contents\MacOS\jmc' using bash with arguments 'foo' 'bar' failed: Cannot run program "C:\Program Files\Git\bin\bash.exe": CreateProcess error=740, The requested operation requires elevation
[ERROR]   JmcTest.testJmcRun:64 » IllegalState Running command 'C:\Projects\IDEasy\workspaces\main\IDEasy\cli\target\test-projects\jmc\_ide\software\default\jmc\jmc\8.3.0\jmc' using bash with arguments 'foo' 'bar' failed: Cannot run program "C:\Program Files\Git\bin\bash.exe": CreateProcess error=740, The requested operation requires elevation
[ERROR]   MvnTest.testMvnInstall:43 » IllegalState Running command 'C:\Projects\IDEasy\workspaces\main\IDEasy\cli\target\test-projects\mvn\_ide\software\default\mvn\mvn\3.9.7\bin\mvn' using bash with arguments '--encrypt-master-password' 'J58auaKAhXNuhJEgZTJXnAd6IAQ=' failed: Cannot run program "C:\Program Files\Git\bin\bash.exe": CreateProcess error=740, The requested operation requires elevation
[ERROR]   MvnTest.testMvnRun:66 » IllegalState Running command 'C:\Projects\IDEasy\workspaces\main\IDEasy\cli\target\test-projects\mvn\_ide\software\default\mvn\mvn\3.9.7\bin\mvn' using bash with arguments '--encrypt-master-password' '9ImysNbbQlIOYyAWs+tSwJnT4qQ=' failed: Cannot run program "C:\Program Files\Git\bin\bash.exe": CreateProcess error=740, The requested operation requires elevation

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

  1. Navigate to the gitbash.exe file in your explorer (Propably at C:\Program Files\Git\bin)
  2. Right-Click -> properties -> Compatibility
  3. Check "Run this program as an administrator"
  4. Apply
  5. Execute tests (e.g. mvn clean install)

Related/Dependent Issues

Comments/Hints:

If the "Run this program as an administrator" is checked, setup.bat also doesn't work like expected when ideasy is already installed.

Image

If "Run this program as an administrator" is NOT checked and setup.bat is executed

Image

Affected version:

2025.02.001-beta

  • OS: Windows
  • Browser: none
@mbilda mbilda added the bug Something isn't working label Feb 25, 2025
@github-project-automation github-project-automation bot moved this to 🆕 New in IDEasy board Feb 25, 2025
@hohwille
Copy link
Member

I was not able to reproduce this bug as described.
After making the changes (Run as administrator), I got a UAC Popup.
If I reject to grant admin rights, then the process is not started at all and the setup.bat fails like illustrated in the screenshot.
That is not a bug - if you prevent git-bash from being executed then IDEasy cannot start it and therefore the setup fails that needs it. You can also delete git bash or git and then you will notice that IDEasy stops working since this is a pre-requisite for IDEasy as documented on our website.

However, if I answered the UAC Popup with Yes and granted admin rights, the setup worked.
The installation afterwards is fully functional.

Finally, I would rather consider that setting "run as admin" for processes like bash.exe is the actual bug.
Why would I do that? This seems just a wrong configuration done by the end user.
So IMHO this bug report might be closed as invalid.

However, we might want to do a screen-sharing since your situation behaves quite differently and if we have many users in the future and someone else might run into the same problem, it will still not be easy to trace down what is going wrong and why. If we can somehow detect the problem during our setup and show a better error message, it might still be helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: 🆕 New
Development

No branches or pull requests

2 participants