jimmymcp / al-test-runner

VS Code Extension to help run AL tests against Business Central container
https://jpearson.blog/al-test-runner-for-visual-studio-code/
MIT License
12 stars 16 forks source link

Invoke-ALTestRunner uses wrong webservice port for internal calls #136

Closed StefanMaron closed 7 months ago

StefanMaron commented 7 months ago

if you use a different port mapping for the contianer

$additionalParameters = @(
"--publish $($httpPort):80",
"--publish $($httpsPort):443",
"--publish 7246-7249:7046-7049",
"--env publicFileSharePort=8080",
"--env RemovePasswordKeyFile=N",
"--env CustomNavSettings=DisableWriteInsideTryFunctions=false"
)

you also want adjust the server config in the container

Set-BcContainerServerConfiguration -ContainerName $containerName -keyName PublicWebBaseUrl -keyValue ($PublicWebBaseUrl.TrimEnd('/BC/') + ":$($httpPort)/BC/")

Resulting in the Test runner to call this: http://localhost:8082/BC/cs?tenant=default&company=CRONUS%20USA%2C%20Inc. instead of this http://localhost/BC/cs?tenant=default&company=CRONUS%20USA%2C%20Inc.

jimmymcp commented 7 months ago

Do you think this is a problem with AL Test Runner or with the Run-TestsInNavContainer command in the BCContainerHelper module?

StefanMaron commented 7 months ago

You are right, thats the containerhelper https://github.com/microsoft/navcontainerhelper/blob/f5784320e52bbfe295e717652a82e9c8399ea42d/AppHandling/Run-TestsInNavContainer.ps1#L398