normalize parameters (less envirnoment variables)

This commit is contained in:
Sergey Shandar 2017-06-30 12:53:55 -07:00
Родитель 656e11acc3
Коммит 6165b55a6d
10 изменённых файлов: 36 добавлений и 410 удалений

Просмотреть файл

@ -45,8 +45,8 @@ environment:
- TEST_PROJECT: arm-trafficmanager
- TEST_PROJECT: arm-web
install:
- ps: .\install.ps1 -TEST_LANG $env:TEST_LANG
- ps: .\install.ps1 -lang $env:TEST_LANG
build_script:
- ps: .\build.ps1 -TEST_LANG $env:TEST_LANG
- ps: .\build.ps1 -project $env:TEST_PROJECT -lang $env:TEST_LANG
test_script:
- ps: .\Test.ps1 -TEST_LANG $env:TEST_LANG
- ps: .\Test.ps1 -project $env:TEST_PROJECT -lang $env:TEST_LANG

Просмотреть файл

@ -1,4 +1,4 @@
param([string]$TEST_PROJECT, [string]$TEST_LANG)
param([string] $project = "*", [string]$lang)
Import-Module ".\lib.psm1"
Import-Module ".\_\tools\autogenForSwaggers\lib.psm1"
@ -7,28 +7,13 @@ $current = (Get-Location)
"Building..."
if ($TEST_PROJECT)
{
$env:TEST_PROJECT = $TEST_PROJECT
}
.\common.ps1
if (-Not $?)
{
exit $LASTEXITCODE
}
.\lang.ps1 -script "build" -lang $TEST_LANG
.\lang.ps1 -script "build" -lang $lang
$specs = Join-Path $current "azure-rest-api-specs"
GenerateAndBuild -project $env:TEST_PROJECT -specs $specs -sdkDir "_"
# Reading SDK Info
# $infoList = Read-SdkInfoList -project $env:TEST_PROJECT
# $infoList | ForEach-Object { Generate-Sdk -info $_ }
# $testProjectList = Get-DotNetTestList $infoList
# $testProjectList | ForEach-Object { Build-Project -project $_ }
GenerateAndBuild -project $project -specs $specs -sdkDir "_"

Просмотреть файл

@ -1,8 +1,6 @@
Import-Module ".\lib.psm1"
$env:TEST_COMMON = Join-Path (pwd) "x"
$env:TEST_PROJECT = $env:TEST_PROJECT.Replace('_', '/')
$env:TEST_COMMON = Join-Path (Get-Location) "x"
$env:TEST_NODE_VER = "v7.10.0"
@ -12,9 +10,3 @@ $env:Path = $env:TEST_NODE_FOLDER + ";" + $env:Path
$env:TEST_DOTNET_FOLDER = Join-Path $env:TEST_COMMON "dn"
$env:Path = $env:TEST_DOTNET_FOLDER + ";" + $env:Path
# Project
# A VSTS Build name can't contain '/' so the TEST_PROJECT parameter uses '_'
# instead.
$env:TEST_PROJECT = $env:TEST_PROJECT.Replace('_', '/')

Просмотреть файл

@ -1,49 +1,24 @@
param([string] $TEST_PROJECT, [string]$TEST_FORK, [string] $TEST_BRANCH)
param([string] $fork = "Azure", [string] $branch = "master")
if ($TEST_PROJECT)
{
$env:TEST_PROJECT = $TEST_PROJECT
}
Import-Module ".\lib.psm1"
"Cloning azure-rest-api-specs..."
.\lib\remove.ps1 -path azure-rest-api-specs
Remove-All -path azure-rest-api-specs
if ($TEST_FORK)
{
$env:TEST_FORK = $TEST_FORK
}
if (!$env:TEST_FORK)
{
$env:TEST_FORK = "Azure"
}
if ($TEST_BRANCH)
{
$env:TEST_BRANCH = $TEST_BRANCH
}
if (!$env:TEST_BRANCH)
{
$env:TEST_BRANCH = "master"
}
$testRep = "https://github.com/$env:TEST_FORK/azure-rest-api-specs"
$testRep = "https://github.com/$fork/azure-rest-api-specs"
"Azure REST API Specs repository: $testRep"
"Azure REST API Specs branch: $env:TEST_BRANCH"
git clone -q --branch=$env:TEST_BRANCH $testRep azure-rest-api-specs
"Azure REST API Specs branch: $branch"
git clone -q --branch=$branch $testRep azure-rest-api-specs
"Cloning azure-sdk-for-net..."
if(-Not $env:TEST_DOTNETSDK_FORK)
{
# $env:TEST_DOTNETSDK_FORK = "Azure"
$env:TEST_DOTNETSDK_FORK = "sergey-shandar"
}
if(-Not $env:TEST_DOTNETSDK_BRANCH)
{
# $env:TEST_DOTNETSDK_BRANCH = "psSdkJson6"
$env:TEST_DOTNETSDK_BRANCH = "gen"
}
.\lib\remove.ps1 -path _
$sdkRep = "https://github.com/$env:TEST_DOTNETSDK_FORK/azure-sdk-for-net"
# $sdkFork = "Azure"
$sdkFork = "sergey-shandar"
# $sdkBranch = "psSdkJson6"
$sdkBranch = "gen"
Remove-All -path _
$sdkRep = "https://github.com/$sdkFork/azure-sdk-for-net"
"Azure SDK for .Net repository: $sdkRep"
"Azure SDK for .Net branch: $env:TEST_DOTNETSDK_BRANCH"
git clone -q --branch=$env:TEST_DOTNETSDK_BRANCH $sdkRep _
"Azure SDK for .Net branch: $sdkBranch"
git clone -q --branch=$sdkBranch $sdkRep _

