onnxruntime/csharp/test/Microsoft.ML.OnnxRuntime.EndToEndTests/runtest.sh
shahasad f94fdad861
Fixes on the dotnet end-to-end test scripts to get it running on linux (#376)
* fixed typo in runtest.sh

* some fixes

* some fixes

* some fixes in the runtest.sh

* added test data url

* fixes on the dotnet test scripts

* fix on prior mistake regarding installation of apt-transport-https

* added verbosity in the test run for easy debugging

* updated comment in the runtest.sh
2019-01-24 13:14:29 -08:00

43 lines
No EOL
1.4 KiB
Bash
Executable file

#!/bin/bash
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
LocalNuGetRepo=$1
SourceRoot=$2
BuildDir=$3
TestDataUrl=$4
TestDataChecksum=$5
#TestDataUrl and TestDataChecksum comes from the build env variable
echo "Downloading test data"
python3 $SourceRoot/tools/ci_build/build.py --update --download_test_data --build_dir $BuildDir --test_data_url $TestDataUrl --test_data_checksum $TestDataChecksum
if [ $? -ne 0 ]; then
echo "Failed to download test data"
exit 1
fi
OldDir=`pwd`
cd $SourceRoot
MajorVersion=$(cat $SourceRoot/VERSION_NUMBER)
VersionSuffix=
if [ "$IsReleaseBuild" != "true" ]; then
VersionSuffix=-dev-$(git rev-parse --short=8 HEAD)
fi
export CurrentOnnxRuntimeVersion=$MajorVersion$VersionSuffix
echo "Current NuGet package version is $CurrentOnnxRuntimeVersion"
dotnet restore $SourceRoot/csharp/test/Microsoft.ML.OnnxRuntime.EndToEndTests/Microsoft.ML.OnnxRuntime.EndToEndTests.csproj -s $LocalNuGetRepo -s https://api.nuget.org/v3/index.json
if [ $? -ne 0 ]; then
echo "Failed to restore nuget packages for the test project"
exit 1
fi
dotnet test $SourceRoot/csharp/test/Microsoft.ML.OnnxRuntime.EndToEndTests/Microsoft.ML.OnnxRuntime.EndToEndTests.csproj --no-restore --verbosity detailed
if [ $? -ne 0 ]; then
echo "Failed to build or execute the end-to-end test"
exit 1
fi
cd $OldDir