Skip to content

Commit ceb98ec

Browse files
committed
Add scenario for BlobPipe case
1 parent 630394f commit ceb98ec

File tree

3 files changed

+43
-2
lines changed

3 files changed

+43
-2
lines changed

azure-pipelines.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -480,8 +480,16 @@ jobs:
480480
workingDirectory: $(Build.ArtifactStagingDirectory)
481481
condition: eq(variables['agent.os'], 'Windows')
482482
483-
- template: azurePipelineTemplates/run_scenarios.yml
483+
- template: azurePipelineTemplates/run_scenarios_linux_macos.yml
484484
parameters:
485-
build_name: $(Build.ArtifactStagingDirectory)/drop/$(build_name)
485+
build_name: $(build_name)
486486
container_name: $(container_name)
487487
storage_account_name: $(AZCOPY_E2E_ACCOUNT_NAME)
488+
condition: or(eq(variables['agent.os'], 'Linux'), eq(variables['agent.os'], 'macOS'))
489+
490+
- template: azurePipelineTemplates/run_scenarios_windows.yml
491+
parameters:
492+
build_name: $(build_name)
493+
container_name: $(container_name)
494+
storage_account_name: $(AZCOPY_E2E_ACCOUNT_NAME)
495+
condition: eq(variables['agent.os'], 'Windows')

azurePipelineTemplates/run_scenarios.yml renamed to azurePipelineTemplates/run_scenarios_linux_macos.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ steps:
1717
# Right now we dont have this fix available in the older version of AzCopy. So, we are using the latest version of AzCopy to run the scenarios.
1818
# We will update this workaround once the fix is available in the older version of AzCopy.
1919
20+
export AZCOPY_AUTO_LOGIN_TYPE=AzCLI
21+
2022
${{ parameters.build_name }} make "https://${{ parameters.storage_account_name }}.blob.core.windows.net/${{ parameters.container_name }}"
2123
echo "Hello, Azure!" > myfile.txt
2224
${{ parameters.build_name }} cp myfile.txt "https://${{ parameters.storage_account_name }}.blob.core.windows.net/${{ parameters.container_name }}"
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
parameters:
2+
- name: build_name
3+
type: string
4+
- name: storage_account_name
5+
type: string
6+
- name: container_name
7+
type: string
8+
9+
steps:
10+
- task: AzureCLI@2
11+
inputs:
12+
azureSubscription: azcopyTestScenarios
13+
addSpnToEnvironment: true
14+
scriptType: pscore
15+
scriptLocation: inlineScript
16+
inlineScript: |
17+
# Right now we dont have this fix available in the older version of AzCopy. So, we are using the latest version of AzCopy to run the scenarios.
18+
# We will update this workaround once the fix is available in the older version of AzCopy.
19+
20+
$env:AZCOPY_AUTO_LOGIN_TYPE = "AzCLI"
21+
& "$(Build.ArtifactStagingDirectory)\drop\$(${{ parameters.build_name }})" make "https://${{ parameters.storage_account_name }}.blob.core.windows.net/${{ parameters.container_name }}"
22+
echo "Hello, Azure!" > myfile.txt
23+
& "$(Build.ArtifactStagingDirectory)\drop\$(${{ parameters.build_name }})" cp myfile.txt "https://${{ parameters.storage_account_name }}.blob.core.windows.net/${{ parameters.container_name }}"
24+
& "$(Build.ArtifactStagingDirectory)\drop\$(${{ parameters.build_name }})" cp "https://${{ parameters.storage_account_name }}.blob.core.windows.net/${{ parameters.container_name }}/myfile.txt" --from-to=BlobPipe --check-md5 FailIfDifferentOrMissing > filename
25+
# Check if the command succeeded
26+
if ($LASTEXITCODE -eq 0) {
27+
Write-Output "AzCopy command succeeded."
28+
} else {
29+
Write-Error "AzCopy command failed with exit code $LASTEXITCODE."
30+
}
31+
displayName: 'Run Scenarios to check if older version of AzCopy appends version check error message to piped download'

0 commit comments

Comments
 (0)