Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<OutputType>Exe</OutputType>
<HasLiveTests>true</HasLiveTests>
<HasUnitTests>true</HasUnitTests>
<SelfContainedLiveTests>true</SelfContainedLiveTests>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\Azure.Mcp.Core.csproj" />
Expand Down
1 change: 1 addition & 0 deletions eng/pipelines/templates/jobs/analyze.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ jobs:
steps:
- checkout: self
fetchDepth: 0
fetchTags: false

- template: /eng/pipelines/templates/steps/install-dotnet.yml

Expand Down
2 changes: 2 additions & 0 deletions eng/pipelines/templates/jobs/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ jobs:
displayName: 'Download build info artifact'

- checkout: self
fetchDepth: 1
fetchTags: false

- template: /eng/pipelines/templates/steps/install-dotnet.yml

Expand Down
1 change: 1 addition & 0 deletions eng/pipelines/templates/jobs/initialize.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jobs:
steps:
- checkout: self
fetchDepth: 0
fetchTags: false

- template: /eng/pipelines/templates/steps/install-dotnet.yml

Expand Down
41 changes: 16 additions & 25 deletions eng/pipelines/templates/jobs/live-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ jobs:
matrix: $[ ${{ parameters.Matrix }} ]
steps:
- checkout: self
fetchDepth: 1
fetchTags: false

- template: /eng/pipelines/templates/steps/install-dotnet.yml

Expand All @@ -27,20 +29,6 @@ jobs:

- template: /eng/common/pipelines/templates/steps/create-authenticated-npmrc.yml

- pwsh: |
$serverName = $env:SERVERNAME

if ([string]::IsNullOrWhiteSpace($serverName)) {
./eng/scripts/Build-Local.ps1 -VerifyNpx
}
else {
./eng/scripts/Build-Local.ps1 -ServerName $serverName -VerifyNpx
}

exit $LastExitCode
displayName: "Build local package"
workingDirectory: $(Build.SourcesDirectory)

- pwsh: >
./eng/scripts/Test-Code.ps1
-TestType 'Live'
Expand Down Expand Up @@ -79,17 +67,20 @@ jobs:
pwsh: true
workingDirectory: $(Build.SourcesDirectory)

- template: /eng/common/TestResources/remove-test-resources.yml
parameters:
ServiceConnection: azure-sdk-tests-public

- template: /eng/common/TestResources/deploy-test-resources.yml
parameters:
ServiceConnection: azure-sdk-tests-public
PersistOidcToken: true
TestResourcesDirectory: $(Build.SourcesDirectory)/$(TestResourcesPath)
AdditionalParameters: "@{ UseHttpTransport = true }"
SkipEnvironmentSetup: true # environment setup was performed in the first deployment
# Only perform a second deployment of test resources if the live tests are not self-contained.
# Self-contained live tests do not require a fresh set of test resources to be deployed.
- ${{ if ne($(HasSelfContainedLiveTests), 'true') }}:
- template: /eng/common/TestResources/remove-test-resources.yml
parameters:
ServiceConnection: azure-sdk-tests-public

- template: /eng/common/TestResources/deploy-test-resources.yml
parameters:
ServiceConnection: azure-sdk-tests-public
PersistOidcToken: true
TestResourcesDirectory: $(Build.SourcesDirectory)/$(TestResourcesPath)
AdditionalParameters: "@{ UseHttpTransport = true }"
SkipEnvironmentSetup: true # environment setup was performed in the first deployment

- task: AzurePowershell@5
displayName: "Run tests (http) - az pwsh"
Expand Down
3 changes: 2 additions & 1 deletion eng/scripts/Get-ProjectProperties.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ $propertyList = @(
'AzureSupportedClouds',

'HasLiveTests',
'HasUnitTests'
'HasUnitTests',
'SelfContainedLiveTests'
)

