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
11 changes: 11 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,14 @@ jobs:
name: Coverage (macOS)
runs-on: macos-latest
needs: check
# Job-level cap. Without this, a hung instrumented test (we hit one in
# PR #20: 6h5m) burns billable CI minutes. 30 min is ~6x historical
# green-run wall time; genuine slowdowns still pass.
timeout-minutes: 30
# Coverage is informational, not a merge gate. Decoupling it from the
# PR check rollup means a single instrumentation flake does not block
# user-facing fixes from merging.
continue-on-error: true

steps:
- name: Checkout repository
Expand Down Expand Up @@ -152,14 +160,17 @@ jobs:

# Generate the LCOV report. --all-features ensures every code path
# gated behind a feature flag is included in the measurement.
# Step-level timeout: hangs fail in 20 min, not 6h.
- name: Generate LCOV coverage report
timeout-minutes: 20
run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info

# Hard gate: fail the job if line coverage is below 70%.
# Threshold is 70% rather than 80% because the dashboard event loop
# (event.rs, mod.rs) and complex UI render code (settings/render.rs)
# are inherently untestable in CI (terminal I/O, crossterm events).
- name: Enforce 70% line coverage threshold
timeout-minutes: 5
run: cargo llvm-cov --all-features --workspace --fail-under-lines 70

# Upload lcov.info so it can be inspected in the Actions UI or fed
Expand Down
9 changes: 9 additions & 0 deletions crates/clx-core/src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2986,6 +2986,15 @@ ollama:
/// `ServiceUnavailable`/`Keychain`, orthogonal to the validator contract.
#[test]
fn azure_keychain_key_passes_credential_store_validator() {
// GitHub Actions macOS runners have a headless keychain that hangs
// indefinitely on access (PR #22 observed 19 min before timeout in
// the Coverage job). Skip on CI; the test still runs locally and
// on Linux CI (where keychain is unavailable, returning a clean
// ServiceUnavailable error that the test handles).
if std::env::var("GITHUB_ACTIONS").is_ok() && cfg!(target_os = "macos") {
eprintln!("skipping: keychain access hangs on GitHub Actions macOS runners");
return;
}
use crate::credentials::{CredentialError, CredentialStore};
let store = CredentialStore::with_service("clx-test-keyfmt");
let provider = "azure-regression-test-keyfmt";
Expand Down
6 changes: 3 additions & 3 deletions crates/clx-core/src/llm/fallback.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ mod tests {
}

#[tokio::test]
#[serial(env_azure_hosts)]
#[serial(env_azure_hosts_fallback)]
async fn fallback_on_primary_503_succeeds() {
allow_local();
let primary_mock = MockServer::start().await;
Expand Down Expand Up @@ -187,7 +187,7 @@ mod tests {
}

#[tokio::test]
#[serial(env_azure_hosts)]
#[serial(env_azure_hosts_fallback)]
async fn fallback_not_used_on_terminal_error() {
allow_local();
let primary_mock = MockServer::start().await;
Expand All @@ -212,7 +212,7 @@ mod tests {
}

#[tokio::test]
#[serial(env_azure_hosts)]
#[serial(env_azure_hosts_fallback)]
async fn cooldown_skips_primary_after_failure() {
allow_local();
let primary_mock = MockServer::start().await;
Expand Down
Loading