Closed Brunoalves5 closed 2 years ago
What version?
in you app.json, I see that you seem to be using a v14 app. App-testability is very different in an v14 app.
This is a working pipeline on our end on a v14 app - compare it with yours
name: $(Build.BuildId)
# trigger:
# branches:
# include:
# - master
variables:
- group: "Secrets" # link to a variable group that has secret variables, like URL to license file, or sasToken for insider builds
pool: HOD-DOCKER
steps:
- checkout: self
clean: true
- task: ALOpsDockerCreate@1
displayName: "ALOPS - Create Docker Image" # It will reuse the image if already exists, or build one if it doesn't.
inputs:
artifacttype: OnPrem
artifactversion: 14
- task: ALOpsDockerStart@1
displayName: "ALOPS - Start Docker Container" # No need to provide any details - it will get the details from previous step
- task: ALOpsDockerWait@1
displayName: "ALOPS - Wait for Docker Container to start"
inputs:
search_string: "Ready for connections!"
#>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
- task: ALOpsLicenseImport@1
displayName: "ALOPS - License Import"
inputs:
usedocker: true
license_path: "$(bc.license)" # more info: https://www.youtube.com/watch?v=iVLOerdCuwA&t=3078s
- task: ALOpsAppCompiler@1
displayName: "ALOPS - Compile Extension"
inputs:
usedocker: true
nav_app_version: "1.0.[yyyyWW].*"
failed_on_warnings: true
targetproject: "app.json"
- task: ALOpsAppPublish@1
displayName: "Publish AL-App"
inputs:
usedocker: true
nav_artifact_app_filter: "*.app"
skip_verification: true
- task: ALOpsAppTest@1
displayName: "ALOPS - Run TestSuite"
inputs:
usedocker: true
import_action: "Skip"
show_available_tests: true
import_testtoolkit: true
failed_test_action: "Ignore"
testfilter: 50100
continueOnError: true
- task: PublishTestResults@2
displayName: "Publish Test Results **/TestResults.xml"
inputs:
testResultsFormat: XUnit
testResultsFiles: "**/TestResults.xml"
testRunTitle: "BC Test Results: $(Build.BuildId)"
#<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
- task: ALOpsDockerRemove@1
displayName: "ALOPS - Remove Docker Container"
enabled: true
condition: always()
What I can see:
The above yaml is for a big part a copy of this example-pipeline: https://github.com/HodorNV/ALOps/blob/master/Examples/05_UseDocker_TestTool_v14.yml
as you see in the name, it's a v14 pipeline.
hope that helps..
I adapted your yaml file and now it works fine. Thank you. I will now try to tweek and play around it :)
Sorry for following up on this closed issue, @waldo1001. But I'm trying to upgrade the version used to BC 20, I'm again having trouble getting the pipeline to download the symbols with respect to the test toolkit.
This is how I've changed my app.json:
{
"id": "9be7dc95-afe3-46a4-97df-e04ff5de548f",
"name": "Bfalves Thesis",
"publisher": "bfalves",
"version": "1.0.0.0",
"brief": "",
"description": "",
"privacyStatement": "",
"EULA": "",
"help": "",
"url": "",
"logo": "",
"dependencies": [
{
"id": "9856ae4f-d1a7-46ef-89bb-6ef056398228",
"publisher": "Microsoft",
"name": "System Application Test Library",
"version": "20.0.0.0"
},
{
"id": "dd0be2ea-f733-4d65-bb34-a28f4624fb14",
"publisher": "Microsoft",
"name": "Library Assert",
"version": "20.0.0.0"
},
{
"id": "5d86850b-0d76-4eca-bd7b-951ad998e997",
"publisher": "Microsoft",
"name": "Tests-TestLibraries",
"version": "20.0.0.0"
},
{
"id": "5095f467-0a01-4b99-99d1-9ff1237d286f",
"publisher": "Microsoft",
"name": "Library Variable Storage",
"version": "20.0.0.0"
}
],
"screenshots": [],
"platform": "20.0.0.0",
"application": "20.0.0.0",
"test": "20.0.0.0", // is this necessary?
"idRanges": [
{
"from": 50000,
"to": 50149
}
],
"contextSensitiveHelpUrl": "https://BaseALApp.com/help/",
"runtime": "9.0",
"features": ["TranslationFile"],
"target": "Cloud"
}
And this is my new yaml:
name: $(Build.BuildId)
variables:
- group: VariablesBuild
pool:
name: MyAgentPool
steps:
- checkout: self
clean: true
- task: ALOpsDockerCreate@1
displayName: "ALOPS - Create Docker Image" # It will reuse the image if already exists, or build one if it doesn't.
inputs:
artifactversion: 20
artifacttype: OnPrem
- task: ALOpsDockerStart@1
displayName: "ALOPS - Start Docker Container" # No need to provide any details - it will get the details from previous step
- task: ALOpsDockerWait@1
displayName: "ALOPS - Wait for Docker Container to start"
inputs:
search_string: "Ready for connections!"
#>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
- task: ALOpsLicenseImport@1
displayName: "ALOPS - License Import"
inputs:
usedocker: true
license_path: $(LicenseFile2)
- task: ALOpsAppCompiler@1
displayName: "ALOPS - Compile Extension"
inputs:
usedocker: true
targetproject: 'app.json'
nav_app_version: '1.0.[yyyyWW].*'
failed_on_warnings: true
- task: ALOpsAppPublish@1
displayName: "Publish AL-App"
inputs:
usedocker: true
nav_artifact_app_filter: "*.app"
skip_verification: true
- task: ALOpsAppTest@1
displayName: "ALOPS - Run TestSuite"
inputs:
usedocker: true
import_action: "Skip"
show_available_tests: true
import_testtoolkit: true
failed_test_action: "Ignore"
testfilter: 50133
continueOnError: true
- task: PublishTestResults@2
displayName: "Publish Test Results **/TestResults.xml"
inputs:
testResultsFormat: XUnit
testResultsFiles: "**/TestResults.xml"
testRunTitle: "BC Test Results: $(Build.BuildId)"
#<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
- task: ALOpsDockerRemove@1
displayName: "ALOPS - Remove Docker Container"
enabled: true
condition: always()
I've tried many adjustments to these files but nothing seems to work. Any idea what the problem might be?
Thank you.
V20 uses a complete different way of running tests and installing apps and such.
this is not necessary in the yaml:
"test": "20.0.0.0"
This example should help you: https://github.com/HodorNV/ALOps/blob/master/Examples/06_UseDocker_TestTool_v15_Multiroot.yml it shows how to run tests from v15 upwards.
There is a step that installs the test-apps in the container:
- task: ALOpsAppPublish@1
displayName: 'ALOPS - Install AL TestTool' # install necessary dependent apps for testability
inputs:
usedocker: true
installaltesttool: true
skip_verification: true
install_al_app_names: |
Tests-TestLibraries
System Application Test
System Application Test Library
Any
Library Assert
Test Runner
Permissions Mock
Library Variable Storage
And also the test-run is different:
- task: ALOpsAppTest@1
displayName: 'ALOPS - Run TestSuite'
inputs:
usedocker: true
import_action: "Skip"
import_testtoolkit: false
testpage: '130455'
testsuite: 'DEFAULT'
failed_test_action: 'Ignore'
continueOnError: true
I adapted that file to my project, but now I get a different error on "ALOPS - Run TestSuite" step saying that it cant build my test page:
*** Set Docker Container ErrorActionPreference = Stop
*** Copy Modules to Docker
*** Setup Docker Session
*** Checking for container-specific Test Assemblies
*** Using container-specific Test Assemblies
*** Import Modules in Docker Session
*** Import UI Client [C:\Run\DevOps\BCAppTest\bin\Microsoft.Dynamics.Framework.UI.Client.dll]
VERBOSE: Loading module from path 'C:\Run\DevOps\BCAppTest\bin\Microsoft.Dynamics.Framework.UI.Client.dll'.
*** Import NewtonSoft JSON [C:\Program Files\Microsoft Dynamics NAV\200\Service\Newtonsoft.Json.dll]
*** Import Modules in Docker Session: class_ClientContext
*** Test Context Url: https://aef4321ab483/BC/cs?tenant=default
*** Setup BC Credentials in Docker
*** Resolve Docker Credentials
*** Set TCP Keep-Alive
*** Start TestSuite
*** Running TestSuite with authentication [NavUserPassword] with User [admin]
*** Run warm-up with page [50133]
*** Warm-up Client Context
ERROR DIALOG: Cannot build the page 50133.
The metadata object Page 50133 was not found.
*** Create Client Context
*** Get Available Tests for suite [DEFAULT] with page [50133]
Show dialog 00000000-0000-0000-0800-0000836bd2d2
Title: Dialog
ERROR DIALOG: Cannot build the page 50133.
The metadata object Page 50133 was not found.
##[error]Run-Test-Exception: Cannot open page 50133. You might need to import the test toolkit to the container and/or remove the folder and retry. You might also have URL or Company name wrong.
*** Get XUnit Test file from [] to [C:\agent\_work\5\s\]
##[error]Cannot bind argument to parameter 'Path' because it is null.
Finishing: ALOPS - Run TestSuite
I've checked and the page ID is correct, I also separated the test page to a separate 'test' app (to make it more similar to your example).
The yaml file:
name: $(Build.BuildId)
# trigger:
# branches:
# include:
# - master
# - main
variables:
- group: 'VariablesBuild' # link to a variable group that has secret variables, like URL to license file, or sasToken for insider builds
pool: MyAgentPool
steps:
- checkout: self
clean: true
- task: ALOpsDockerCreate@1
displayName: 'ALOPS - Create Docker Image' # It will reuse the image if already exists, or build one if it doesn't.
inputs:
artifacttype: Sandbox
- task: ALOpsDockerStart@1
displayName: 'ALOPS - Start Docker Container' # No need to provide any details - it will get the details from previous step
- task: ALOpsDockerWait@1
displayName: 'ALOPS - Wait for Docker Container to start'
inputs:
search_string: 'Ready for connections!'
- task: ALOpsLicenseImport@1
displayName: 'ALOPS - License Import'
inputs:
usedocker: true
license_path: '$(LicenseFile2)' # more info: https://www.youtube.com/watch?v=iVLOerdCuwA&t=3078s
#>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
- task: ALOpsAppPublish@1
displayName: 'ALOPS - Install AL TestTool' # install necessary dependent apps for testability
inputs:
usedocker: true
installaltesttool: true
skip_verification: true
install_al_app_names: |
Tests-TestLibraries
System Application Test
System Application Test Library
Any
Library Assert
Test Runner
Permissions Mock
Library Variable Storage
#<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
- task: ALOpsAppCompiler@1
displayName: 'ALOPS - Compile Extension: App'
inputs:
usedocker: true
nav_app_version: '1.0.[yyyyWW].*'
targetproject: 'app/app.json' # The App
failed_on_warnings: true
app_file_suffix: '_APP' # A trick to uniquely identify the APP (from the TEST-app)
- task: ALOpsAppPublish@1
displayName: 'ALOPS - Publish Extension'
inputs:
usedocker: true
nav_artifact_app_filter: '*.app'
skip_verification: true
- task: ALOpsAppCompiler@1
displayName: 'ALOPS - Compile Extension: App'
inputs:
usedocker: true
nav_app_version: '1.0.[yyyyWW].*'
targetproject: 'test/app.json' # The Test-App
failed_on_warnings: true
app_file_suffix: '_TEST' # A trick to uniquely identify the Test-App (from the App)
- task: ALOpsAppPublish@1
displayName: 'ALOPS - Publish Extension'
inputs:
usedocker: true
nav_artifact_app_filter: '*.app'
skip_verification: true
#>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
- task: ALOpsAppTest@1
displayName: 'ALOPS - Run TestSuite'
inputs:
usedocker: true
import_action: "Skip"
import_testtoolkit: false
testpage: '50133'
testsuite: 'DEFAULT'
failed_test_action: 'Ignore'
continueOnError: true
- task: PublishTestResults@2
displayName: 'Publish Test Results **/TestResults.xml'
inputs:
testResultsFormat: XUnit
testResultsFiles: '**/TestResults.xml'
testRunTitle: 'BC Test Results: $(Build.BuildId)'
#<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
- task: ALOpsDockerRemove@1
displayName: 'ALOPS - Remove Docker Container'
enabled: true
condition: always()
Why don't you use the default page?
Can't say much about custom pages where the pipeline says it doesn't find or doesn't work 🤷♀️.
You're right, I didn't know that was the default test page in the example, I thought I had to declare my own test page.
But it works with the default :)
Hi,
I'm trying to setup a very simple build pipeline that just compiles and runs tests on an app. I was following the SettingUpYourFirstBuild tutorial.
But it keeps failing when trying to download the test dependency. Am I supposed to change anything on the app.json? It looks fine to me.
The error:
My app.json:
Here's the yaml file:
Here's the complete output of the step :