mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-18 08:15:29 +00:00
ci: run a fraction of the fuzz-style tests on pull requests, all of them nightly
craft-testkit's hostile hammer reads CRAFT_HOSTILE_DIVISOR=N: the unmodified seed, every N-th truncation and 1/N of the rounds. hostile::divisor() gives the same value to sweeps written without the hammer; craft-image-codecs' TIFF zoo and malformed-header sweeps use it, with a different offset per input so the inputs together still reach every position. Proptests without their own case count read proptest's PROPTEST_CASES. The Workspace gate and the media, audio, video and PDF workflows set CRAFT_HOSTILE_DIVISOR=8 and PROPTEST_CASES=64. The longest of these tests (craft-media's MXF hostile input, 1,310 s on Windows; craft-pdf's crypt proptests, up to 257 s; the image-codecs sweeps, 140-162 s) drop to about an eighth or a quarter. nightly.yml runs the whole workspace on Linux without either variable, so every case still runs once a day. The gate's test-input setup moves to scripts/ci-test-inputs.sh, shared by both workflows; it uses a corpus that is already present.
This commit is contained in:
1 parent
a97b7948a9
commit
ff502fb75f
15 files changed
+215
-45
No files matched your search
@@ -80,6 +80,7 @@ workflows:
|
||||
- 'actions/checkout@v7.0.1'
|
||||
- 'dtolnay/rust-toolchain@stable'
|
||||
- 'swatinem/rust-cache@v2.9.3'
|
||||
'.github/workflows/nightly.yml': []
|
||||
'.github/workflows/pcraft-format.yml':
|
||||
- 'actions/checkout@v7.0.1'
|
||||
- 'step-security/dtolnay-rust-toolchain@v1.0.0'
|
||||
|
||||
@@ -11,6 +11,11 @@ on:
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
# A fraction of the fuzz-style cases, as in the Workspace gate; nightly.yml runs them in full.
|
||||
env:
|
||||
CRAFT_HOSTILE_DIVISOR: "8"
|
||||
PROPTEST_CASES: "64"
|
||||
|
||||
concurrency:
|
||||
# Pull requests share one group per branch, so a newer push cancels the older run. Every other
|
||||
# run (main, manual) gets its own group: it is never cancelled or replaced while queued, so it
|
||||
|
||||
@@ -11,6 +11,11 @@ on:
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
# A fraction of the fuzz-style cases, as in the Workspace gate; nightly.yml runs them in full.
|
||||
env:
|
||||
CRAFT_HOSTILE_DIVISOR: "8"
|
||||
PROPTEST_CASES: "64"
|
||||
|
||||
concurrency:
|
||||
# Pull requests share one group per branch, so a newer push cancels the older run. Every other
|
||||
# run (main, manual) gets its own group: it is never cancelled or replaced while queued, so it
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
name: Nightly full tests
|
||||
|
||||
# The tests the Workspace gate shortens, in full, once a day: every hostile-input hammer and sweep
|
||||
# without CRAFT_HOSTILE_DIVISOR, and every proptest at its own case count (no PROPTEST_CASES). The
|
||||
# rest of the workspace's tests run with them, on Linux, with the gate's setup.
|
||||
on:
|
||||
schedule:
|
||||
- cron: "37 2 * * *"
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: nightly-${{ github.ref }}
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
full:
|
||||
name: Full tests
|
||||
uses: storytold/craft-common-actions/.github/workflows/gate.yml@main
|
||||
with:
|
||||
os: '["ubuntu-latest"]'
|
||||
timeout-minutes: 120
|
||||
tools: cargo-nextest@0.9.150
|
||||
packages: mesa-vulkan-drivers libvulkan1
|
||||
craft-fonts-ref: b076417b5880bd4154bd22f00695b1d28c6bea83
|
||||
linux-env: WGPU_BACKEND=vulkan
|
||||
env: CRAFT_PRINT_REQUIRE_QUEUE=0
|
||||
setup-command: bash scripts/ci-test-inputs.sh
|
||||
command: cargo nextest run --workspace --all-features --locked --profile ci
|
||||
@@ -11,6 +11,10 @@ on:
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
# A fraction of the proptest cases, as in the Workspace gate; nightly.yml runs them in full.
|
||||
env:
|
||||
PROPTEST_CASES: "64"
|
||||
|
||||
concurrency:
|
||||
# Pull requests share one group per branch, so a newer push cancels the older run. Every other
|
||||
# run (main, manual) gets its own group: it is never cancelled or replaced while queued, so it
|
||||
|
||||
@@ -11,6 +11,11 @@ on:
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
# A fraction of the fuzz-style cases, as in the Workspace gate; nightly.yml runs them in full.
|
||||
env:
|
||||
CRAFT_HOSTILE_DIVISOR: "8"
|
||||
PROPTEST_CASES: "64"
|
||||
|
||||
concurrency:
|
||||
group: shared-video-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
@@ -31,22 +31,14 @@ jobs:
|
||||
craft-fonts-ref: b076417b5880bd4154bd22f00695b1d28c6bea83
|
||||
linux-env: WGPU_BACKEND=vulkan
|
||||
windows-env: CRAFT_PRINT_REQUIRE_QUEUE=1
|
||||
env: CRAFT_PRINT_REQUIRE_QUEUE=0
|
||||
setup-command: |
|
||||
set -euo pipefail
|
||||
corpus_fetcher=.test-inputs/photocraft
|
||||
mkdir -p "$corpus_fetcher"
|
||||
git -C "$corpus_fetcher" init
|
||||
git -C "$corpus_fetcher" remote add origin https://github.com/storytold/PhotoCraft.git
|
||||
git -C "$corpus_fetcher" fetch --quiet --depth=1 origin 74330157cb601573ae4523a95bb9132822fc3918
|
||||
git -C "$corpus_fetcher" checkout --quiet --detach FETCH_HEAD
|
||||
(cd "$corpus_fetcher" && cargo xtask corpus --psd --psd-tools --atn --exr --heif --pngsuite)
|
||||
mkdir -p corpus
|
||||
cp -a "$corpus_fetcher/corpus/." corpus/
|
||||
python scripts/test-fetch-pdf-test-fonts.py
|
||||
python scripts/fetch-pdf-test-fonts.py "$RUNNER_TEMP/craft-pdf-test-fonts"
|
||||
printf 'CRAFT_PSD_CORPUS=%s\n' "$GITHUB_WORKSPACE/$corpus_fetcher/corpus" >> "$GITHUB_ENV"
|
||||
printf 'CRAFT_PDF_TEST_FONT_DIR=%s\n' "$RUNNER_TEMP/craft-pdf-test-fonts" >> "$GITHUB_ENV"
|
||||
# The fuzz-style tests run a fraction of their cases here: every hostile-input hammer and
|
||||
# sweep 1/8 (craft-testkit's CRAFT_HOSTILE_DIVISOR), every proptest without its own case
|
||||
# count 64 cases instead of 256. nightly.yml runs them all in full.
|
||||
env: |
|
||||
CRAFT_PRINT_REQUIRE_QUEUE=0
|
||||
CRAFT_HOSTILE_DIVISOR=8
|
||||
PROPTEST_CASES=64
|
||||
setup-command: bash scripts/ci-test-inputs.sh
|
||||
command: |
|
||||
python3 scripts/test-workspace-concurrency.py
|
||||
python3 scripts/test-workspace-tests.py
|
||||
|
||||
Reference in new issue
Block a user