Skip to content

Commit 6cf7b7a

Browse files
Pin the test broker to a specific hash (#2734)
* Pin test broker to a specific hash Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Copilot <[email protected]>
1 parent 4bee788 commit 6cf7b7a

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

sdk/core/azure_core_amqp/Test-Setup.ps1

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,17 @@ Push-Location -Path $WorkingDirectory
2424
try {
2525

2626
$repositoryUrl = "https://github.com/Azure/azure-amqp.git"
27-
# We would like to use the "hotfix" branch because that is current, but unfortunately it references System.Net.Security version 4.0.0
28-
$repositoryBranch = "master"
29-
$cloneCommand = "git clone $repositoryUrl --branch $repositoryBranch"
27+
$repositoryHash = "d82a86455c3459c5628bc95b25511f6e8a065598"
28+
$cloneCommand = "git clone $repositoryUrl --revision $repositoryHash"
29+
3030

3131
Write-Host "Cloning repository from $repositoryUrl..."
3232
Invoke-LoggedCommand $cloneCommand
3333

3434
Set-Location -Path "./azure-amqp/test/TestAmqpBroker"
3535

36-
Invoke-LoggedCommand "dotnet build -p RollForward=LatestMajor --framework net8.0"
37-
if (!$? -ne 0) {
36+
Invoke-LoggedCommand "dotnet build --framework net8.0"
37+
if (-not $?) {
3838
Write-Error "Failed to build TestAmqpBroker."
3939
exit 1
4040
}
@@ -46,8 +46,11 @@ try {
4646

4747
Write-Host "Starting test broker listening on ${env:TEST_BROKER_ADDRESS} ..."
4848

49+
# Note that we cannot use `dotnet run -f` here because the TestAmqpBroker relies on args[0] being the broker address.
50+
# If we use `dotnet run -f`, the first argument is the csproj file.
51+
# Instead, we use `dotnet exec` to run the compiled DLL directly.
52+
# This allows us to pass the broker address as the first argument.
4953
Set-Location -Path $WorkingDirectory/azure-amqp/bin/Debug/TestAmqpBroker/net8.0
50-
5154
$job = dotnet exec ./TestAmqpBroker.dll ${env:TEST_BROKER_ADDRESS} /headless &
5255

5356
$env:TEST_BROKER_JOBID = $job.Id

0 commit comments

Comments
 (0)