Testing modules for usql applications and scripts

I have a custom USql application that extends a class IApplier.

[SqlUserDefinedApplier]
public class CsvApplier : IApplier
{
    public CsvApplier()
    {
        //totalcount = count;
    }
    public override IEnumerable<IRow> Apply(IRow input, IUpdatableRow output)
    {
        //....custom logic
        //yield return or yield break
    }
}

This application is then used from a usql script as

@log =
SELECT t.ultimateID,
t.siteID,
.
.
.
t.eTime,
t.hours
FROM @logWithCount
CROSS APPLY
new BSWBigData.USQLApplier.CsvApplier() AS t(ultimateID string, siteID string, .... , eTime string, hours double, count long?);

I was able to write unit tests / ATP for the divided parts of the application.

How can I write tests for C # method code Applyand user logic depending on I / O? How can I automate testing of usql scripts with specific inputs and outputs so that data accounting is not required?

+4
source share
3 answers

U-SQL Localrun SDK, , , ADLA Tool VS.

VS2015 , , "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Microsoft Azure Data Lake DRI Tools Visual Studio 2015\2.0.XXXX.0\LocalRunSDK. " C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Microsoft Azure Data Lake DRI Tools Visual Studio 2015\2.0.XXXX.0\CppSDK "

- :

C:\USQLLocalRunSDK

"LocalRunHelper.exe" u-sql . : -DataRoot " ", , ADLA Tool. -CppSDK " CppSDK" -1 ( ) 0 .

, .

+3

@Michael Rys, , U-SQL, Visual Studio.

, "U-SQL Local Run SDK", . U-SQL, # unit test, / CI.

SDK NuGet, , xiaoyzhu Microsoft dot com, , .

Xiaoyong Zhu Azure Data Lake

+3

ADL Tools VisualStudio , UDOs. , .

0

All Articles