Skip to content

Feat/codecov code coverage reporting#153

Merged
GideonBature merged 2 commits intoSoroLabs:mainfrom
spartan124:feat/codecov-code-coverage-reporting
Mar 30, 2026
Merged

Feat/codecov code coverage reporting#153
GideonBature merged 2 commits intoSoroLabs:mainfrom
spartan124:feat/codecov-code-coverage-reporting

Conversation

@spartan124
Copy link
Copy Markdown
Contributor

PR Description:

Description

Implements automated code coverage reporting and integrates with Codecov to track testing progress across the repository. This PR sets up comprehensive coverage tracking for both Rust backend (contract) and Node.js frontend components.

Changes

  • GitHub Actions Workflow (.github/workflows/coverage.yml)

    • Runs on every PR and push to main/develop
    • Generates coverage reports for both Rust and frontend
    • Uploads to Codecov automatically
    • Posts coverage summary as PR comment
  • Rust Backend Coverage (cargo-tarpaulin)

    • Configured to track line and branch coverage
    • Excludes fuzz targets automatically
    • 600-second timeout for comprehensive testing
    • Status: Ready, awaiting contract code fixes
  • Frontend Coverage (Jest)

    • Configured for Next.js React components
    • Tracks statements, branches, functions, lines
    • 70% minimum threshold for all metrics
    • Status: ✅ Working and generating reports
  • Configuration Files

    • codecov.yml - Codecov settings and thresholds
    • frontend/jest.config.js - Jest configuration
    • frontend/jest.setup.js - Jest mocks and setup
    • frontend/package.json - Test dependencies and scripts
    • contract/Cargo.toml - Rust coverage metadata
    • CODECOV_SETUP.md - Comprehensive setup guide
  • Documentation

    • CODECOV_SETUP.md with setup instructions
    • Troubleshooting guide for both Rust and frontend
    • Local testing commands for developers
    • Badge addition for README

How It Works

  1. On every PR/push: GitHub Actions triggers the workflow
  2. Coverage generation:
    • Rust: cargo-tarpaulin generates Cobertura XML
    • Frontend: Jest generates JSON coverage reports
  3. Upload: Both reports uploaded to Codecov
  4. PR Comment: Automated comment shows coverage metrics for review
  5. Tracking: Coverage tracked over time at codecov.io

Current Status

  • Frontend: Coverage working and reporting
  • ⚠️ Rust: Build errors in codebase (pre-existing)
    • Workflow handles gracefully without failing
    • Guides future fixes with clear status message
    • Will be enabled once contract code is updated

Testing

  • ✅ Workflow runs successfully on PR
  • ✅ Frontend coverage reports generated
  • ✅ PR comments display coverage metrics
  • ✅ Codecov dashboard accessible
  • ⏳ Rust coverage pending contract code updates

Setup Required (One-Time)

  1. Go to Codecov.io and generate token
  2. Add CODECOV_TOKEN as GitHub Secret
  3. Done! Workflow runs automatically on next PR

Related Issues

Closes #114

Checklist

  • GitHub Actions workflow created
  • cargo-tarpaulin configured for Rust
  • Jest configured for frontend
  • Codecov integration completed
  • PR comments enabled
  • Coverage configuration files added
  • Documentation provided
  • Handles pre-existing Rust errors gracefully

- Add GitHub Actions workflow for automated coverage tracking
- Configure cargo-tarpaulin for Rust backend coverage
- Configure Jest for Node.js/Next.js frontend coverage
- Integrate with Codecov for PR comments and coverage badges
- Add coverage configuration files and setup documentation

Resolves SoroLabs#114
@drips-wave
Copy link
Copy Markdown

drips-wave bot commented Mar 30, 2026

@spartan124 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Copy link
Copy Markdown
Contributor

@GideonBature GideonBature left a comment

Choose a reason for hiding this comment

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

ACK

@GideonBature GideonBature merged commit 1c06eb5 into SoroLabs:main Mar 30, 2026
1 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Testing] Implement Code Coverage Reporting with Codecov

2 participants