Skip to content
Draft
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ target
/deployment
/.idea

# Cursor NAL traces (local-only; do not commit)
.cursor/nal-trace/

# Snapcraft files
stage
prime
Expand Down
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ members = [
"crates/searcher",
"crates/ignore",
]
# Standalone crate for CI fixture testing (`cargo check --manifest-path ci/fixtures/...`).
exclude = ["ci/fixtures/intentionally_buggy"]

[dependencies]
anyhow = "1.0.75"
Expand Down
7 changes: 7 additions & 0 deletions ci/fixtures/intentionally_buggy/Cargo.lock

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

9 changes: 9 additions & 0 deletions ci/fixtures/intentionally_buggy/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[package]
name = "intentionally_buggy"
version = "0.0.0"
edition = "2024"
publish = false

[features]
# Enable to exercise compile-failure paths in CI (e.g. `cargo check -F force_compile_error`).
force_compile_error = []
37 changes: 37 additions & 0 deletions ci/fixtures/intentionally_buggy/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
//! Deliberately defective code for testing CI (lint gates, failure reporting, etc.).
//! This crate is **not** a workspace member; build it explicitly:
//! `cargo check --manifest-path ci/fixtures/intentionally_buggy/Cargo.toml`
//! `cargo test --manifest-path ...` is expected to fail (see `tests::deliberate_failure`).

#![warn(unused)]
#![warn(clippy::all)]

#[cfg(feature = "force_compile_error")]
compile_error!("intentional compile_error for CI fixture testing");

/// Returns `a / b`. Panics when `b == 0` — intentional logic defect.
pub fn sloppy_div(a: i32, b: i32) -> i32 {
a / b
}

// Dead code: should trigger `dead_code` under `-D warnings` / strict CI.
fn never_called() -> u32 {
42
}

pub fn unused_binding() -> i32 {
let x = 1;
let noise = 99; // unused variable: should warn
x + 2
}

#[cfg(test)]
mod tests {
use super::*;

/// CI fixture: fails on purpose so `cargo test --manifest-path ...` exits non-zero.
#[test]
fn deliberate_failure() {
assert_eq!(sloppy_div(10, 2), 42);
}
}
13 changes: 13 additions & 0 deletions tests/ci_spotcheck.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//! Spot checks that only run (and fail) on selected cross targets.

#[cfg(target_arch = "riscv64")]
#[test]
fn ci_spot_fail_riscv64() {
assert!(false, "intentional failure on riscv64 CI only");
}

#[cfg(target_arch = "s390x")]
#[test]
fn ci_spot_fail_s390x() {
assert!(false, "intentional failure on s390x CI only");
}
2 changes: 2 additions & 0 deletions tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ mod misc;
mod multiline;
// Regression tests.
mod regression;
// Fails only on riscv64 / s390x cross-test jobs (see ci_spotcheck.rs).
mod ci_spotcheck;
Loading