Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
27 changes: 27 additions & 0 deletions .config/hakari.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# This file contains settings for `cargo hakari`.
# See https://docs.rs/cargo-hakari/latest/cargo_hakari/config for a full list of options.

hakari-package = "agentflare-workspace-hack"

# Format version for hakari's output. Version 4 requires cargo-hakari 0.9.22 or above.
dep-format-version = "4"

# Setting workspace.resolver = "2" or higher in the root Cargo.toml is HIGHLY recommended.
# Hakari works much better with the v2 resolver. (The v2 and v3 resolvers are identical from
# hakari's perspective, so you're welcome to set either.)
#
# For more about the new feature resolver, see:
# https://blog.rust-lang.org/2021/03/25/Rust-1.51.0.html#cargos-new-feature-resolver
resolver = "2"

# Add triples corresponding to platforms commonly used by developers here.
# https://doc.rust-lang.org/rustc/platform-support.html
platforms = [
"x86_64-unknown-linux-gnu",
"x86_64-apple-darwin",
"aarch64-apple-darwin",
"x86_64-pc-windows-msvc",
]

# Write out exact versions rather than a semver range. (Defaults to false.)
# exact-versions = true
5 changes: 5 additions & 0 deletions .config/nextest.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[profile.default]
# A single hung test shouldn't be able to pin a runner for the job's full
# 25-minute timeout (see ci.yml) — kill it well before that and let the rest
# of the suite keep going.
slow-timeout = { period = "60s", terminate-after = 5 }
Comment on lines +1 to +5

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -eu

printf '%s\n' '--- tracked nextest and CI files ---'
git ls-files | rg '(^|/)(nextest\.toml|.*ci.*\.ya?ml|.*workflow.*\.ya?ml)$|(^|/)Cargo\.toml$' | head -200

printf '%s\n' '--- nextest configuration references ---'
rg -n -C 4 'slow-timeout|terminate-after|fail-fast|nextest run|cargo nextest' .config .github . 2>/dev/null | head -300

Repository: getappz/agentflare

Length of output: 3258


🌐 Web query:

cargo nextest configuration reference default profile fail-fast timeout terminate-after behavior

💡 Result:

