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

[AL Validation] Validate against NextMajor, NextMinor and dependency? #3458

Closed
Luukjn opened this issue Apr 2, 2024 · 1 comment
Closed

Comments

@Luukjn
Copy link

Luukjn commented Apr 2, 2024

I'm trying to create a script that runs the AL validation against multiple BC versions.
Currently we validate against Current (23.5) and our Dependency (23.0) using the following script

$NewBcContainer = { Param([Hashtable]$parameters) $parameters.add('isolation', 'hyperv'); New-BcContainer @parameters; Invoke-ScriptInBcContainer $parameters.ContainerName -scriptblock { $progressPreference = 'SilentlyContinue' } }

Run-AlValidation `
    -containerName 'validation' `
    -throwOnError `
    -skipVerification `
    -previousApps @($previousApp.FullName) `
    -apps @($latestAppPath) `
    -countries $countries `
    -affixes @('***') `
    -NewBcContainer $NewBcContainer `

When I add the ValidateNextMajor and ValidateNextMinor parameters, the validation only validates against NextMajor and NextMinor (both currently 24.0). I can also validate against current by adding the ValidateCurrent flag, and that works. However, I'm unable to validate against NextMajor, NextMinor, Current, and our dependency (23.0, 23.5, and 24.0) simultaneously.

I've looked at the available parameters of the Run-AlValidation command, but I can't find a way to add our dependency other than by using the ValidateVersion parameter. This doesn't seem like a solid solution to me, since the dependency is also in our app.json. I could extract the dependency from the app.json file prior to validation, but that seems like extra work for something that I think should already work.

Is there a better way to validate against multiple BC versions? Any guidance would be appreciated.

@freddydk
Copy link
Contributor

freddydk commented Apr 2, 2024

If you run Run-AlValidation with no -validate parameters - then it will validate against the dependency AND the current version.
This is similar to what online validation does.

But... - currently you cannot validate against dependency, current, nextmajor AND nextminor in one go.

So... - call Run-AlValidation once with no parameters and once with -validateNextMajor and -validateNextMinor.
Performance wise - there isn't a big difference in doing it like this - less than a second I guess.

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

No branches or pull requests

2 participants