[PR #1206] [CLOSED] Added tests for mid-size and big artifacts (to reproduce a problem with chunked uploads) #1838

Closed
opened 2026-03-01 21:52:54 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/nektos/act/pull/1206
Author: @grigorye
Created: 6/10/2022
Status: Closed

Base: masterHead: feature/Tests-For-Chunked-Uploads


📝 Commits (1)

  • c5f8c52 Added tests for mid-size and big artifacts, reproducing a problem with chunked uploads.

📊 Changes

1 file changed (+55 additions, -1 deletions)

View changed files

📝 pkg/artifacts/testdata/upload-and-download/artifacts.yml (+55 -1)

📄 Description

This should reproduce the problem (in artifacts server?) with support for chunked uploads. Namely, artifacts cut at size of 8388608 (8M).

It adds two tests (artifacts 5 and 6):

  • 5 is for mid-sized upload (1M), works fine
  • 6 is for big upload (10M), gets cut on upload at 8388608.
$ act -W pkg/artifacts/testdata/upload-and-download/artifacts.yml --artifact-server-path artifacts
....
[Test that artifact uploads and downloads succeed/test-artifacts] ⭐ Run Main Download artifact #5
[Test that artifact uploads and downloads succeed/test-artifacts]   🐳  docker cp src=/Users/eg/.cache/act/actions-download-artifact@v2/ dst=/var/run/act/actions/actions-download-artifact@v2/
[Test that artifact uploads and downloads succeed/test-artifacts]   🐳  docker exec cmd=[mkdir -p /var/run/act/actions/actions-download-artifact@v2/] user= workdir=
[Test that artifact uploads and downloads succeed/test-artifacts] close /var/folders/mp/3jr0hvr922v_32bx7309bntr0000gn/T/act2616194157: file already closed
[Test that artifact uploads and downloads succeed/test-artifacts]   🐳  docker exec cmd=[node /var/run/act/actions/actions-download-artifact@v2/dist/index.js] user= workdir=
[Test that artifact uploads and downloads succeed/test-artifacts]   💬  ::debug::Resolved path is /Users/eg/Workbench/act/mid-size/artifact/path
| Starting download for Mid-Size-Artifact
[Test that artifact uploads and downloads succeed/test-artifacts]   💬  ::debug::Artifact Url: http://192.168.2.80:34567/_apis/pipelines/workflows/1/artifacts?api-version=6.0-preview
| Directory structure has been setup for the artifact
[Test that artifact uploads and downloads succeed/test-artifacts]   💬  ::debug::Download file concurrency is set to 2
| Total number of files that will be downloaded: 1
[Test that artifact uploads and downloads succeed/test-artifacts]   💬  ::debug::/Users/eg/Workbench/act/mid-size/artifact/path/file5.rnd size:(1048576) blksize:(4096) blocks:(2048)
| Skipping download validation.
| Artifact Mid-Size-Artifact was downloaded to /Users/eg/Workbench/act/mid-size/artifact/path
[Test that artifact uploads and downloads succeed/test-artifacts]   ⚙  ::set-output:: download-path=/Users/eg/Workbench/act/mid-size/artifact/path
| Artifact download has finished successfully
[Test that artifact uploads and downloads succeed/test-artifacts]   ✅  Success - Main Download artifact #5
[Test that artifact uploads and downloads succeed/test-artifacts] ⭐ Run Main Verify Artifact #5
[Test that artifact uploads and downloads succeed/test-artifacts]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/22] user= workdir=
[Test that artifact uploads and downloads succeed/test-artifacts]   ✅  Success - Main Verify Artifact #5
[Test that artifact uploads and downloads succeed/test-artifacts] ⭐ Run Main Download artifact #6
[Test that artifact uploads and downloads succeed/test-artifacts]   🐳  docker cp src=/Users/eg/.cache/act/actions-download-artifact@v2/ dst=/var/run/act/actions/actions-download-artifact@v2/
[Test that artifact uploads and downloads succeed/test-artifacts]   🐳  docker exec cmd=[mkdir -p /var/run/act/actions/actions-download-artifact@v2/] user= workdir=
[Test that artifact uploads and downloads succeed/test-artifacts] close /var/folders/mp/3jr0hvr922v_32bx7309bntr0000gn/T/act2285776570: file already closed
[Test that artifact uploads and downloads succeed/test-artifacts]   🐳  docker exec cmd=[node /var/run/act/actions/actions-download-artifact@v2/dist/index.js] user= workdir=
[Test that artifact uploads and downloads succeed/test-artifacts]   💬  ::debug::Resolved path is /Users/eg/Workbench/act/big/artifact/path
| Starting download for Big-Artifact
[Test that artifact uploads and downloads succeed/test-artifacts]   💬  ::debug::Artifact Url: http://192.168.2.80:34567/_apis/pipelines/workflows/1/artifacts?api-version=6.0-preview
| Directory structure has been setup for the artifact
[Test that artifact uploads and downloads succeed/test-artifacts]   💬  ::debug::Download file concurrency is set to 2
| Total number of files that will be downloaded: 1
[Test that artifact uploads and downloads succeed/test-artifacts]   💬  ::debug::/Users/eg/Workbench/act/big/artifact/path/file6.rnd size:(8388608) blksize:(4096) blocks:(16384)
| Skipping download validation.
| Artifact Big-Artifact was downloaded to /Users/eg/Workbench/act/big/artifact/path
[Test that artifact uploads and downloads succeed/test-artifacts]   ⚙  ::set-output:: download-path=/Users/eg/Workbench/act/big/artifact/path
| Artifact download has finished successfully
[Test that artifact uploads and downloads succeed/test-artifacts]   ✅  Success - Main Download artifact #6
[Test that artifact uploads and downloads succeed/test-artifacts] ⭐ Run Main Verify Artifact #6
[Test that artifact uploads and downloads succeed/test-artifacts]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/24] user= workdir=
| Binary files big/artifact/path/file6.rnd and path/to/dir-6/file6.rnd differ
| File contents of downloaded artifact are incorrect
[Test that artifact uploads and downloads succeed/test-artifacts]   ❌  Failure - Main Verify Artifact #6
[Test that artifact uploads and downloads succeed/test-artifacts] exit with `FAILURE`: 1
Error: Job 'test-artifacts' failed