In cargo-nextest, fail-fast and timeout configurations are managed via profiles (such as [profile.default]) in the.config/nextest.toml repository configuration file [1][2]. Fail-Fast Behavior The fail-fast setting determines how nextest behaves when tests fail [3]. - Default: Enabled (true), which stops scheduling new tests after the first failure [1][3]. - Configuration: It can be set as a boolean or an object [1][3]. - fail-fast = true (default): Stops after the first failure, waiting for already running tests to finish naturally [3]. - fail-fast = { max-fail = N }: Stops the run after N failures [3]. - fail-fast = false (or max-fail = "all"): Continues running all tests regardless of failures [3]. - Termination Modes: When max-fail is reached, you can control how currently running tests are handled [3]: - terminate = "wait" (default): Allows running tests to complete naturally [3]. - terminate = "immediate": Sends termination signals to running tests immediately (respecting the grace period) [3]. Timeout and Terminate-After Behavior The slow-timeout setting identifies tests taking longer than expected [1][4]. - Configuration: Defined as a string (e.g., "60s") or an object [1]. - Object Parameters [1]: - period: The time duration after which a test is marked slow [1]. - terminate-after: The number of 'period' durations to wait before terminating the test [1]. By default, this is not set (tests are not terminated) [1]. - grace-period: The time to wait for a graceful shutdown before force-terminating a test (default: 10s) [1]. - on-timeout: Defines the result if a test times out; defaults to "fail", but can be set to "pass" (e.g., for certain fuzz tests) [1][4]. When a test is terminated (either via fail-fast's "immediate" mode or exceeding a slow-timeout), nextest uses its grace period logic to attempt a clean shutdown before force-killing the test process [1][3]. These settings can be applied globally in a profile or via per-test overrides using the [[profile.default.overrides]] section [4][5].

Citations:


🏁 Script executed:

#!/bin/bash
set -eu

python3 - <<'PY'
from pathlib import Path
import re

p = Path(".config/nextest.toml")
text = p.read_text()
print("--- .config/nextest.toml ---")
print(text)

section = re.search(r"(?ms)^\[profile\.default\]\s*(.*?)(?=^\[|\Z)", text)
if not section:
    raise SystemExit("profile.default not found")
body = section.group(1)
print("--- parsed profile.default keys ---")
for line in body.splitlines():
    line = line.split("#", 1)[0].strip()
    if line and "=" in line:
        print(line.split("=", 1)[0].strip())
print("--- fail-fast declaration count ---")
print(len(re.findall(r"(?m)^\s*fail-fast\s*=", body)))
PY

Repository: getappz/agentflare

Length of output: 524


Set fail-fast = false in the default profile.

terminate-after causes a test to fail. With the default fail-fast = true, cargo nextest run stops scheduling new tests after the first timeout. This prevents the full suite from running.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.config/nextest.toml around lines 1 - 5, Update the [profile.default]
configuration to set fail-fast = false alongside slow-timeout, ensuring timeout
failures do not stop cargo nextest run from scheduling the remaining tests.

57 changes: 51 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ jobs:
- 'Cargo.lock'
- 'build.rs'
- 'crates/**'
- 'agentflare-workspace-hack/**'
- 'src/**'
- '.config/**'
- '.github/workflows/ci.yml'

build:
Expand Down Expand Up @@ -76,6 +78,10 @@ jobs:
save-if: ${{ github.ref == 'refs/heads/master' }}
- if: needs.changes.result != 'success' || needs.changes.outputs.code == 'true'
uses: mozilla-actions/sccache-action@d651010b8da762cde178750d8eda7b5febfe147a # v0.0.9
- if: needs.changes.result != 'success' || needs.changes.outputs.code == 'true'
uses: taiki-e/install-action@91ddec75689c4c78665b598d188dc821c5a43e5c # v2.85.9
with:
tool: nextest
# Windows Defender exclusions were tried here on the theory that
# real-time scanning of build output and test temp files was behind the
# slow Windows leg. Measured warm-to-warm on master, it wasn't: test
Expand All @@ -84,13 +90,20 @@ jobs:
# master baseline it was compared against. Don't re-add it without a
# measurement that separates test execution from compilation.
#
# No separate `cargo build` step: `cargo test` compiles and links the
# same libs and bins (it builds every bin target so integration tests
# can spawn them -- see crates/flare-git-shim/tests/shim_test.rs), so
# building first was a second full pass over the workspace for nothing.
# Non-test targets still get type-checked by `clippy --all-targets`.
# No separate `cargo build` step: `cargo nextest run` compiles and
# links the same libs and bins (it builds every bin target so
# integration tests can spawn them -- see
# crates/flare-git-shim/tests/shim_test.rs), so building first was a
# second full pass over the workspace for nothing. Non-test targets
# still get type-checked by `clippy --all-targets`.
#
# nextest doesn't run doctests (it only executes test *binaries*), so
# `cargo test --doc` covers those separately -- cheap even though the
# workspace has none today, as insurance against one being added later.
- if: needs.changes.result != 'success' || needs.changes.outputs.code == 'true'
run: cargo nextest run --workspace --verbose
- if: needs.changes.result != 'success' || needs.changes.outputs.code == 'true'
run: cargo test --workspace --verbose
run: cargo test --doc --workspace --verbose

clippy:
needs: changes
Expand Down Expand Up @@ -137,6 +150,37 @@ jobs:
- if: needs.changes.result != 'success' || needs.changes.outputs.code == 'true'
run: cargo fmt --check

hakari:
# Keeps agentflare-workspace-hack in sync: catches a crate whose
# dependency changes would otherwise cause cargo to build a third-party
# crate more than one way across the workspace (the thing the
# workspace-hack crate exists to prevent).
needs: changes
if: always()
permissions:
contents: read
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- if: needs.changes.result != 'success' || needs.changes.outputs.code == 'true'
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
with:
fetch-depth: 0
- if: needs.changes.result != 'success' || needs.changes.outputs.code == 'true'
uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2 # zizmor: ignore[cache-poisoning] save-if already gates writes to master
with:
save-if: ${{ github.ref == 'refs/heads/master' }}
- if: needs.changes.result != 'success' || needs.changes.outputs.code == 'true'
uses: taiki-e/install-action@91ddec75689c4c78665b598d188dc821c5a43e5c # v2.85.9
with:
tool: cargo-hakari
- if: needs.changes.result != 'success' || needs.changes.outputs.code == 'true'
run: cargo hakari generate --diff
- if: needs.changes.result != 'success' || needs.changes.outputs.code == 'true'
run: cargo hakari manage-deps --dry-run
- if: needs.changes.result != 'success' || needs.changes.outputs.code == 'true'
run: cargo hakari verify

deny:
# No paths filter, same rationale as security-check.yml's audit job: a
# path-filtered required check never reports on PRs that skip it,
Expand Down Expand Up @@ -188,6 +232,7 @@ jobs:
- build
- clippy
- fmt
- hakari
- deny
- target-dir-guard
runs-on: ubuntu-latest
Expand Down
105 changes: 77 additions & 28 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading