Permalink
Browse files

Scripts for running tests and generating NuGet packages (#1732)

* Scripts for running tests and generating NuGet packages

* Creates a test script to run C smoke tests, C++ unit tests and C# UTs
* Creates a package script to generate NuGet packages
* Updates the nuspec files to properly support injecting paths into them

Note: The test script is currently designed to be used by humans, and it
  may fail to error out a CI/CD process that simply executes the script.

* Empty commit to trigger CI
  • Loading branch information...
lokitoth authored and JohnLangford committed Jan 30, 2019
1 parent 9b94b63 commit 6f7fad42f59120f699f6f46d5c26c5595e0e3ad3
Showing with 78 additions and 27 deletions.
  1. +28 −0 .scripts/package.cmd
  2. +23 −0 .scripts/test.cmd
  3. +17 −17 cs/cs/cs.nuspec
  4. +5 −5 cs/cs_json/cs_json.nuspec
  5. +5 −5 cs/cs_parallel/cs_parallel.nuspec
@@ -0,0 +1,28 @@
@ECHO OFF
IF DEFINED DebugBuildScripts (
@ECHO ON
)

SETLOCAL

CALL %~dp0init.cmd

REM TODO: these should be read from the version props file, or similar
SET Version=8.6.1
SET Tag=-INTERNALONLY

SET RootRelativeOutputDirX64=%vwRoot%\vowpalwabbit\out\target\
SET RootRelativeOutputDirAnyCPU=%vwRoot%\vowpalwabbit\out\target\
SET SolutionDir=%vwRoot%\vowpalwabbit\

REM Do not add a training backslash here, as it will break the nuget xml parser for some reason
SET RepoRoot=%vwRoot%

REM TODO-pre-checkin: Figure out how to parametrize this script?! (is there a standard, or do we actually need parse args?)
nuget pack %SolutionDir%..\cs\cs\cs.nuspec -OutputDirectory "out\target\x64\Release" -Verbosity detailed -BasePath "." -Properties "RootRelativeOutputDirX64=%RootRelativeOutputDirX64%;RootRelativeOutputDirAnyCPU=%RootRelativeOutputDirAnyCPU%;Configuration=Release;Platform=X64;version=%Version%;Tag=%Tag%;RepoRoot=%RepoRoot%;SolutionDir=%SolutionDir%"
nuget pack %SolutionDir%..\cs\cs_json\cs_json.nuspec -OutputDirectory "out\target\x64\Release" -Verbosity detailed -BasePath "." -Properties "RootRelativeOutputDirX64=%RootRelativeOutputDirX64%;RootRelativeOutputDirAnyCPU=%RootRelativeOutputDirAnyCPU%;Configuration=Release;Platform=X64;version=%Version%;Tag=%Tag%;RepoRoot=%RepoRoot%;SolutionDir=%SolutionDir%"
nuget pack %SolutionDir%..\cs\cs_parallel\cs_parallel.nuspec -OutputDirectory "out\target\x64\Release" -Verbosity detailed -BasePath "." -Properties "RootRelativeOutputDirX64=%RootRelativeOutputDirX64%;RootRelativeOutputDirAnyCPU=%RootRelativeOutputDirAnyCPU%;Configuration=Release;Platform=X64;version=%Version%;Tag=%Tag%;RepoRoot=%RepoRoot%;SolutionDir=%SolutionDir%"

REM TODO: Need to also include the .pdb files, once we fix all the GitLink warnings

ENDLOCAL
@@ -0,0 +1,23 @@
@ECHO OFF
IF DEFINED DebugBuildScripts (
@ECHO ON
)

SETLOCAL

CALL %~dp0init.cmd

REM TODO: Determine how to pass test failure out of this script so it can be used by CI/CD setups

ECHO Running VW C Smoke test
"%vwRoot%\vowpalwabbit\out\target\Release\x64\c_test.exe"

ECHO Running VW Unit Tests in C++
"%vwRoot%\vowpalwabbit\out\target\Release\x64\vw_unit_test.exe"

ECHO Running VW Unit Tests in C#
%vstestPath% /Platform:x64 /inIsolation "%vwRoot%\vowpalwabbit\x64\Release\cs_unittest.dll" /TestCaseFilter:"TestCategory!=NotOnVSO"
REM this is the same as above, just xcopied to the out folder. This is broken due to baked-in paths. The fix is to place the output straight into out.
REM %vstestPath% /Platform:x64 /inIsolation "%vwRoot%\vowpalwabbit\x64\Release\cs_unittest.dll" /TestCaseFilter:"TestCategory!=NotOnVSO"

ENDLOCAL
@@ -5,7 +5,7 @@
<id>VowpalWabbit</id>
<tags>vw vowpal wabbit langford ml machine learning</tags>
<authors>John Langford et al</authors>
<version>$version$</version>
<version>$version$$Tag$</version>
<projectUrl>https://github.com/JohnLangford/vowpal_wabbit/wiki/C%23-Binding</projectUrl>
<licenseUrl>https://github.com/JohnLangford/vowpal_wabbit/blob/master/LICENSE</licenseUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
@@ -14,26 +14,26 @@
</metadata>
<files>
<!-- despite warning this is still required -->
<file src="$SolutionDir$x64\$Configuration$\VowpalWabbit.dll" target="lib\net45" />
<file src="$SolutionDir$x64\$Configuration$\VowpalWabbit.pdb" target="lib\net45" />
<file src="$SolutionDir$x64\$Configuration$\VowpalWabbit.xml" target="lib\net45" />
<file src="$RootRelativeOutputDirX64$$Configuration$\VowpalWabbit.dll" target="lib\net45" />
<file src="$RootRelativeOutputDirX64$$Configuration$\VowpalWabbit.pdb" target="lib\net45" />
<file src="$RootRelativeOutputDirX64$$Configuration$\VowpalWabbit.xml" target="lib\net45" />

<file src="$SolutionDir$x64\$Configuration$\VowpalWabbit.Common.dll" target="lib\net45" />
<file src="$SolutionDir$x64\$Configuration$\VowpalWabbit.Common.pdb" target="lib\net45" />
<file src="$SolutionDir$x64\$Configuration$\VowpalWabbit.Common.xml" target="lib\net45" />
<file src="$RootRelativeOutputDirX64$$Configuration$\VowpalWabbit.Common.dll" target="lib\net45" />
<file src="$RootRelativeOutputDirX64$$Configuration$\VowpalWabbit.Common.pdb" target="lib\net45" />
<file src="$RootRelativeOutputDirX64$$Configuration$\VowpalWabbit.Common.xml" target="lib\net45" />

<file src="$SolutionDir$x64\$Configuration$\VowpalWabbit.Core.dll" target="lib\net45" />
<file src="$SolutionDir$x64\$Configuration$\VowpalWabbit.Core.pdb" target="lib\net45" />
<file src="$SolutionDir$x64\$Configuration$\VowpalWabbit.Core.xml" target="lib\net45" />
<file src="$RootRelativeOutputDirX64$$Configuration$\VowpalWabbit.Core.dll" target="lib\net45" />
<file src="$RootRelativeOutputDirX64$$Configuration$\VowpalWabbit.Core.pdb" target="lib\net45" />
<file src="$RootRelativeOutputDirX64$$Configuration$\VowpalWabbit.Core.xml" target="lib\net45" />

<file src="**\*.cs" target="src\cs" exclude="**\obj\**\*.cs" />
<file src="..\common\**\*.cs" target="src\common" exclude="**\obj\**\*.cs" />
<file src="..\cli\*.cpp" target="src\cli" />
<file src="..\cli\*.h" target="src\cli" />
<file src="$SolutionDir$*.cc" target="src\vowpalwabbit" />
<file src="$SolutionDir$*.h" target="src\vowpalwabbit" />
<file src="$RepoRoot$\cs\cs\**\*.cs" target="src\cs" exclude="**\obj\**\*.cs" />
<file src="$RepoRoot$\cs\common\**\*.cs" target="src\common" exclude="**\obj\**\*.cs" />
<file src="$RepoRoot$\cs\cli\*.cpp" target="src\cli" />
<file src="$RepoRoot$\cs\cli\*.h" target="src\cli" />
<file src="$RepoRoot$\vowpalwabbit\*.cc" target="src\vowpalwabbit" />
<file src="$RepoRoot$\vowpalwabbit\*.h" target="src\vowpalwabbit" />

<file src="web.config.transform" target="content"/>
<file src="$RepoRoot$\cs\cs\web.config.transform" target="content"/>
</files>
</package>

@@ -5,24 +5,24 @@
<id>VowpalWabbit.JSON</id>
<tags>vw vowpal wabbit langford ml machine learning</tags>
<authors>John Langford et al</authors>
<version>$version$</version>
<version>$version$$Tag$</version>
<projectUrl>https://github.com/JohnLangford/vowpal_wabbit/wiki/C%23-Binding</projectUrl>
<licenseUrl>https://github.com/JohnLangford/vowpal_wabbit/blob/master/LICENSE</licenseUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Official Vowpal Wabbit library including C# interface</description>
<copyright>Copyright (C) Microsoft Corp 2012-2016, Yahoo! Inc. 2007-2012, and many individual contributors. All rights reserved.</copyright>
<dependencies>
<group>
<dependency id="VowpalWabbit" version="$version$" />
<dependency id="VowpalWabbit" version="$version$$Tag$" />
<dependency id="Newtonsoft.Json" version="8.0.2" />
</group>
</dependencies>
</metadata>
<files>
<!-- despite warning this is still required -->
<file src="$SolutionDir$x64\$Configuration$\VowpalWabbit.JSON.dll" target="lib\net45" />
<file src="$SolutionDir$x64\$Configuration$\VowpalWabbit.JSON.pdb" target="lib\net45" />
<file src="$SolutionDir$x64\$Configuration$\VowpalWabbit.JSON.xml" target="lib\net45" />
<file src="$RootRelativeOutputDirX64$$Configuration$\VowpalWabbit.JSON.dll" target="lib\net45" />
<file src="$RootRelativeOutputDirX64$$Configuration$\VowpalWabbit.JSON.pdb" target="lib\net45" />
<file src="$RootRelativeOutputDirX64$$Configuration$\VowpalWabbit.JSON.xml" target="lib\net45" />
</files>
</package>

@@ -5,24 +5,24 @@
<id>VowpalWabbit.Parallel</id>
<tags>vw vowpal wabbit langford ml machine learning</tags>
<authors>John Langford et al</authors>
<version>$version$</version>
<version>$version$$Tag$</version>
<projectUrl>https://github.com/JohnLangford/vowpal_wabbit/wiki/C%23-Binding</projectUrl>
<licenseUrl>https://github.com/JohnLangford/vowpal_wabbit/blob/master/LICENSE</licenseUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Official Vowpal Wabbit library including C# interface</description>
<copyright>Copyright (C) Microsoft Corp 2012-2016, Yahoo! Inc. 2007-2012, and many individual contributors. All rights reserved.</copyright>
<dependencies>
<group>
<dependency id="VowpalWabbit" version="$version$" />
<dependency id="VowpalWabbit" version="$version$$Tag$" />
<dependency id="Microsoft.Tpl.Dataflow" version="4.5.24" />
</group>
</dependencies>
</metadata>
<files>
<!-- despite warning this is still required -->
<file src="$SolutionDir$x64\$Configuration$\VowpalWabbit.Parallel.dll" target="lib\net45" />
<file src="$SolutionDir$x64\$Configuration$\VowpalWabbit.Parallel.pdb" target="lib\net45" />
<file src="$SolutionDir$x64\$Configuration$\VowpalWabbit.Parallel.xml" target="lib\net45" />
<file src="$RootRelativeOutputDirX64$$Configuration$\VowpalWabbit.Parallel.dll" target="lib\net45" />
<file src="$RootRelativeOutputDirX64$$Configuration$\VowpalWabbit.Parallel.pdb" target="lib\net45" />
<file src="$RootRelativeOutputDirX64$$Configuration$\VowpalWabbit.Parallel.xml" target="lib\net45" />
</files>
</package>

0 comments on commit 6f7fad4

Please sign in to comment.