$ ls -l artifacts/1/*/file?.rnd
-rw-r--r--  1 eg  staff  8388608 Jun 10 09:44 artifacts/1/Big-Artifact/file6.rnd
-rw-r--r--  1 eg  staff  1048576 Jun 10 09:44 artifacts/1/Mid-Size-Artifact/file5.rnd

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/nektos/act/pull/1206 **Author:** [@grigorye](https://github.com/grigorye) **Created:** 6/10/2022 **Status:** ❌ Closed **Base:** `master` ← **Head:** `feature/Tests-For-Chunked-Uploads` --- ### 📝 Commits (1) - [`c5f8c52`](https://github.com/nektos/act/commit/c5f8c5228e62481e733d32bb64729a2b3c2b8ebf) Added tests for mid-size and big artifacts, reproducing a problem with chunked uploads. ### 📊 Changes **1 file changed** (+55 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `pkg/artifacts/testdata/upload-and-download/artifacts.yml` (+55 -1) </details> ### 📄 Description This should reproduce the problem (in [artifacts server](https://github.com/nektos/act/blob/8a473943c3dffbbf47c2a2ef8b261e845646fa6e/pkg/artifacts/server.go)?) with support for chunked uploads. Namely, artifacts cut at size of 8388608 (8M). It adds two tests (artifacts 5 and 6): - 5 is for mid-sized upload (1M), works fine - 6 is for big upload (10M), gets cut on upload at 8388608. ``` $ act -W pkg/artifacts/testdata/upload-and-download/artifacts.yml --artifact-server-path artifacts .... [Test that artifact uploads and downloads succeed/test-artifacts] ⭐ Run Main Download artifact #5 [Test that artifact uploads and downloads succeed/test-artifacts] 🐳 docker cp src=/Users/eg/.cache/act/actions-download-artifact@v2/ dst=/var/run/act/actions/actions-download-artifact@v2/ [Test that artifact uploads and downloads succeed/test-artifacts] 🐳 docker exec cmd=[mkdir -p /var/run/act/actions/actions-download-artifact@v2/] user= workdir= [Test that artifact uploads and downloads succeed/test-artifacts] close /var/folders/mp/3jr0hvr922v_32bx7309bntr0000gn/T/act2616194157: file already closed [Test that artifact uploads and downloads succeed/test-artifacts] 🐳 docker exec cmd=[node /var/run/act/actions/actions-download-artifact@v2/dist/index.js] user= workdir= [Test that artifact uploads and downloads succeed/test-artifacts] 💬 ::debug::Resolved path is /Users/eg/Workbench/act/mid-size/artifact/path | Starting download for Mid-Size-Artifact [Test that artifact uploads and downloads succeed/test-artifacts] 💬 ::debug::Artifact Url: http://192.168.2.80:34567/_apis/pipelines/workflows/1/artifacts?api-version=6.0-preview | Directory structure has been setup for the artifact [Test that artifact uploads and downloads succeed/test-artifacts] 💬 ::debug::Download file concurrency is set to 2 | Total number of files that will be downloaded: 1 [Test that artifact uploads and downloads succeed/test-artifacts] 💬 ::debug::/Users/eg/Workbench/act/mid-size/artifact/path/file5.rnd size:(1048576) blksize:(4096) blocks:(2048) | Skipping download validation. | Artifact Mid-Size-Artifact was downloaded to /Users/eg/Workbench/act/mid-size/artifact/path [Test that artifact uploads and downloads succeed/test-artifacts] ⚙ ::set-output:: download-path=/Users/eg/Workbench/act/mid-size/artifact/path | Artifact download has finished successfully [Test that artifact uploads and downloads succeed/test-artifacts] ✅ Success - Main Download artifact #5 [Test that artifact uploads and downloads succeed/test-artifacts] ⭐ Run Main Verify Artifact #5 [Test that artifact uploads and downloads succeed/test-artifacts] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/22] user= workdir= [Test that artifact uploads and downloads succeed/test-artifacts] ✅ Success - Main Verify Artifact #5 [Test that artifact uploads and downloads succeed/test-artifacts] ⭐ Run Main Download artifact #6 [Test that artifact uploads and downloads succeed/test-artifacts] 🐳 docker cp src=/Users/eg/.cache/act/actions-download-artifact@v2/ dst=/var/run/act/actions/actions-download-artifact@v2/ [Test that artifact uploads and downloads succeed/test-artifacts] 🐳 docker exec cmd=[mkdir -p /var/run/act/actions/actions-download-artifact@v2/] user= workdir= [Test that artifact uploads and downloads succeed/test-artifacts] close /var/folders/mp/3jr0hvr922v_32bx7309bntr0000gn/T/act2285776570: file already closed [Test that artifact uploads and downloads succeed/test-artifacts] 🐳 docker exec cmd=[node /var/run/act/actions/actions-download-artifact@v2/dist/index.js] user= workdir= [Test that artifact uploads and downloads succeed/test-artifacts] 💬 ::debug::Resolved path is /Users/eg/Workbench/act/big/artifact/path | Starting download for Big-Artifact [Test that artifact uploads and downloads succeed/test-artifacts] 💬 ::debug::Artifact Url: http://192.168.2.80:34567/_apis/pipelines/workflows/1/artifacts?api-version=6.0-preview | Directory structure has been setup for the artifact [Test that artifact uploads and downloads succeed/test-artifacts] 💬 ::debug::Download file concurrency is set to 2 | Total number of files that will be downloaded: 1 [Test that artifact uploads and downloads succeed/test-artifacts] 💬 ::debug::/Users/eg/Workbench/act/big/artifact/path/file6.rnd size:(8388608) blksize:(4096) blocks:(16384) | Skipping download validation. | Artifact Big-Artifact was downloaded to /Users/eg/Workbench/act/big/artifact/path [Test that artifact uploads and downloads succeed/test-artifacts] ⚙ ::set-output:: download-path=/Users/eg/Workbench/act/big/artifact/path | Artifact download has finished successfully [Test that artifact uploads and downloads succeed/test-artifacts] ✅ Success - Main Download artifact #6 [Test that artifact uploads and downloads succeed/test-artifacts] ⭐ Run Main Verify Artifact #6 [Test that artifact uploads and downloads succeed/test-artifacts] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/24] user= workdir= | Binary files big/artifact/path/file6.rnd and path/to/dir-6/file6.rnd differ | File contents of downloaded artifact are incorrect [Test that artifact uploads and downloads succeed/test-artifacts] ❌ Failure - Main Verify Artifact #6 [Test that artifact uploads and downloads succeed/test-artifacts] exit with `FAILURE`: 1 Error: Job 'test-artifacts' failed $ ls -l artifacts/1/*/file?.rnd -rw-r--r-- 1 eg staff 8388608 Jun 10 09:44 artifacts/1/Big-Artifact/file6.rnd -rw-r--r-- 1 eg staff 1048576 Jun 10 09:44 artifacts/1/Mid-Size-Artifact/file5.rnd ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-01 21:52:54 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/act#1838
No description provided.