Prerequisites:
- Windows SDK for CppSDK
- LocalRunHelper.exe with the
help of Nuget package (Microsoft.Azure.DataLake.USQL.SDK)
Writing
Test Case
You
can write the test case in the following two different ways by using
LocalRunHelper.exe
- With the help of creating a Process
- With the help of Class by adding it as a project reference
- Make sure LocalRunHelper.exe is part of bin\x64\release folder
- Make sure the CppSDK folder is also part of bin\x64\release folder
- If you build, then make sure the LocalRunHelper.exe (all its dependencies and CPPSDK) to be part of bin\x64\debug or current working folder.
- Add localrunHelper.exe as a project reference
Unit Testing on Local
Machine
- Set up Test Framework Settings:
Default Processor Architecture for
Test Framework Settings – x64
2. Build solution for x64 Platform
a.
Choose Solution platform x64, as CPPSDK supports
only 64 bit.
3. Set the Platform target to x64 under build
project properties
Testing on Hosted
Agent
1. Ignore the U-SQL Project in Build:
·
As MSBuild Task doesn’t build the Project of type
of U-SQL, So we need to skip this project type for building.
·
Go to Configuration Manager and Uncheck the
Build Check box for the respective U-SQL Projects.
Create a *.runsettings
file and specify the TargetPlatform
to be x64 and TargetFrameworkVersion to be Framework45.
Troubleshooting Tips:
1. In case there is an error and you are unable to identify
the route cause for the failure of the testcase/job, run the following command
in command prompt which will show you the error.
LocalRunHelper run -Script path_to_usql_script.usql
[optional_arguments]
2. If the test cases are not visible in
Local/Hosted Agent, verify if the Test Framework settings are set as x64.
3. If the test case is failing in local for a
reason like *.dll is missing, then check if the CppSDK path is set properly.
4. DataRoot path need not to be a part of current
working directory, However, If you are running the test cases on Hosted agent, (as
part of CI/CD) it is recommended that you have this path in current working
folder.
References:
Comments
Post a Comment