Skip to content

GHCP -- Walk: Ex2 Build and Test Baseline (Coverage Surfacing) - #3577

Closed
neha-p6 wants to merge 1 commit into
learn/walk/neha-p6-ex1from
learn/walk/neha-p6-ex2
Closed

GHCP -- Walk: Ex2 Build and Test Baseline (Coverage Surfacing)#3577
neha-p6 wants to merge 1 commit into
learn/walk/neha-p6-ex1from
learn/walk/neha-p6-ex2

Conversation

@neha-p6

@neha-p6 neha-p6 commented May 21, 2026

Copy link
Copy Markdown

Summary

  • Added a ## Running Tests & Coverage Locally section to CONTRIBUTING.md with exact commands for both Go components and the Ruby/Omnibus suite — previously the file was a single-line redirect to another repo
  • Extended ai-track-docs/build-test.md with a ## Coverage section: per-package baselines, annotated tables, and a PR Coverage Snippet Template for future PRs
  • Added coverage.out and coverage.html to .gitignore (these were untracked build artifacts)
  • Plan: survey test runners → run coverage locally → document commands + baselines → add PR snippet template → commit

Files/paths touched

  • CONTRIBUTING.md
  • ai-track-docs/build-test.md
  • .gitignore

Evidence

# chef-automate-collect
$ cd components/chef-automate-collect
$ go test -cover -count=1 ./commands
ok  github.com/chef/chef-workstation/components/chef-automate-collect/commands  0.655s  coverage: 4.9% of statements

# main-chef-wrapper
$ cd components/main-chef-wrapper
$ go test -tags=unit -cover -count=1 ./cmd
ok  github.com/chef/chef-workstation/components/main-chef-wrapper/cmd  0.528s  coverage: 56.9% of statements

Coverage

Component Package Coverage Baseline
chef-automate-collect commands/ 4.9% established here
main-chef-wrapper cmd/ (unit tag) 56.9% established here
Ruby/Omnibus spec/ ≥ 79% (CI-enforced) pre-existing CI threshold

chef-automate-collect coverage is intentionally low: command bodies invoke external HTTP/IO unreachable by unit tests. The covered surface is pure-logic (env-var constants, config struct parsing, error mapping).

Risk & Rollback

  • Risk: low (doc + .gitignore only, no source code changed)
  • Rollback: git revert c182adf9

Review Focus

  • Verify coverage commands run cleanly on your machine
  • Confirm the PR snippet template in build-test.md matches the format you want future PRs to use
  • Reviewer can run: go test -tags=unit -cover -count=1 ./cmd from components/main-chef-wrapper

Track

  • Level: Walk
  • Exercise: Ex2

@neha-p6
neha-p6 changed the base branch from main to learn/walk/neha-p6-ex1 May 21, 2026 11:38
@neha-p6
neha-p6 force-pushed the learn/walk/neha-p6-ex1 branch from feda526 to 380d0c2 Compare May 21, 2026 11:45
…ect); gitignore coverage.out

Signed-off-by: neha-p6 <neha.pansare@progress.com>
@neha-p6
neha-p6 force-pushed the learn/walk/neha-p6-ex2 branch from c182adf to 96d0c9b Compare May 21, 2026 11:46
@neha-p6 neha-p6 closed this May 21, 2026
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.

1 participant