Просмотреть файл

@ -1,4 +1,4 @@
param ([string] $TEST_LANG)
param ([string] $lang)
Import-Module ".\lib.psm1"
@ -30,8 +30,7 @@ $LASTEXITCODE = 0
# .\lib\download-and-unzip.ps1 -url $dnUrl -zip "dotnet.zip" -dest $dnOutput
"Language = $lang"
"Project = $env:TEST_PROJECT"
.\lang.ps1 -script "install" -lang $TEST_LANG
.\lang.ps1 -script "install" -lang $lang
.\init.ps1

Просмотреть файл

@ -1,22 +1,24 @@
$oldCurrent = pwd
param([string] $project, [string] $lang)
$oldCurrent = Get-Location
subst t: /D
subst t: $oldCurrent
cd t:\
Set-Location t:\
.\install.ps1
.\build.ps1
.\install.ps1 -lang $lang
.\build.ps1 -project $project -lang $lang
if (-Not $?)
{
Write-Error "build errors"
exit $LASTEXITCODE
}
.\test.ps1
.\test.ps1 -project $project -lang $lang
if (-Not $?)
{
Write-Error "test errors"
exit $LASTEXITCODE
}
cd $oldCurrent
Set-Location $oldCurrent
subst t: /D

117
lib.psm1
Просмотреть файл