$projectFile = $projectFiles | Select-Object -First 1
Expand Down
19 changes: 11 additions & 8 deletions eng/scripts/New-BuildInfo.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@ function Get-PathsToTest {
$hasUnitTests = $hasTestsProject -and [bool]::TryParse($testProjectDetails.HasUnitTests, [ref]$result) -and $result
$hasLiveTests = $hasTestsProject -and [bool]::TryParse($testProjectDetails.HasLiveTests, [ref]$result) -and $result
$hasRecordedTests = $hasLiveTests -and (Get-ChildItem $rootedTestResourcesPath -Filter 'assets.json' -Recurse).Count -gt 0
$hasSelfContainedLiveTests = $hasTestsProject -and [bool]::TryParse($testProjectDetails.SelfContainedLiveTests, [ref]$result) -and $result

$sourcePath = Join-Path $using:RepoRoot $path "src"

Expand All @@ -359,14 +360,15 @@ function Get-PathsToTest {
}

return @{
_error = $false
path = $path
hasTestResources = $hasTestResources
testResourcesPath = $hasTestResources ? $testResourcesPath : $null
hasLiveTests = $hasLiveTests
hasUnitTests = $hasUnitTests
hasRecordedTests = $hasRecordedTests
azureSupportedClouds = $resolvedClouds
_error = $false
path = $path
hasTestResources = $hasTestResources
testResourcesPath = $hasTestResources ? $testResourcesPath : $null
hasLiveTests = $hasLiveTests
hasUnitTests = $hasUnitTests
hasSelfContainedLiveTests = $hasSelfContainedLiveTests
hasRecordedTests = $hasRecordedTests
azureSupportedClouds = $resolvedClouds
}
}

