devonfw / IDEasy

Tool to automate the setup and updates of a development environment for any project (Successor of devonfw-ide).
Apache License 2.0
7 stars 18 forks source link

#417: added completion script for bash #424

Open hohwille opened 1 week ago

hohwille commented 1 week ago

fixes #417

Current problems

When your are outside of an IDEasy project (no IDE_HOME), you get the error message and that also breaks the completion:

$ ide complete in
You are not inside an IDE installation: D:\projects
IDE_ROOT is not set or not a valid directory.

Error: IDEasy failed with exit code 1

Next our completion needs to be changed to be IDE_HOME aware. That is commandlets shall not be suggested by completion if they require ide home but the user is not in IDE_HOME. Otherwise I get completion support for e.g. ide install mvn but then when I press return I will get the error above. However, ide help or ide create or ide --version can be called from anywhere and should always be offered by completion.

coveralls commented 1 week ago

Pull Request Test Coverage Report for Build 9670180896

Details


Totals Coverage Status
Change from base Build 9663746293: 0.0%
Covered Lines: 4985
Relevant Lines: 7951

💛 - Coveralls
coveralls commented 1 week ago

Pull Request Test Coverage Report for Build 9670183152

Details


Totals Coverage Status
Change from base Build 9663746293: 0.0%
Covered Lines: 4985
Relevant Lines: 7951

💛 - Coveralls
coveralls commented 1 week ago

Pull Request Test Coverage Report for Build 9710154600

Details


Totals Coverage Status
Change from base Build 9708861274: 0.0%
Covered Lines: 4989
Relevant Lines: 7960

💛 - Coveralls
hohwille commented 1 day ago

Local build is successful:

[INFO] Results:
[INFO]
[INFO] Tests run: 214, Failures: 0, Errors: 0, Skipped: 0
...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  24.633 s
[INFO] Finished at: 2024-07-04T18:51:55+02:00
[INFO] ------------------------------------------------------------------------

@jan-vcapgemini also confirmed this on my feature-branch. So what is the difference on github why the build fails there?

[ERROR] Failures: 
[ERROR]   IdeCompleterTest.testIdeCompleterHandlesOptionsBeforeCommand:125->AutocompletionReaderTestSupport.assertBuffer:73->AutocompletionReaderTestSupport.assertBuffer:100 
expected: "get-version mvn "
 but was: "get-version mv"
[ERROR]   IdeCompleterTest.testIdeCompleterHelp:22->AutocompletionReaderTestSupport.assertBuffer:73->AutocompletionReaderTestSupport.assertBuffer:100 
expected: "helm"
 but was: "help "
[ERROR]   IdeCompleterTest.testIdeCompleterInstall:44->AutocompletionReaderTestSupport.assertBuffer:73->AutocompletionReaderTestSupport.assertBuffer:100 
expected: "install mvn "
 but was: "install m"
[INFO] 
[ERROR] Tests run: 214, Failures: 3, Errors: 0, Skipped: 0

Does not make any sence, since this was an error initially and I fixed it and the fix is pushed and arrived on github and is shown in the "files changed" tab as well.