diff --git a/.github/workflows/ci_pull_request.yml b/.github/workflows/ci_pull_request.yml index 5e218f25..d911cdea 100644 --- a/.github/workflows/ci_pull_request.yml +++ b/.github/workflows/ci_pull_request.yml @@ -9,7 +9,6 @@ name: CI (Pull Request) on: pull_request: - branches: ['main'] push: branches: ['main'] diff --git a/.github/workflows/ci_run.yml b/.github/workflows/ci_run.yml index adb1d91c..bf29b7c4 100644 --- a/.github/workflows/ci_run.yml +++ b/.github/workflows/ci_run.yml @@ -173,14 +173,14 @@ jobs: if: steps.cache-docker-images.outputs.cache-hit == 'true' run: | ./foc-devnet clean --all - ./foc-devnet init --no-docker-build + ./foc-devnet init --no-docker-build ${{ inputs.init_flags }} # If Docker images are not cached, do full init (downloads YugabyteDB and builds all images) - name: "EXEC: {Initialize without cache}, independent" if: steps.cache-docker-images.outputs.cache-hit != 'true' run: | ./foc-devnet clean --all - ./foc-devnet init + ./foc-devnet init ${{ inputs.init_flags }} # CACHE-DOCKER: Save Docker images as tarballs for caching - name: "EXEC: {Save Docker images for cache}, DEP: {C-docker-images-cache}" diff --git a/scenarios/run.py b/scenarios/run.py index 8eac053a..8a366a69 100755 --- a/scenarios/run.py +++ b/scenarios/run.py @@ -26,7 +26,8 @@ ORDER = [ ("test_containers", 5), ("test_basic_balances", 10), - ("test_storage_e2e", 100), + ("test_storage_e2e", 200), + ("test_multi_copy_upload", 600), ("test_caching_subsystem", 200), ] diff --git a/scenarios/test_multi_copy_upload.py b/scenarios/test_multi_copy_upload.py new file mode 100644 index 00000000..fd2b9d8a --- /dev/null +++ b/scenarios/test_multi_copy_upload.py @@ -0,0 +1,366 @@ +#!/usr/bin/env python3 +"""Multi-copy upload test: upload a random file via filecoin-pin against the devnet.""" + +import os +import re +import subprocess +import sys +import tempfile +import time +from pathlib import Path +from urllib.error import URLError +from urllib.request import urlopen + +sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + +from scenarios.helpers import ( + assert_eq, + assert_ok, + fail, + info, + run_cmd, + write_random_file, +) + +ANSI_RE = re.compile(r"\x1b\[[0-?]*[ -/]*[@-~]") +RAND_FILE_NAME = "random_file" +RAND_FILE_SIZE = 20 * 1024 * 1024 +RAND_FILE_SEED = 42 +ADD_DEADLINE_SECS = 240 +ADD_INTERVAL_SECS = 10 +ADD_ATTEMPT_TIMEOUT_SECS = 180 +RETRIEVAL_DEADLINE_SECS = 90 +RETRIEVAL_INTERVAL_SECS = 5 +RETRIEVAL_REQUEST_TIMEOUT_SECS = 10 +VERIFY_CID_SCRIPT = """ +import { readFileSync } from "node:fs"; +import { CID } from "multiformats"; +import { sha256 } from "multiformats/hashes/sha2"; + +const [cidString, filePath] = process.argv.slice(1); + +if (!cidString || !filePath) { + console.error("usage: node --input-type=module --eval