Skip to content
Open
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
5 changes: 3 additions & 2 deletions .claude/commands/check-ci.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
Run the full CI gate checks locally before pushing. Run all four commands sequentially and report any failures:
Run the full CI gate checks locally before pushing. Run all five commands sequentially and report any failures:

1. `cargo fmt --all -- --check`
2. `cargo clippy --workspace --all-targets --all-features -- -D warnings`
3. `cargo test --workspace --all-targets`
4. `cargo check --workspace --all-targets --features "fastly cloudflare"`
4. `cargo test -p edgezero-core --doc`
5. `cargo check --workspace --all-targets --features "fastly cloudflare"`

If any step fails, show the errors and suggest fixes. Do not proceed to the next step until the current one passes.
4 changes: 4 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ jobs:
if: matrix.suite == 'workspace'
run: cargo test --workspace --all-targets

- name: Core doctests
if: matrix.suite == 'workspace'
run: cargo test -p edgezero-core --doc

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

⛏ This gate only exists in CI: scripts/run_tests.sh:36, .claude/commands/check-ci.md and the "CI Gates" list in CLAUDE.md all stop at cargo test --workspace --all-targets, which skips doctests. So a local "all gates pass" never runs the compile_fail test that keeps the snapshot payload from escaping. Suggest adding cargo test -p edgezero-core --doc to all three.


- name: Run EdgeZero CLI tests
if: matrix.suite == 'cli'
run: cargo test -p edgezero-cli --all-targets
Expand Down
10 changes: 7 additions & 3 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ scripts/ # Build/deploy/test helper scripts
# Full workspace test (primary CI command)
cargo test --workspace --all-targets

# Core doctests (not included by --all-targets)
cargo test -p edgezero-core --doc

# Test a specific crate
cargo test -p edgezero-core
cargo test -p edgezero-adapter-fastly
Expand Down Expand Up @@ -186,8 +189,9 @@ Every PR must pass:
1. `cargo fmt --all -- --check`
2. `cargo clippy --workspace --all-targets --all-features -- -D warnings`
3. `cargo test --workspace --all-targets`
4. `cargo check --workspace --all-targets --features "fastly cloudflare spin"`
5. `cargo check -p edgezero-adapter-spin --target wasm32-wasip2 --features spin`
4. `cargo test -p edgezero-core --doc`
5. `cargo check --workspace --all-targets --features "fastly cloudflare spin"`
6. `cargo check -p edgezero-adapter-spin --target wasm32-wasip2 --features spin`

Docs CI additionally runs ESLint + Prettier on the `docs/` directory.

Expand Down Expand Up @@ -283,7 +287,7 @@ Custom commands live in `.claude/commands/`:

| Command | Purpose |
| ----------------- | -------------------------------------------------- |
| `/check-ci` | Run all 4 CI gate checks locally |
| `/check-ci` | Run all 5 CI gate checks locally |
| `/test-all` | Run full workspace test suite |
| `/test-crate` | Run tests for a specific crate |
| `/review-changes` | Staff-engineer-level review of uncommitted changes |
Expand Down
19 changes: 19 additions & 0 deletions crates/edgezero-adapter-cloudflare/tests/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -311,4 +311,23 @@ mod tests {
let body = response.text().await.expect("text");
assert_eq!(body, "no");
}

#[wasm_bindgen_test::wasm_bindgen_test]
fn request_timing_clock_handle_and_attachment_work_on_runtime() {
super::request_timing_tests::clock_handle_and_attachment_work_on_runtime();
}

#[wasm_bindgen_test::wasm_bindgen_test]
fn request_timing_clock_advances_in_browser_harness() {
use worker::Date;

let deadline = Date::now().as_millis().saturating_add(2_000_u64);
super::request_timing_tests::clock_advances_on_local_runtime(|| {
Date::now().as_millis() >= deadline
});
}
}

#[cfg(test)]
#[path = "../../edgezero-core/tests/support/request_timing.rs"]
Comment thread
ChristianPavilonis marked this conversation as resolved.
mod request_timing_tests;
19 changes: 19 additions & 0 deletions crates/edgezero-adapter-fastly/tests/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,4 +244,23 @@ mod tests {
assert_eq!(response.get_status(), FastlyStatus::OK);
assert_eq!(response.take_body_bytes(), b"hello from fastly test");
}

#[test]
fn request_timing_clock_handle_and_attachment_work_on_runtime() {
super::request_timing_tests::clock_handle_and_attachment_work_on_runtime();
}

#[test]
fn request_timing_clock_advances_in_viceroy_harness() {
use std::time::{Duration, SystemTime};

let deadline = SystemTime::now() + Duration::from_secs(2);
super::request_timing_tests::clock_advances_on_local_runtime(|| {
SystemTime::now() >= deadline
});
}
}

#[cfg(test)]
#[path = "../../edgezero-core/tests/support/request_timing.rs"]
mod request_timing_tests;
19 changes: 19 additions & 0 deletions crates/edgezero-adapter-spin/tests/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -536,4 +536,23 @@ mod tests {
"no secret handle yields the no-handle marker"
);
}

#[test]
fn request_timing_clock_handle_and_attachment_work_on_runtime() {
super::request_timing_tests::clock_handle_and_attachment_work_on_runtime();
}

#[test]
fn request_timing_clock_advances_in_wasmtime_harness() {
use std::time::{Duration, SystemTime};

let deadline = SystemTime::now() + Duration::from_secs(2);
super::request_timing_tests::clock_advances_on_local_runtime(|| {
SystemTime::now() >= deadline
});
}
}

#[cfg(test)]
#[path = "../../edgezero-core/tests/support/request_timing.rs"]
mod request_timing_tests;
1 change: 1 addition & 0 deletions crates/edgezero-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ pub mod manifest;
pub mod middleware;
pub mod params;
pub mod proxy;
pub mod request_timing;
pub mod responder;
pub mod response;
pub mod router;
Expand Down
Loading
Loading