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

Install Test Runner Service: support for VSC workspaces (launch config) #130

Open
christianbraeunlich opened this issue Mar 8, 2024 · 1 comment

Comments

@christianbraeunlich
Copy link

Hello there,

when trying to install the Test Runner Service from within a vscode workspace via vscode command AL Test Runner: Install Test Runner Service it throws an error.

Used sample project structure:

root
├── app
|   ├── .alpackages
|   ├── src
|   └── app.json
├── test
|   ├── .alpackages
|   ├── src
|   └── app.json
├── README.md
└── testproject.code-workspace

Error message:

PS C:\Users\notebook\Documents\AL\ALProject4\test> if ($null -eq (Get-Module ALTestRunner)) {Import-Module "c:\Users\notebook\.vscode\extensions\jamespearson.al-test-runner-10.10.10\PowerShell\ALTestRunner.psm1" -DisableNameChecking}
PS C:\Users\notebook\Documents\AL\ALProject4\test> Install-TestRunnerService -LaunchConfig 'undefined'
Get-Content : Der Pfad "C:\Users\notebook\Documents\AL\ALProject4\test\.vscode\launch.json" kann nicht 
gefunden werden, da er nicht vorhanden ist.
In C:\Users\notebook\.vscode\extensions\jamespearson.al-test-runner-0.10.3\PowerShell\Select-ALTestRunnerCo 
nfig.ps1:7 Zeichen:37
+     $LaunchJson = ConvertFrom-Json (Get-Content $LaunchJsonPath -Raw)
+                                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (C:\Users\notebook\launch.json:String) [Get-Content], ItemN  
   otFoundException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetContentCommand

ConvertFrom-Json : Das Argument kann nicht an den Parameter "InputObject" gebunden werden, da es NULL ist.     
In C:\Users\notebook\.vscode\extensions\jamespearson.al-test-runner-0.10.3\PowerShell\Select-ALTestRunnerCo 
nfig.ps1:7 Zeichen:36
+     $LaunchJson = ConvertFrom-Json (Get-Content $LaunchJsonPath -Raw)
+                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [ConvertFrom-Json], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.Co  
   nvertFromJsonCommand

Please enter the name of the launch configuration to use in the AL Test Runner config file.
In C:\Users\notebook\.vscode\extensions\jamespearson.al-test-runner-0.10.3\PowerShell\Select-ALTestRunnerCo 
nfig.ps1:14 Zeichen:9
+         throw "Please enter the name of the launch configuration to u ...
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (Please enter th...er config file.:String) [], RuntimeExcepti  
   on
    + FullyQualifiedErrorId : Please enter the name of the launch configuration to use in the AL Test Runner   
   config file.

Would it be possible to extend the Install Test Runner Service command by support for VSC workspaces (related to #79) as well?

Thanks in advance
/Christian

@jimmymcp
Copy link
Owner

jimmymcp commented Nov 4, 2024

Sorry, getting round to looking at some old open issues today. Is this still a problem? In your example it looks like VS Code couldn't find any launch settings for the test folder. The extension uses the VS Code API for this which should look in the folder/workspace settings/user settings to retrieve launch settings.

Maybe this doesn't work well if you haven't already selected a launch config to use with the extension? You are prompted to do that when you are running a test and haven't already selected a launch profile, but maybe not when just installing the test runner service.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants