Skip to content

Commit dc18f29

Browse files
committed
[invalid] Test uploads with azcopy
1 parent 3e5b8de commit dc18f29

File tree

9 files changed

+66
-5
lines changed

9 files changed

+66
-5
lines changed

scripts/azure-pipelines/azure-pipelines.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ parameters:
55
- name: vcpkgToolSha
66
displayName: 'Custom SHA of vcpkg-tool to use rather than bootstrap'
77
type: string
8-
default: 'use default'
8+
default: 'refs/pull/1679/merge'
99
- name: tripletPattern
1010
displayName: 'Enable triplets which contain this substring'
1111
type: string

scripts/azure-pipelines/bootstrap-from-source.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
#!/bin/sh
22
set -e
33

4-
git clone https://github.com/microsoft/vcpkg-tool vcpkg-tool
5-
git -C vcpkg-tool switch -d $1
4+
git clone --depth 1 https://github.com/microsoft/vcpkg-tool vcpkg-tool
5+
git -C vcpkg-tool fetch --depth 1 origin $1
6+
git -C vcpkg-tool switch -d FETCH_HEAD
67
rm -rf build.x64.release
78
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DVCPKG_DEVELOPMENT_WARNINGS=OFF -DVCPKG_WARNINGS_AS_ERRORS=OFF -DVCPKG_BUILD_FUZZING=OFF -DVCPKG_BUILD_TLS12_DOWNLOADER=OFF -B build.x64.release -S vcpkg-tool
89
ninja -C build.x64.release

scripts/azure-pipelines/test-modified-ports.ps1

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,41 @@ if ($Triplet -eq 'x64-windows-release') {
128128
$tripletArg = "--triplet=$Triplet"
129129
}
130130

131+
# Test uploads with azcopy
132+
# Using portable binaries from
133+
# https://learn.microsoft.com/en-us/azure/storage/common/storage-use-azcopy-v10?tabs=dnf#download-the-azcopy-portable-binary
134+
if ($Triplet -eq 'x64-windows')
135+
{
136+
$local_name = 'azcopy_windows_amd64_10.29.0'
137+
& $vcpkgExe x-download "$local_name.zip" "--url=https://aka.ms/downloadazcopy-v10-windows" "--sha512=fa2db4d722467eb0daebeddab20625198bbe7cd3102ac0fcec42a1b9f5f633e3d56cf4a02b2396c6ff3459eb291f5bfd5865cc97d4d731b6d05d0db1683c8a57" @cachingArgs
138+
Expand-Archive -Path "$local_name.zip" -Destination azcopy
139+
$env:PATH += ";$PWD\azcopy\$local_name"
140+
}
141+
elseif ($Triplet -eq 'x64-linux')
142+
{
143+
$local_name = 'azcopy_linux_amd64_10.29.0'
144+
& $vcpkgExe x-download "$local_name.tgz" "--url=https://aka.ms/downloadazcopy-v10-linux" "--sha512=c5f21fdf57066f9b4c17deb0b3649cb901863d8c6619f1a010abfde80ff7fdadf7ea9483bfa3820ae833e7953558294215b3a413b5efff75967fb368dcb1426a" @cachingArgs
145+
& tar xvzf "$local_name.tgz"
146+
$env:PATH += ":$PWD/$local_name"
147+
}
148+
& azcopy --version
149+
$lastLastExitCode = $LASTEXITCODE
150+
if ($lastLastExitCode -ne 0)
151+
{
152+
Write-Error 'Cannot run azcopy.'
153+
exit $lastLastExitCode
154+
}
155+
# Vary ABI hash
156+
Get-Date | Out-File "scripts/manual-tests/azcopy/test-upload-artifacts/mutable"
157+
# 3 GB < single max write (5 GB) < 2x3 GB
158+
$data = New-Object byte[] 3GB
159+
(New-Object System.Random).NextBytes($data)
160+
[System.IO.File]::WriteAllBytes("scripts/manual-tests/azcopy/core.dat", $data)
161+
(New-Object System.Random).NextBytes($data)
162+
[System.IO.File]::WriteAllBytes("scripts/manual-tests/azcopy/large.dat", $data)
163+
& $vcpkgExe x-test-features test-upload-artifacts --overlay-ports=scripts/manual-tests/azcopy $tripletArg $failureLogsArg $ciBaselineArg $failingAbiLogArg $ciFeatureBaselineArg @commonArgs @cachingArgs
164+
exit $LASTEXITCODE
165+
131166
$failureLogs = Join-Path $ArtifactStagingDirectory 'failure-logs'
132167
$failureLogsArg = "--failure-logs=$failureLogs"
133168
$knownFailuresFromArgs = @()

scripts/azure-pipelines/windows/bootstrap-from-source.cmd

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=x86 -host_arch=x86
2-
git clone https://github.com/microsoft/vcpkg-tool vcpkg-tool
3-
git -C vcpkg-tool switch -d %1
2+
git clone --depth 1 https://github.com/microsoft/vcpkg-tool vcpkg-tool
3+
git -C vcpkg-tool fetch --depth 1 origin %1
4+
git -C vcpkg-tool switch -d FETCH_HEAD
45
rmdir /s /q build.x86.release > nul 2> nul
56
cmake.exe -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DVCPKG_DEVELOPMENT_WARNINGS=OFF -DVCPKG_WARNINGS_AS_ERRORS=OFF -DVCPKG_BUILD_FUZZING=OFF -DVCPKG_BUILD_TLS12_DOWNLOADER=OFF -B build.x86.release -S vcpkg-tool
67
ninja.exe -C build.x86.release

scripts/manual-tests/azcopy/core.dat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
placeholder

scripts/manual-tests/azcopy/large.dat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
placeholder
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
placeholder
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
2+
3+
file(INSTALL "${CURRENT_PORT_DIR}/mutable" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
4+
foreach(name IN LISTS FEATURES)
5+
file(INSTALL "${CURRENT_PORT_DIR}/../${name}.dat" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
6+
endforeach()
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "test-upload-artifacts",
3+
"version-string": "ci",
4+
"description": [
5+
"Tests uploading artifacts of varying size.",
6+
"Write suitable amounts of random data to the datafiles before installing the port."
7+
],
8+
"homepage": "https://github.com/microsoft/vcpkg",
9+
"license": "MIT",
10+
"features": {
11+
"large" : {
12+
"description": "Install large.dat"
13+
}
14+
}
15+
}

0 commit comments

Comments
 (0)