Skip to content

Conversation

@github-actions
Copy link
Contributor

Daily Test Coverage Improver - Coverage Steps Configuration

This PR adds the coverage steps action that will be used by the Daily Test Coverage Improver workflow to run comprehensive test coverage analysis.

What This PR Adds

.github/actions/daily-test-improver/coverage-steps/action.yml

A composite GitHub Action that:

  1. Sets up environments: Go and Node.js
  2. Installs dependencies: Both Go modules and npm packages
  3. Runs Go tests with coverage: Generates coverage.out and coverage.html
  4. Runs JavaScript tests with coverage: Includes vitest coverage
  5. Generates detailed analysis:
    • Overall coverage summary
    • Package-level coverage breakdown
    • Functions with lowest coverage (top 30)
    • Zero-coverage functions listing
  6. Logs all steps: Appends output to coverage-steps.log in repository root
  7. Uploads artifacts: All coverage reports as coverage artifact

Coverage Reports Generated

The action generates several valuable reports:

  • coverage.html - Interactive HTML coverage visualization
  • coverage.out - Raw coverage profile for tooling
  • coverage-summary.txt - Function-level coverage summary
  • package-coverage.txt - Coverage breakdown by package
  • low-coverage-areas.txt - Top 30 functions needing tests
  • zero-coverage-sample.txt - Sample of uncovered functions
  • coverage-steps.log - Complete execution log

How This Will Be Used

The Daily Test Coverage Improver workflow will:

  1. Check out the repository
  2. Run this action to generate fresh coverage reports
  3. Download the coverage artifact
  4. Analyze the reports to identify improvement opportunities
  5. Create targeted test additions to improve coverage
  6. Submit pull requests with measurable coverage improvements

Testing Plan

After this PR is merged, I will:

  1. Manually test running through all the steps one by one
  2. Verify coverage reports are generated correctly
  3. Confirm artifacts are uploaded successfully
  4. Document any issues found
  5. Make necessary adjustments in follow-up commits

Please Review

Important: Please review this action carefully to ensure:

  • ✅ The steps are appropriate for the project structure
  • ✅ Dependencies are installed correctly
  • ✅ Coverage generation commands are correct
  • ✅ No security concerns with the composite action
  • ✅ Artifact retention (30 days) is acceptable

The action is designed to be self-contained and transparent, logging all operations to coverage-steps.log for easy debugging.

Related


AI generated by Daily Test Coverage Improver

AI generated by Daily Test Coverage Improver

This action provides comprehensive test coverage analysis infrastructure:
- Runs Go tests with coverage profiling
- Runs JavaScript tests with coverage
- Generates detailed coverage reports and breakdowns
- Identifies lowest coverage areas and zero-coverage functions
- Uploads all coverage artifacts for analysis

The action logs all steps to coverage-steps.log for debugging and
transparency.
@dsyme dsyme marked this pull request as ready for review October 25, 2025 09:59
Copilot AI review requested due to automatic review settings October 25, 2025 09:59
@dsyme dsyme merged commit cddf597 into main Oct 25, 2025
5 checks passed
@dsyme dsyme deleted the daily-test-improver/coverage-steps-config-295af43b7bff9e7a branch October 25, 2025 09:59
@github-actions
Copy link
Contributor Author

Agentic Changeset Generator triggered by this pull request.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a composite GitHub Action to run comprehensive test coverage analysis for the gh-aw repository. The action sets up Go and Node.js environments, runs tests with coverage profiling, generates detailed analysis reports, and uploads all artifacts for the Daily Test Coverage Improver workflow to consume.

Key Changes:

  • Introduces a new composite action that orchestrates complete test coverage generation and analysis
  • Implements multi-language coverage support (Go and JavaScript/Vitest)
  • Creates detailed coverage breakdowns including package-level metrics, low-coverage areas, and zero-coverage function lists

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

shell: bash
run: |
echo "=== Installing JavaScript Dependencies ===" | tee -a coverage-steps.log
cd pkg/workflow/js
Copy link

Copilot AI Oct 25, 2025

Choose a reason for hiding this comment

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

The cd pkg/workflow/js command changes directory but the subsequent commands execute in a subshell. If the directory change fails (e.g., directory doesn't exist), the npm commands will execute in the wrong directory. Add error handling: cd pkg/workflow/js || exit 1

Suggested change
cd pkg/workflow/js
cd pkg/workflow/js || exit 1

Copilot uses AI. Check for mistakes.
shell: bash
run: |
echo "=== Running JavaScript Tests with Coverage ===" | tee -a coverage-steps.log
cd pkg/workflow/js
Copy link

Copilot AI Oct 25, 2025

Choose a reason for hiding this comment

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

The cd pkg/workflow/js command changes directory but lacks error handling. If the directory change fails, npm test will execute in the wrong directory. Add error handling: cd pkg/workflow/js || exit 1

Suggested change
cd pkg/workflow/js
cd pkg/workflow/js || exit 1

Copilot uses AI. Check for mistakes.
Comment on lines +59 to +60
npm ci 2>&1 | tee -a ../../coverage-steps.log
echo "" | tee -a ../../coverage-steps.log
Copy link

Copilot AI Oct 25, 2025

Choose a reason for hiding this comment

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

The relative path ../../coverage-steps.log assumes specific directory nesting and could break if directory structure changes. Consider using $GITHUB_WORKSPACE/coverage-steps.log for a more robust absolute path reference.

Suggested change
npm ci 2>&1 | tee -a ../../coverage-steps.log
echo "" | tee -a ../../coverage-steps.log
npm ci 2>&1 | tee -a $GITHUB_WORKSPACE/coverage-steps.log
echo "" | tee -a $GITHUB_WORKSPACE/coverage-steps.log

Copilot uses AI. Check for mistakes.
Comment on lines +105 to +107
npm test -- --coverage 2>&1 | tee -a ../../coverage-steps.log
EXIT_CODE=${PIPESTATUS[0]}
echo "" | tee -a ../../coverage-steps.log
Copy link

Copilot AI Oct 25, 2025

Choose a reason for hiding this comment

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

The relative path ../../coverage-steps.log assumes specific directory nesting and could break if directory structure changes. Consider using $GITHUB_WORKSPACE/coverage-steps.log for a more robust absolute path reference.

Copilot uses AI. Check for mistakes.
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.

2 participants