Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
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
6 changes: 4 additions & 2 deletions .claude/commands/check-ci.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
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 the commands below 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 spin"`
6. `cargo check -p edgezero-adapter-spin --target wasm32-wasip2 --features spin`

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

- name: Local CI gate documentation agrees
if: matrix.suite == 'workspace'
run: |
./scripts/check_ci_gate_docs.sh
bash scripts/test_ci_gate_docs.sh

- name: No legacy typed reads
if: matrix.suite == 'workspace'
run: ./scripts/check_no_legacy_typed_reads.sh
Expand Down Expand Up @@ -112,6 +118,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
Comment thread
ChristianPavilonis marked this conversation as resolved.
Resolved

- 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 6 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 @@ -517,4 +517,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.
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 @@ -248,4 +248,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 @@ -544,4 +544,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 @@ -34,6 +34,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