Expand Down Expand Up @@ -401,6 +403,7 @@ function Get-TestMatrix {

$entry.testResourcesPath = $path.TestResourcesPath
$entry.hasTestResources = $path.HasTestResources
$entry.hasSelfContainedLiveTests = $path.hasSelfContainedLiveTests

if ($ServerName) {
$entry.serverName = $ServerName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<IsPackable>false</IsPackable>
<HasLiveTests>true</HasLiveTests>
<HasUnitTests>true</HasUnitTests>
<SelfContainedLiveTests>true</SelfContainedLiveTests>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<OutputType>Exe</OutputType>
<HasLiveTests>true</HasLiveTests>
<HasUnitTests>true</HasUnitTests>
<SelfContainedLiveTests>true</SelfContainedLiveTests>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="$(RepoRoot)servers\Azure.Mcp.Server\src\Azure.Mcp.Server.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<OutputType>Exe</OutputType>
<HasLiveTests>true</HasLiveTests>
<HasUnitTests>true</HasUnitTests>
<SelfContainedLiveTests>true</SelfContainedLiveTests>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="$(RepoRoot)servers\Azure.Mcp.Server\src\Azure.Mcp.Server.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<OutputType>Exe</OutputType>
<HasLiveTests>true</HasLiveTests>
<HasUnitTests>true</HasUnitTests>
<SelfContainedLiveTests>true</SelfContainedLiveTests>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="$(RepoRoot)servers\Azure.Mcp.Server\src\Azure.Mcp.Server.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<IsTestProject>true</IsTestProject>
<HasLiveTests>true</HasLiveTests>
<HasUnitTests>true</HasUnitTests>
<SelfContainedLiveTests>true</SelfContainedLiveTests>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="NSubstitute" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<OutputType>Exe</OutputType>
<HasLiveTests>true</HasLiveTests>
<HasUnitTests>true</HasUnitTests>
<SelfContainedLiveTests>true</SelfContainedLiveTests>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="$(RepoRoot)servers\Azure.Mcp.Server\src\Azure.Mcp.Server.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<OutputType>Exe</OutputType>
<HasLiveTests>true</HasLiveTests>
<HasUnitTests>true</HasUnitTests>
<SelfContainedLiveTests>true</SelfContainedLiveTests>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="$(RepoRoot)servers\Azure.Mcp.Server\src\Azure.Mcp.Server.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<OutputType>Exe</OutputType>
<HasLiveTests>true</HasLiveTests>
<HasUnitTests>true</HasUnitTests>
<SelfContainedLiveTests>true</SelfContainedLiveTests>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="$(RepoRoot)servers\Azure.Mcp.Server\src\Azure.Mcp.Server.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<OutputType>Exe</OutputType>
<HasLiveTests>true</HasLiveTests>
<HasUnitTests>true</HasUnitTests>
<SelfContainedLiveTests>true</SelfContainedLiveTests>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="$(RepoRoot)servers\Azure.Mcp.Server\src\Azure.Mcp.Server.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<OutputType>Exe</OutputType>
<HasLiveTests>true</HasLiveTests>
<HasUnitTests>true</HasUnitTests>
<SelfContainedLiveTests>true</SelfContainedLiveTests>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="$(RepoRoot)servers\Azure.Mcp.Server\src\Azure.Mcp.Server.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<OutputType>Exe</OutputType>
<HasLiveTests>true</HasLiveTests>
<HasUnitTests>true</HasUnitTests>
<SelfContainedLiveTests>true</SelfContainedLiveTests>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="$(RepoRoot)servers\Azure.Mcp.Server\src\Azure.Mcp.Server.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<OutputType>Exe</OutputType>
<HasLiveTests>true</HasLiveTests>
<HasUnitTests>true</HasUnitTests>
<SelfContainedLiveTests>true</SelfContainedLiveTests>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="NSubstitute" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<OutputType>Exe</OutputType>
<HasLiveTests>true</HasLiveTests>
<HasUnitTests>true</HasUnitTests>
<SelfContainedLiveTests>true</SelfContainedLiveTests>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="$(RepoRoot)servers\Azure.Mcp.Server\src\Azure.Mcp.Server.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<OutputType>Exe</OutputType>
<HasLiveTests>true</HasLiveTests>
<HasUnitTests>true</HasUnitTests>
<SelfContainedLiveTests>true</SelfContainedLiveTests>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="NSubstitute" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<IsTestProject>true</IsTestProject>
<HasLiveTests>true</HasLiveTests>
<HasUnitTests>true</HasUnitTests>
<SelfContainedLiveTests>true</SelfContainedLiveTests>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="NSubstitute" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<OutputType>Exe</OutputType>
<HasLiveTests>true</HasLiveTests>
<HasUnitTests>true</HasUnitTests>
<SelfContainedLiveTests>true</SelfContainedLiveTests>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="$(RepoRoot)servers\Azure.Mcp.Server\src\Azure.Mcp.Server.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<OutputType>Exe</OutputType>
<HasLiveTests>true</HasLiveTests>
<HasUnitTests>true</HasUnitTests>
<SelfContainedLiveTests>true</SelfContainedLiveTests>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="$(RepoRoot)servers\Azure.Mcp.Server\src\Azure.Mcp.Server.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<OutputType>Exe</OutputType>
<HasLiveTests>true</HasLiveTests>
<HasUnitTests>true</HasUnitTests>
<SelfContainedLiveTests>true</SelfContainedLiveTests>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="$(RepoRoot)servers\Azure.Mcp.Server\src\Azure.Mcp.Server.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<OutputType>Exe</OutputType>
<HasLiveTests>true</HasLiveTests>
<HasUnitTests>true</HasUnitTests>
<SelfContainedLiveTests>true</SelfContainedLiveTests>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="$(RepoRoot)servers\Azure.Mcp.Server\src\Azure.Mcp.Server.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<OutputType>Exe</OutputType>
<HasLiveTests>true</HasLiveTests>
<HasUnitTests>true</HasUnitTests>
<SelfContainedLiveTests>true</SelfContainedLiveTests>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="$(RepoRoot)servers\Azure.Mcp.Server\src\Azure.Mcp.Server.csproj" />
Expand Down
Loading