@ -19,123 +19,6 @@ function Clear-Dir {
New-Dir -path $path
}
# function Set-Default {
# param([psobject] $object, [string] $member, $value)
# if (-Not ($object | Get-Member -Name $member))
# {
# $object | Add-Member -type NoteProperty -name $member -value $value
# }
# }
# function Update-SdkInfo {
# param([psobject] $info)
# # isArm
# Set-Default -object $info -member isArm -value $info.name.StartsWith("arm-")
# # isComposite
# $isComposite = $info.sources | ? {$_.StartsWith("composite") }
# Set-Default -object $info -member isComposite -value $isComposite
# # dotNet
# $dotNet = New-Object -TypeName PSObject
# Set-Default -object $info -member dotNet -value $dotNet
# $dotNet = $info.dotNet
# # dotNet.ft
# Set-Default -object $dotNet -member ft -value 0
# # dotNet.name
# $dotNetName = $info.name.Split("/")[0]
# $dotNetName = If ($info.isArm) { $dotNetName.SubString(4) } Else { $dotNetName }
# $dotNetNameArray = $dotNetName.Split("-") | % {$_.SubString(0, 1).ToUpper() + $_.SubString(1)}
# Set-Default -object $dotNet -member name -value ([string]::Join(".", $dotNetNameArray))
# # dotNet.folder
# Set-Default -object $dotNet -member folder -value $dotNet.name
# # dotNet.output
# $prefix = If ($info.isArm) { "Management." } Else { "dataPlane\Microsoft.Azure." }
# Set-Default -object $dotNet -member output -value "$prefix$($dotNet.name)\Generated"
# # dotNet.test
# $test = "$($dotNet.name).Tests"
# Set-Default -object $dotNet -member test -value "$test\$test.csproj"
# # dotNet.namespace
# $prefix = If ($info.isArm) { "Management." } Else { "" }
# Set-Default -object $dotNet -member namespace -value "Microsoft.Azure.$prefix$($dotNet.name)"
# }
# function Read-SdkInfoList {
# param([string] $project)
# $array = Get-Content 'sdkinfo.json' | Out-String | ConvertFrom-Json
# Write-Host "project: $project"
# $array = $array | ? { $_.name -like $project }
# Write-Host "array: $array"
# if (-Not $array)
# {
# Write-Error "unknown project $project"
# exit -1
# }
# $array | % { Update-SdkInfo $_ }
# return $array
# }
# function Read-SdkInfo {
# $array = Get-Content 'sdkinfo.json' | Out-String | ConvertFrom-Json
# $array = $array | ? {$_.name -eq $env:TEST_PROJECT}
# if (-Not $array)
# {
# Write-Error "unknown project $env:TEST_PROJECT"
# exit -1
# }
# $info = $array[0]
# Update-SdkInfo -info $info
# return $info
# }
# function Get-SourcePath {
# param([psobject]$info, [string]$source)
# $current = pwd
# $specs = Join-Path $current "azure-rest-api-specs"
# $specs = Join-Path $specs $info.name
# return Join-Path $specs $source
# }
# function Get-DotNetPath {
# param([psobject]$dotNet, [string]$folder)
# $current = pwd
# return Join-Path $current "_\src\SDKs\$($dotNet.folder)\$folder"
# }
# function Get-DotNetTest {
# param([psobject]$dotNet)
# return Get-DotNetPath -dotNet $dotNet -folder $dotNet.test
# }
# function Get-DotNetTestList {
# param([psobject] $infoList)
# return $infoList | % { Get-DotNetTest $_.dotNet } | Get-Unique
# }
function Get-LangInfo {
param([psobject] $lang)

191
list.md
Просмотреть файл

@ -1,191 +0,0 @@
# A List of Services
## Build Passed
- **arm-insights**
- [Live Test](https://devdiv.visualstudio.com/NodeRepos/_build/index?buildId=800424&_a=summary&tab=ms.vss-test-web.test-result-details)
- [Go](https://devdiv.visualstudio.com/NodeRepos/_build/index?buildId=803551&_a=summary&tab=console), not implemented
- **arm-monitor**
- [Live Test](https://devdiv.visualstudio.com/NodeRepos/_build/index?buildId=800721&_a=summary)
- [Go](https://devdiv.visualstudio.com/NodeRepos/_build/index?buildId=806546&_a=summary&tab=ms.vss-test-web.test-result-details), not implemented
### Build Passed But Live Test Failed
- **arm-analysisservices**
- [Live Test](https://devdiv.visualstudio.com/NodeRepos/_build/index?buildId=799962&_a=summary&tab=ms.vss-test-web.test-result-details), SDK breaking changes are recently introduced.
- 12 in-memory passed
- 2 failed
- [Go](https://devdiv.visualstudio.com/NodeRepos/_build/index?buildId=806884&_a=summary&tab=ms.vss-test-web.test-result-details)
- 12 in-memory failed
- 2 failed
- **arm-authorization**
- [Live Test](https://devdiv.visualstudio.com/NodeRepos/_build/index?buildId=799982&_a=summary&tab=ms.vss-test-web.test-result-details)
- 12 failed
- 2 skipped
- 3 passed
- [Go](https://devdiv.visualstudio.com/NodeRepos/_build/index?buildId=806922&_a=summary&tab=ms.vss-test-web.test-result-details)
- 12 failed
- 2 skipped
- 3 passed
- **arm-automation**
- [Live Test](https://devdiv.visualstudio.com/NodeRepos/_build/index?buildId=800000&_a=summary&tab=ms.vss-test-web.test-result-details).
- 5 failed
- [Go](https://devdiv.visualstudio.com/NodeRepos/_build/index?buildId=806953&_a=summary&tab=ms.vss-test-web.test-result-details)
- 5 failed
- **arm-billing**
- [Live Test](https://devdiv.visualstudio.com/NodeRepos/_build/index?buildId=800014&_a=summary&tab=ms.vss-test-web.test-result-details).
- 9 failed
- 1 passed
- [Go](https://devdiv.visualstudio.com/NodeRepos/_build/index?buildId=807375&_a=summary&tab=ms.vss-test-web.test-result-details)
- 9 failed
- 1 passed
- **arm-cognitiveservices**
- [Live Test](https://devdiv.visualstudio.com/NodeRepos/_build/index?buildId=800033&_a=summary&tab=ms.vss-test-web.test-result-details).
- 14 failed
- 5 passed
- [Go](https://devdiv.visualstudio.com/NodeRepos/_build/index?buildId=807985&_a=summary)
- 19 failed
- **arm-consumption**
- [Live Test](https://devdiv.visualstudio.com/NodeRepos/_build/index?buildId=800138&_a=summary&tab=ms.vss-test-web.test-result-details).
- 10 failed
- 1 passed
- [Go](https://devdiv.visualstudio.com/NodeRepos/_build/index?buildId=808061&_a=summary&tab=ms.vss-test-web.test-result-details), not implemented
- 11 failed
- **arm-customer-insights**
- [Live Test](https://devdiv.visualstudio.com/NodeRepos/_build/index?buildId=800160&_a=summary&tab=ms.vss-test-web.test-result-details)
- 27 failed
- [Go](https://devdiv.visualstudio.com/NodeRepos/_build/index?buildId=808151&_a=summary&tab=ms.vss-test-web.test-result-details)
- 27 failed, not implemented
- **arm-datalake-analytics**
- [Live Test](https://devdiv.visualstudio.com/NodeRepos/_build/index?buildId=808751&_a=summary)
- 4 failed
- 3 passed
- [Go](https://devdiv.visualstudio.com/NodeRepos/_build/index?buildId=808848&_a=summary&tab=ms.vss-test-web.test-result-details), not implemented
- **arm-datalake-store**
- [Live Test](https://devdiv.visualstudio.com/NodeRepos/_build/index?buildId=809774&_a=summary&tab=ms.vss-test-web.test-result-details)
- 62 passed
- 1 failed
- 1 skipped
- [Go](https://devdiv.visualstudio.com/NodeRepos/_build/index?buildId=809900&_a=summary&tab=ms.vss-test-web.test-result-details), not implemented
- 32 passed
- 31 failed
- 1 skipped
- **arm-devtestlabs**
- [Live Test](https://devdiv.visualstudio.com/NodeRepos/_build/index?buildId=800377&_a=summary&tab=ms.vss-test-web.test-result-details)
- 1 failed
- [Go](https://devdiv.visualstudio.com/NodeRepos/_build/index?buildId=810023&_a=summary&tab=ms.vss-test-web.test-result-details)
- 1 failed
- **arm-eventhub**
- [Live Test](https://devdiv.visualstudio.com/NodeRepos/_build/index?buildId=800392&_a=summary&tab=ms.vss-test-web.test-result-details)
- 5 failed
- [Go](https://devdiv.visualstudio.com/NodeRepos/_build/index?buildId=810225&_a=summary&tab=ms.vss-test-web.test-result-details)
- 5 failed
- **arm-graphrbac**
- [Live Test](https://devdiv.visualstudio.com/NodeRepos/_build/index?buildId=800410&_a=summary&tab=ms.vss-test-web.test-result-details)
- 18 failed
- 2 skipped
- [Go](https://devdiv.visualstudio.com/NodeRepos/_build/index?buildId=814221&_a=summary&tab=ms.vss-test-web.test-result-details)
- 18 failed
- 2 skipped
- **arm-iothub**
- [Live Test](https://devdiv.visualstudio.com/NodeRepos/_build/index?buildId=800579&_a=summary&tab=ms.vss-test-web.test-result-details)
- 2 failed
- [Go](https://devdiv.visualstudio.com/NodeRepos/_build/index?buildId=816538&_a=summary&tab=ms.vss-test-web.test-result-details)
- 2 failed
- **arm-keyvault**
- [Live Test](https://devdiv.visualstudio.com/NodeRepos/_build/index?buildId=800583&_a=summary&tab=ms.vss-test-web.test-result-details)
- 5 failed
- [Go](https://devdiv.visualstudio.com/NodeRepos/_build/index?buildId=816597&_a=summary&tab=ms.vss-test-web.test-result-details)
- 5 failed
- **arm-logic**
- [Live Test](https://devdiv.visualstudio.com/NodeRepos/_build/index?buildId=800620&_a=summary&tab=ms.vss-test-web.test-result-details)
- 146 passed
- 20 failed
- 48 skipped
- [Go](https://devdiv.visualstudio.com/NodeRepos/_build/index?buildId=816678&_a=summary&tab=ms.vss-test-web.test-result-details)
- 2 passed
- 164 failed
- 48 skipped
- **arm-machinelearning**
- [Live Test](https://devdiv.visualstudio.com/NodeRepos/_build/index?buildId=800629&_a=summary&tab=ms.vss-test-web.test-result-details), SDK breaking changes are recently introduced.
- 3 passed
- 5 failed
- [Go](https://devdiv.visualstudio.com/NodeRepos/_build/index?buildId=816767&_a=summary&tab=ms.vss-test-web.test-result-details)
- **arm-network**
- [Live Test (8.2 h!)](https://devdiv.visualstudio.com/NodeRepos/_build/index?buildId=800727&_a=summary)
- 39 passed
- 15 failed
- 6 skipped
- **arm-notificationhubs**
- [Live Test](https://devdiv.visualstudio.com/NodeRepos/_build/index?buildId=801454&_a=summary)
- 6 failed
- **arm-powerbiembedded**
- [Live Tests](https://devdiv.visualstudio.com/NodeRepos/_build/index?buildId=801466&_a=summary)
- 9 failed
- **arm-recoveryservices**
- [Live Test](https://devdiv.visualstudio.com/NodeRepos/_build/index?buildId=801492&_a=summary)
- 4 failed
- **arm-recoveryservicesbackup**
- [Live Test](https://devdiv.visualstudio.com/NodeRepos/_build/index?buildId=801496&_a=summary)
- 3 failed
- **arm-relay**
- [Live Test](https://devdiv.visualstudio.com/NodeRepos/_build/index?buildId=801664&_a=summary)
- 1 passed
- 7 failed
- **arm-resources**
- [Live Test](https://devdiv.visualstudio.com/NodeRepos/_build/index?buildId=801895&_a=summary)
- 103 passed (including in-memory)
- 11 failed
- 10 skipped
- **arm-scheduler**
- [Live Test](https://devdiv.visualstudio.com/NodeRepos/_build/index?buildId=801976&_a=summary)
- 23 in-memory passed
- 1 passed
- 1 in-memory failed
- 19 failed
- **arm-search**
- [Live Test](https://devdiv.visualstudio.com/NodeRepos/_build/index?buildId=802076&_a=summary)
- 28 passed
- 9 failed
- **arm-servermanagement**
- [Live Test](https://devdiv.visualstudio.com/NodeRepos/_build/index?buildId=802235&_a=summary)
- 5 failed
- **arm-servicebus**
- [Live Test](https://devdiv.visualstudio.com/NodeRepos/_build/index?buildId=802287&_a=summary)
- 1 passed
- 6 failed
- **arm-servicefabric**
- [Live Test](https://devdiv.visualstudio.com/NodeRepos/_build/index?buildId=802445&_a=summary)
- 4 passed
- 3 failed
### Build Passed But With Specific Version Of AutoRest
For these services, we can't use a JSON-RPC client without modifications in .Net tests.
- **arm-batch**
- **arm-compute**
- **arm-containerregistry**
- **arm-redis**
- **arm-storage**
## Build Errors
- **arm-trafficmanager**
- **arm-operationalinsights**
- a commit is a2afb19c0d17535c1d0c3ebf05258e25375fc5a3
- a specific version of AutoRest
- **arm-cdn**
- a commit id is unknown
- a specific AutoRest version
- **arm-mediaservices**
- a commit id is unknown
- a specific AutoRest version
- **arm-sql**
- a commit is b1c64e75e3e0e3e9c3546d4466c7ebd0d5948cfe
- AutoRest version is unknown
- **arm-web**
- a commit id is unknown
- a specific AutoRest version
- **arm-intune**
- a project file is broken

Просмотреть файл

@ -1,4 +0,0 @@
param([string]$TEST_PROJECT, [string] $TEST_LANG, [string]$TEST_CSM_ORGID_AUTHENTICATION)
.\build.ps1 -TEST_PROJECT $TEST_PROJECT -TEST_LANG $TEST_LANG
.\test.ps1 -TEST_PROJECT $TEST_PROJECT -TEST_LANG $TEST_LANG -TEST_CSM_ORGID_AUTHENTICATION $TEST_CSM_ORGID_AUTHENTICATION

Просмотреть файл

@ -1,15 +1,10 @@
param([string]$TEST_PROJECT, [string]$TEST_LANG, [string]$TEST_CSM_ORGID_AUTHENTICATION)
param([string] $project = "*", [string] $lang, [string] $TEST_CSM_ORGID_AUTHENTICATION)
Import-Module ".\_\tools\autogenForSwaggers\lib.psm1"
if ($TEST_PROJECT)
{
$env:TEST_PROJECT = $TEST_PROJECT
}
.\common.ps1
.\lang.ps1 -script "test" -lang $TEST_LANG
.\lang.ps1 -script "test" -lang $lang
"Testing SDK..."
@ -23,15 +18,5 @@ If ($env:TEST_CSM_ORGID_AUTHENTICATION)
$env:AZURE_TEST_MODE = "None"
}
"Mode: $env:AZURE_TEST_MODE"
$infoList = Read-SdkInfoList -project $env:TEST_PROJECT
$testProjectList = Get-DotNetTestList -infoList $infoList
$testProjectList | % {
"Testing $_"
dotnet test -l trx $_
if (-Not $?)
{
Write-Error "test errors"
exit $LASTEXITCODE
}
}
TestSdk -project $project -sdkDir "_"