-
Notifications
You must be signed in to change notification settings - Fork 16
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
Unable to execute test from VS Code #124
Comments
Hi, Is the container actually running? And then does the name match the server value that you have in launch.json? Docker container names are case sensitive. It is currently checking for SANDBOX23 in all caps. |
Yes the container is running. I can deploy the app in the container using the launch.json from VS code. |
In that case I guess the case of the name must not match I think. The
server name in launch.json should match the container name exactly e.g.
when you run docker ps
…On Sun, 18 Feb 2024, 09:05 Mesomorf, ***@***.***> wrote:
Yes the container is running. I can deploy the app in the container using
the launch.json from VS code.
—
Reply to this email directly, view it on GitHub
<#124 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AES75YRBYQLJBS4G5ZSFW3DYUG76NAVCNFSM6AAAAABDM7IDWWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNJRGAZTMMRZHA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
I have renamed my docker, to SB, to avoid any spelling errors.
But I still get the error `PS D:\BC\docker\TransSoft\Apps\Base App - Test> if ($null -eq (Get-Module ALTestRunner)) {Import-Module "c:\Users\Jesper.vscode\extensions\jamespearson.al-test-runner-0.10.1\PowerShell\ALTestRunner.psm1" -DisableNameChecking}
|
The Get-ContainerIsRunning function must be returning false. Try running the content of that function directly in the terminal and see what the result is:
If that returns false then check the the Status and StatusJson variables, see what is being returned by docker inspect. |
This returns true `PS C:\Windows\system32> $ContainerName = 'SANDBOX23' PS C:\Windows\system32> $StatusJson = docker inspect $ContainerName if ($PSVersionTable.PSVersion.Major -ge 7) { True` |
Same issue here, unable to use the extension due to weird errors like this.
However, when I run the same function, copied from the terminal window, in Powershell ISE, I get:
If I run this from "Windows Powershell" (not "ISE") the commands also fail ..
I figured out that the JSON "Windows Powershell" outputs contains this line upfront (breaking the json-handling): |
I actually seem to have fixed this particular issues. If I change line Get-ContainerIsRunning.ps1 to: from The json is correctly parsed. |
And I assume we get the same issue in all the other powershell-files as well, because now ..
|
thanks for the update, what does that do? Would you be able to create a pull request with the changes? |
Hi @jimmymcp , Trying to debug tests results in an internal error (500), but that's a separate issue and maybe not even related to AL Test Runner (same thing if I try from Powershell). :) |
When trying to execute a test from VS Code, I am getting this error.
Docker is running locally
`PS D:\BC\docker\TransSoft\Apps\Base App - Test> if ($null -eq (Get-Module ALTestRunner)) {Import-Module "c:\Users\Jesper.vscode\extensions\jamespearson.al-test-runner-0.10.1\PowerShell\ALTestRunner.psm1" -DisableNameChecking}
PS D:\BC\docker\TransSoft\Apps\Base App - Test>
PS D:\BC\docker\TransSoft\Apps\Base App - Test> cd "d:\BC\docker\TransSoft\Apps\Base App - Test"
PS D:\BC\docker\TransSoft\Apps\Base App - Test> Invoke-ALTestRunner -Tests Test -ExtensionId "0320f6fa-984c-4dea-88c4-2362f5fa9687" -ExtensionName "Transsoft - Base App (TEST)" -FileName "d:\BC\docker\TransSoft\Apps\Base App - Test\Source\Planning\Plan Line - Syncronize Date & Time (TEST).Codeunit.al" -SelectionStart 16 -LaunchConfig '{"name":"Docker - Sandbox","request":"launch","type":"al","environmentType":"Sandbox","server":"http://SANDBOX23","serverInstance":"BC","authentication":"UserPassword","startupObjectId":130451,"startupObjectType":"Page","breakOnError":"All","launchBrowser":false,"enableLongRunningSqlStatements":true,"enableSqlInformationDebugger":true,"tenant":"default","usePublicURLFromServer":true}' -GetPerformanceProfile
Container SANDBOX23 is not running. Please start the container and retry. Please note that container names are case-sensitive.
At C:\Users\Jesper.vscode\extensions\jamespearson.al-test-runner-0.10.1\PowerShell\Invoke-ALTestRunner.ps1:29 char:9
PS D:\BC\docker\TransSoft\Apps\Base App - Test> `
My test app launch.config
{ "version": "0.2.0", "configurations": [ { "name": "Docker - Sandbox", "request": "launch", "type": "al", "environmentType": "Sandbox", "server": "http://SANDBOX23", "serverInstance": "BC", "authentication": "UserPassword", "startupObjectId": 130451, "startupObjectType": "Page", "breakOnError": "All", "launchBrowser": false, "enableLongRunningSqlStatements": true, "enableSqlInformationDebugger": true, "tenant": "default", "usePublicURLFromServer": true } ] }
My test app .altestrunner\config.json
{ "containerResultPath": "", "launchConfigName": "Docker - Sandbox", "securePassword": "", "userName": "", "companyName": "My Company", "testSuiteName": "BASE APP", "vmUserName": "", "vmSecurePassword": "", "remoteContainerName": "", "dockerHost": "", "newPSSessionOptions": "", "testRunnerServiceUrl": "http://SANDBOX23:7048/BC/ODataV4/TestRunner?company=My Company\u0026tenant=default", "codeCoveragePath": ".//.altestrunner//codecoverage.json", "culture": "en-US" }
The text was updated successfully, but these errors were encountered: