@@ -5,55 +5,39 @@ param (
5
5
6
6
[Parameter (Mandatory , Position = 1 )]
7
7
[ValidateNotNullOrEmpty ()]
8
- [string ] $BuildId ,
9
-
10
- [Parameter (Mandatory , Position = 2 )]
11
- [ValidateNotNullOrEmpty ()]
12
8
[guid ] $KustoServicePrincipalTenantId ,
13
9
14
- [Parameter (Mandatory , Position = 3 )]
10
+ [Parameter (Mandatory , Position = 2 )]
15
11
[ValidateNotNullOrEmpty ()]
16
12
[guid ] $KustoServicePrincipalId ,
17
13
18
- [Parameter (Mandatory , Position = 4 )]
14
+ [Parameter (Mandatory , Position = 3 )]
19
15
[ValidateNotNullOrEmpty ()]
20
16
[string ] $KustoServicePrincipalSecret ,
21
17
22
- [Parameter (Mandatory , Position = 5 )]
18
+ [Parameter (Mandatory , Position = 4 )]
23
19
[ValidateNotNullOrEmpty ()]
24
20
[string ] $ClusterName ,
25
21
26
- [Parameter (Mandatory , Position = 6 )]
27
- [ValidateNotNullOrEmpty ()]
28
- [string ] $ClusterRegion ,
29
-
30
- [Parameter (Mandatory , Position = 7 )]
31
- [ValidateNotNullOrEmpty ()]
32
- [string ] $DatabaseName ,
33
-
34
- [Parameter (Mandatory , Position = 8 )]
22
+ [Parameter (Mandatory , Position = 5 )]
35
23
[ValidateNotNullOrEmpty ()]
36
- [string ] $TableName ,
37
-
38
- [Parameter (Mandatory , Position = 9 )]
39
- [ValidateNotNull ()]
40
- [ValidateScript ({ Test-Path - LiteralPath $_ - PathType Container })]
41
- [string ] $DataLocation
24
+ [string ] $ClusterRegion
42
25
)
43
26
44
27
$script :AzPSCommonParameters = @ (" -Break" , " -Confirm" , " -Debug" , " -DefaultProfile" , " -ErrorAction" , " -ErrorVariable" , " -HttpPipelineAppend" , " -HttpPipelinePrepend" , " -InformationAction" , " -InformationVariable" ,
45
28
" -OutBuffer" , " -OutVariable" , " -PassThru" , " -PipelineVariable" , " -Proxy" , " -ProxyCredential" , " -ProxyUseDefaultCredentials" , " -Verbose" , " -WarningAction" , " -WarningVariable" , " -WhatIf" )
46
29
47
- $cvgDir = Join-Path - Path $DataLocation - ChildPath " TestCoverageAnalysis" | Join-Path - ChildPath " Raw"
30
+ $cvgDir = Join-Path - Path ${ env: TESTCOVERAGELOCATION} - ChildPath " TestCoverageAnalysis" | Join-Path - ChildPath " Raw"
48
31
if (Test-Path - LiteralPath $cvgDir - PathType Container) {
49
- Import-Module (Join-Path - Path ($PSScriptRoot | Split-Path ) - ChildPath " Utilities" | Join-Path - ChildPath " KustoUtility.psd1" ) - Force
32
+ $kustoUtil = Join-Path - Path ($PSScriptRoot | Split-Path ) - ChildPath " Utilities" | Join-Path - ChildPath " KustoUtility.psd1"
33
+ Import-Module $kustoUtil - ArgumentList $KustoServicePrincipalTenantId , $KustoServicePrincipalId , $KustoServicePrincipalSecret , $ClusterName , $ClusterRegion - Force
50
34
51
35
$cvgRawCsv = Get-ChildItem - Path $cvgDir - Filter " *.csv" - File | Select-Object - ExpandProperty FullName
52
36
$cvgRawCsv | ForEach-Object {
53
37
(Import-Csv - Path $_ ) |
54
38
Select-Object `
55
39
@ { Name = " Source" ; Expression = { $Source } }, `
56
- @ { Name = " BuildId" ; Expression = { $BuildId } }, `
40
+ @ { Name = " BuildId" ; Expression = { ${ env: BUILD_BUILDID} } }, `
57
41
@ { Name = " Module" ; Expression = { $_.Module } }, `
58
42
@ { Name = " CommandName" ; Expression = { $_.CommandName } }, `
59
43
@ { Name = " TotalCommands" ; Expression = { $_.TotalCommands } }, `
@@ -69,15 +53,7 @@ if (Test-Path -LiteralPath $cvgDir -PathType Container) {
69
53
Export-Csv - Path $_ - Encoding utf8 - NoTypeInformation - Force
70
54
}
71
55
72
- Import-KustoDataFromCsv `
73
- - ServicePrincipalTenantId $KustoServicePrincipalTenantId `
74
- - ServicePrincipalId $KustoServicePrincipalId `
75
- - ServicePrincipalSecret $KustoServicePrincipalSecret `
76
- - ClusterName $ClusterName `
77
- - ClusterRegion $ClusterRegion `
78
- - DatabaseName $DatabaseName `
79
- - TableName $TableName `
80
- - CsvFile $cvgRawCsv
56
+ Import-KustoDataFromCsv - DatabaseName ${env: TESTCOVERAGEDATABASENAME} - TableName ${env: TESTCOVERAGETABLENAME} - CsvFile $cvgRawCsv
81
57
}
82
58
else {
83
59
Write-Host " ##[warning]No test coverage data was found." - ForegroundColor Yellow
0 commit comments