Skip to content
Merged
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
26 changes: 26 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,32 @@ jobs:
- name: cargo test
run: cargo test --all-targets --all-features

# Coverage is collected from the `stable` matrix entry only — the
# report is the same on every Rust version. cargo-llvm-cov drives
# llvm-cov over the existing test invocation (no separate test run).
# taiki-e/install-action provides prebuilt binaries to avoid a long
# source compile. Non-blocking so a Codecov outage cannot break CI.
- name: Install cargo-llvm-cov
if: matrix.rust == 'stable'
# taiki-e/install-action v2.79.7
uses: taiki-e/install-action@d9be7d8cda89035c9c843f78bd44d4f72d8403d4 # v2.79.7
with:
tool: cargo-llvm-cov

- name: cargo llvm-cov (lcov)
if: matrix.rust == 'stable'
run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info
Comment on lines +91 to +100
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Checking coverage prereq references..."
rg -n "cargo llvm-cov|llvm-tools-preview|components:" .github/workflows/test.yml scripts/coverage.sh

Repository: agentruntimecontrolprotocol/rust-sdk

Length of output: 774


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "=== test.yml relevant sections ==="
nl -ba .github/workflows/test.yml | sed -n '40,130p'

echo "=== coverage.sh relevant sections ==="
nl -ba scripts/coverage.sh | sed -n '1,120p'

Repository: agentruntimecontrolprotocol/rust-sdk

Length of output: 176


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "=== test.yml relevant sections ==="
cat -n .github/workflows/test.yml | sed -n '40,130p'

echo
echo "=== coverage.sh relevant sections ==="
cat -n scripts/coverage.sh | sed -n '1,120p'

Repository: agentruntimecontrolprotocol/rust-sdk

Length of output: 6250


Install llvm-tools-preview (or use scripts/coverage.sh) before cargo llvm-cov.

test.yml installs only rustfmt, clippy and then runs cargo llvm-cov for the stable matrix (lines 56, 98-100) without installing llvm-tools-preview. scripts/coverage.sh shows cargo llvm-cov needs llvm-cov/llvm-profdata and exits with an error instructing rustup component add llvm-tools-preview when they’re missing (lines 4-6, 42-46).

Proposed fix
       - name: Install cargo-llvm-cov
         if: matrix.rust == 'stable'
         # taiki-e/install-action v2.79.7
         uses: taiki-e/install-action@d9be7d8cda89035c9c843f78bd44d4f72d8403d4 # v2.79.7
         with:
           tool: cargo-llvm-cov

+      - name: Install llvm-tools-preview
+        if: matrix.rust == 'stable'
+        run: rustup component add llvm-tools-preview
+
       - name: cargo llvm-cov (lcov)
         if: matrix.rust == 'stable'
         run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Install cargo-llvm-cov
if: matrix.rust == 'stable'
# taiki-e/install-action v2.79.7
uses: taiki-e/install-action@d9be7d8cda89035c9c843f78bd44d4f72d8403d4 # v2.79.7
with:
tool: cargo-llvm-cov
- name: cargo llvm-cov (lcov)
if: matrix.rust == 'stable'
run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info
- name: Install cargo-llvm-cov
if: matrix.rust == 'stable'
# taiki-e/install-action v2.79.7
uses: taiki-e/install-action@d9be7d8cda89035c9c843f78bd44d4f72d8403d4 # v2.79.7
with:
tool: cargo-llvm-cov
- name: Install llvm-tools-preview
if: matrix.rust == 'stable'
run: rustup component add llvm-tools-preview
- name: cargo llvm-cov (lcov)
if: matrix.rust == 'stable'
run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info
🤖 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 @.github/workflows/test.yml around lines 91 - 100, The workflow currently
runs the "Install cargo-llvm-cov" and "cargo llvm-cov (lcov)" steps without
adding the LLVM Rust toolchain components; update the job to install
llvm-tools-preview before invoking cargo llvm-cov (or replace the direct run
with a call to scripts/coverage.sh which already handles the setup).
Specifically, add a step (before the "cargo llvm-cov (lcov)" step) that runs
rustup component add llvm-tools-preview --toolchain stable (or the appropriate
${{ matrix.rust }} value) so llvm-cov/llvm-profdata are available, or change the
"cargo llvm-cov (lcov)" step to run scripts/coverage.sh which performs the
component installation and error handling.


- name: Upload coverage to Codecov
if: matrix.rust == 'stable'
# codecov/codecov-action v6.0.1
uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1
with:
fail_ci_if_error: false
flags: unittests
files: ./lcov.info
token: ${{ secrets.CODECOV_TOKEN }}

- name: Upload test artifacts on failure
if: failure()
uses: actions/upload-artifact@v7
Expand Down