본문으로 건너뛰기
cccskills
무료GitHub에 공개

fix-test

Debug and fix failing bashdep tests systematically

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

Chemaclass/bashdep스타 19(GitHub 19 + cccskills 0)

실행 점수 미검증

설치 방법 보기

포함된 파일(1)

  • SKILL.md2.3 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Fix Test

Systematically debug and fix failing test(s) in tests/unit/bashdep_test.sh.

Workflow

1. Identify Failures

make test 2>&1
# Or, narrower:
lib/bashunit tests --filter <test_name>

Parse: which test functions fail, what assertions, what the actual vs expected was.

2. Categorize Each Failure

  • Test bug - wrong expected value, missing set_up reset, leaky state
  • Implementation bug - bashdep doesn't match expected behavior
  • Snapshot drift - output legitimately changed; snapshot needs updating
  • Environment issue - missing $TEST_DIR, hardcoded path that doesn't exist, missing fixture
  • Bash 3.2 compat regression - code uses a Bash 4+ feature
  • Mode-flag leak - BASHDEP_* global from a prior test wasn't reset

3. Fix

  • Test bug: correct the assertion, fixture, or set_up
  • Implementation bug: minimal fix in bashdep, follow TDD (regression test must already exist or be added now)
  • Snapshot drift: confirm the new output is correct, then lib/bashunit --update-snapshots tests/. Review the diff before committing
  • Environment: fix the fixture path; never hardcode /tmp/... outside snapshot tests
  • Bash 3.2 compat: swap to a 3.2-safe construct (see .claude/rules/bash-style.md)
  • Mode-flag leak: add the reset to set_up, or scope the change to the single test

4. Verify

lib/bashunit tests --filter <test_name>   # Specific test
make test                                  # Full suite
make sa && make lint                       # Static checks

5. Prevent Regression

  • Document the root cause in the commit message body when non-obvious
  • Add an edge-case test if the failure exposed a missing case
  • If the bug crossed mode-flag boundaries, add tests for each mode (dry-run, silent, verbose, force)

Debugging Tips

  • Use --filter "test_name" to run a single test in isolation
  • Add printf 'DEBUG: %s\n' "$var" >&2 temporarily - strip before commit
  • If a test passes alone but fails in the suite, suspect a leaked BASHDEP_* global; reset in set_up
  • For snapshot mismatches, diff the snapshot file vs current stdout before regenerating

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Add a new bashdep:: lifecycle command with TDD

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

Chemaclass/bashdep192026년 10월 20일 업데이트

commit

무료

Stage and commit changes using conventional commits format

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

Chemaclass/bashdep192026년 10월 20일 업데이트

Coverage gap analysis for the bashdep public API plus a bashdep::doctor audit

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

Chemaclass/bashdep192026년 10월 20일 업데이트

gh-issue

무료

Fetch a GitHub issue, create a branch, plan and implement with TDD, then open a PR

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

Chemaclass/bashdep192026년 10월 20일 업데이트

pr

무료

Push branch and create a GitHub PR following the bashdep PR template

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

Chemaclass/bashdep192026년 10월 20일 업데이트

Run a comprehensive pre-release validation checklist for bashdep

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

Chemaclass/bashdep192026년 10월 20일 업데이트

Chemaclass의 스킬 모두 보기

이 스킬의 문제 신고