8000 ci: route v3 memory acceptance from default-main schedule (Refs #776 P15) by adityamukho · Pull Request #830 · project-minigraf/minigraf · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,14 @@ jobs:
filter: "^query/"
file: bench_query.txt

# P15 / G07: four enforcement on/off controls, 10k committed facts.
# Accounting itself is always on. Reserve 2–5 job-minutes; timing
# evidence is deferred to the serial phase-B dispatch.
- name: memory_meter
filter: "^memory_meter/"
file: bench_memory_meter.txt
required_case: '"memory_meter"'

# P02: four existing execute cases plus eight preparation/cursor/slot
# cases. Reserve 4–10 job-minutes pending phase-B timing.
- name: prepared
Expand Down
115 changes: 111 additions & 4 deletions .github/workflows/smoke.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,133 @@
name: Smoke Suite (nightly)

# Scheduled workflows come from main. Keep this file identical on main/v3.
# Main's original smoke runs at 05:00 UTC; v3 acceptance runs at 17:00 UTC.
run-name: >-
Smoke Suite (${{ github.event_name == 'workflow_dispatch' && inputs.ref
|| (github.event.schedule == '0 17 * * *' && 'v3' || 'main') }})

on:
schedule:
- cron: "0 5 * * *"
- cron: "0 17 * * *"
workflow_dispatch:
inputs:
ref:
description: Source ref to check (v3 acceptance skips when absent)
required: true
default: v3

permissions:
contents: read

# Manual refs and the pinned v3 source run in the default-branch workflow's
# context. These cold-build jobs need no shared cache access.
cache-mode: none

jobs:
source:
name: Pin source and inspect acceptance availability
runs-on: ubuntu-latest
timeout-minutes: 5
outputs:
sha: ${{ steps.source.outputs.sha }}
acceptance: ${{ steps.source.outputs.acceptance }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.ref || (github.event.schedule == '0 17 * * *' && 'v3' || 'main') }}
- name: Record actual checkout
id: source
run: |
sha=$(git rev-parse HEAD)
echo "sha=$sha" >> "$GITHUB_OUTPUT"
echo "Measured source: $sha; workflow: ${{ github.workflow_sha }}" >> "$GITHUB_STEP_SUMMARY"
acceptance=true
for test in recursive memory_limit limit large_transaction; do
if [ ! -f "tests/${test}_acceptance_test.rs" ]; then
acceptance=false
fi
done
echo "acceptance=$acceptance" >> "$GITHUB_OUTPUT"
echo "v3 acceptance available: $acceptance" >> "$GITHUB_STEP_SUMMARY"
# A scheduled v3 checkout must never silently skip its acceptance.
if [ '${{ github.event.schedule }}' = '0 17 * * *' ] && [ "$acceptance" != true ]; then
echo 'v3 acceptance targets missing' >&2
exit 1
fi

smoke:
name: Long-haul smoke suite
needs: source
if: github.event.schedule != '0 17 * * *'
runs-on: ubuntu-latest
timeout-minutes: 15

steps:
- uses: actions/checkout@v4

with:
# The original smoke suite always exercises trusted main. Only the
# isolated acceptance jobs below consume the selected source SHA.
ref: main
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable

- name: Run smoke suite
run: cargo test --test smoke_test -- --include-ignored --nocapture
run: |
echo "Main smoke source: $(git rev-parse HEAD)" >> "$GITHUB_STEP_SUMMARY"
cargo test --test smoke_test -- --include-ignored --nocapture
env:
RUST_BACKTRACE: 1

# Separate from Bencher latency: these existing tests assert fixed retained
# state/RSS bounds (and QRY-012 exhaustion), rather than uploading RSS as time.
# Runtime within the existing 15/30/45-minute budgets remains unverified.
acceptance:
name: v3 acceptance / ${{ matrix.name }}
needs: source
if: needs.source.outputs.acceptance == 'true'
runs-on: ubuntu-latest
timeout-minutes: ${{ matrix.timeout }}
strategy:
fail-fast: false
matrix:
include:
- name: recursive
timeout: 45
command: cargo test --profile bench --test recursive_acceptance_test -- --ignored --nocapture
- name: memory-limit
timeout: 30
command: cargo test --profile bench --test memory_limit_acceptance_test -- --ignored --nocapture --test-threads=1
- name: limit
timeout: 30
command: cargo test --profile bench --test limit_acceptance_test -- --ignored --nocapture
- name: large-transaction
timeout: 30
command: cargo test --profile bench --features test-hooks --test large_transaction_acceptance_test -- --ignored --nocapture
- name: size-per-fact
timeout: 15
command: cargo test --lib size_per_fact_in_433_shape_1m -- --include-ignored --nocapture
steps:
- uses: actions/checkout@v4
with:
ref: ${{ needs.source.outputs.sha }}
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
- name: Run acceptance and retain source/test evidence
env:
RUST_BACKTRACE: 1
ACCEPTANCE_COMMAND: ${{ matrix.command }}
run: |
set -o pipefail
{
echo "Source: $(git rev-parse HEAD)"
echo "Workflow: ${{ github.workflow_sha }}"
echo "Command: $ACCEPTANCE_COMMAND"
$ACCEPTANCE_COMMAND
} 2>&1 | tee acceptance.txt
- name: Retain acceptance output including executed test names and RSS/state
if: always()
uses: actions/upload-artifact@v6
with:
name: acceptance-${{ matrix.name }}
path: acceptance.txt
if-no-files-found: error
retention-days: 30
Loading
0