forked from Azure/azure-sdk-for-net
-
Notifications
You must be signed in to change notification settings - Fork 0
/
testSdkOnLinux.sh
executable file
·140 lines (123 loc) · 5.69 KB
/
testSdkOnLinux.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
#!/bin/bash
set -e
base=`dirname {BASH_SOURCE[0]}`
rootdir="$( cd "$base" && pwd )"
netstd14="netstandard1.4"
netcore11='netcoreapp1.1'
ubuntu1404="ubuntu.14.04-x64"
nugetOrgSource="https://api.nuget.org/v3/index.json"
localNugetFeed="./tools/LocalNugetFeed"
skip_Rps() {
retVal=false
#printf "checking......$1\n"
if [[ ("$1" =~ "Authorization") || ( "$1" =~ "Gallery" ) || ("$1" =~ "Automation") || ( "$1" =~ "Intune" ) || ( "$1" =~ "DataLake.Store" )
|| ( "$1" =~ "Monitor" ) || ( "$1" =~ "RedisCache" ) || ( "$1" =~ "Search" ) || ( "$1" =~ "KeyVault.Tests" )
|| ( "$1" =~ "KeyVault.TestFramework") ]]; then
retVal=true
fi
echo $retVal
}
echo "Restore ClientRuntime for $ubuntu1404"
dotnet restore src/SdkCommon/ClientRuntime.sln -r $ubuntu1404
echo "Build ClientRuntime for $net14"
#dotnet restore src/SdkCommon/ClientRuntime/ClientRuntime/Microsoft.Rest.ClientRuntime.csproj
dotnet build src/SdkCommon/ClientRuntime/ClientRuntime/Microsoft.Rest.ClientRuntime.csproj -f $netstd14
dotnet build src/SdkCommon/ClientRuntime.Azure/ClientRuntime.Azure/Microsoft.Rest.ClientRuntime.Azure.csproj -f $netstd14
dotnet build src/SdkCommon/ClientRuntime.Azure.Authentication/Microsoft.Rest.ClientRuntime.Azure.Authentication.csproj -f $netstd14
#echo "Build ClientRuntime Tests for $netcore11"
#dotnet build src/SdkCommon/ClientRuntime/ClientRuntime.Tests/Microsoft.Rest.ClientRuntime.Tests.csproj -f $netcore11
#dotnet build src/SdkCommon/ClientRuntime/ClientRuntime.Tests/Microsoft.Rest.ClientRuntime.Tests.csproj -f $netcore11
#dotnet build src/SdkCommon/ClientRuntime.Azure/ClientRuntime.Azure.Tests/Microsoft.Rest.ClientRuntime.Azure.Tests.csproj -f $netcore11
echo "Running ClientRuntime Tests $netcore11"
#dotnet test src/SdkCommon/ClientRuntime/ClientRuntime.Tests/Microsoft.Rest.ClientRuntime.Tests.csproj -f $netcore11
dotnet test src/SdkCommon/ClientRuntime/ClientRuntime.Tests/Microsoft.Rest.ClientRuntime.Tests.csproj -f $netcore11
dotnet test src/SdkCommon/ClientRuntime.Azure/ClientRuntime.Azure.Tests/Microsoft.Rest.ClientRuntime.Azure.Tests.csproj -f $netcore11
KVMgmtDir=($sdkdir/KeyVault/Management/*.sln)
if [ -f $KVMgmtDir ]; then
dotnet restore $KVMgmtDir -r ubuntu1404
fi
sdkdir=$rootdir/src/SDKs
#printf "$sdkdir\n"
for folder in $sdkdir/*
do
item=`basename $folder`
if [ -d $sdkdir/$item ]; then
#printf "$sdkdir/$item\n"
if [ -f $sdkdir/$item/*.sln ]; then
slnFile=($sdkdir/$item/*.sln)
skipRestore=$( skip_Rps $slnFile )
if [ "$skipRestore" == false ]; then
printf "Restoring :::::: $slnFile for $ubuntu1404\n"
dotnet restore $slnFile -r $ubuntu1404
fi
if [ -d $sdkdir/$item/*.Tests ]; then
testProj=($sdkdir/$item/*.Tests/*.csproj)
skipTest=$( skip_Rps $testProj )
#printf "$skipRp\n"
if [ "$skipTest" == "false" ]; then
printf "Test ------ $testProj for framework $netcore11\n"
#dotnet build $testProj -f $netcore11
dotnet test $testProj -f $netcore11
fi
fi
fi
fi
done
kvDataPSln=($sdkdir/KeyVault/dataPlane/*.sln)
if [ -f $kvDataPSln ]; then
dotnet restore $kvDataPSln -r ubuntu1404
fi
KVDataPlaneDir=$sdkdir/KeyVault/dataPlane
for kvDir in $KVDataPlaneDir/*
do
kvItem=`basename $kvDir`
if [ -d $kvDir ] && [ "$kvItem" != "Microsoft.Azure.KeyVault.Samples" ]
then
if [[ "$kvItem" =~ "Tests" ]]; then
kvTestProj=($kvDir/*.csproj)
kvTProj=$( skip_Rps $kvSdkProj )
if [ "$kvTProj" == "false" ]; then
printf "KV TestProject ... $kvTestProj\n"
dotnet restore $kvTestProj -r $ubuntu1404
dotnet test $kvTestProj -f $netcore11
fi
else
if [ -f $kvDir/*.csproj ]; then
kvSdkProj=($kvDir/*.csproj)
kvProj=$( skip_Rps $kvSdkProj )
if [ "$kvProj" == "false" ]; then
dotnet restore $kvSdkProj -r $ubuntu1404
dotnet build $kvSdkProj -f $netstd14
fi
fi
fi
fi
done
: '
#echo "base: "$base
#echo "rootedir: "$rootdir
#echo "netstandard1.4 " $netstd14
#echo "netCore1.1 " $netcore11
#if [ -d $sdkdir/$item/Management.* ]
#then
# sdkProjFile=($sdkdir/$item/Management.*/*.csproj)
# printf "Build ------ $sdkProjFile for framework $netstd14\n"
# dotnet build $sdkProjFile -f $netstd14
#fi
else
if [ -d $sdkDir/$item/Management ]; then
printf "Found mgmt $sdkDir/$item/Management\n"
fi
if [ -f $sdkDir/$item/Management/*.sln ]; then
mgmtSln=($sdkDir/$item/Management/*.sln)
printf "Restoring ## $mgmtSln\n"
if [ -d $sdkdir/$item/*.Tests ]; then
mgmtTestProj=($sdkdir/$item/*.Tests/*.csproj)
printf "Test ## $mgmtTestProj for framework $netcore11\n"
fi #mgmtTestProject
fi #mgmgtSln
fi #mgmtSln else
#if [[ $("$testProj" =~ "Authorization") || $( "$testProj" =~ "Gallery" ) || $("$testProj" =~ "Automation") || $( "$testProj" =~ "InTune" ) || $( "$testProj" =~ "DataLake.Store" ) ]]; then
#if [[ ("$testProj" =~ "Authorization") || ( "$testProj" =~ "Gallery" ) || ("$testProj" =~ "Automation") || ( "$testProj" =~ "Intune" ) || ( "$testProj" =~ "DataLake.Store" )
#|| ( "$testProj" =~ "Monitor" ) || ( "$testProj" =~ "RedisCache" ) ]]; then
'