I am attempting to run some regression tests using CI/CD and the arcgis libraries are not able to be found when the test are ran this way. But when the test.bat file is ran manually all the tests pass. I have followed all the steps in https://github.com/Esri/arcgis-pro-sdk/wiki/ProGuide-Regression-Testing but am unsure if there are additional changes that need to be made to allow for the tests to be ran via CI/CD.
Any advice would be greatly appreciated.
Error message from one of the tests that fails
Error: System.IO.FileNotFoundException: Could not load file or assembly 'ArcGIS.Desktop.Core, Version=13.0.0.0, Culture=neutral, PublicKeyToken=8fc3cc631e44ad86'. The system cannot find the file specified.
Passed GetAllProjects [1 s]
Failed CreateMapOnce [443 ms]
Error Message:
Test method Reg_TESTS_Regression.MapFeatureClass.CreateMapOnce threw exception:
System.Exception: Failed to open Project;
Test Function
[TestMethod]
public async Task CreateMapOnce()
{
CreateProjectSettings createProjectSettings = new CreateProjectSettings()
{
Name = "Test",
};
await Project.CreateAsync(createProjectSettings);
Assert.IsTrue(true);
}
CI/CD code:
test:
stage: test
script:
- .\test.bat
dependencies:
- build_debug
test.bat
call "%VS22Tools%\vsdevcmd"
echo "Dotnet restore"
dotnet restore
echo "Restoring git packages"
nuget restore %Solution%
echo "Build Reg TESTS project"
msbuild.exe %Solution%
echo "Running Reg Tests"
vstest.console.exe Reg_tests\bin\Debug\net6.0-windows\Reg_tests.dll
echo "Running Reg Tests"
vstest.console.exe Reg_TESTS_Regression\bin\Debug\net6.0-windows\Reg_TESTS_Regression.dll