debug --test fixes are rarely held to the test suite

Open
#166 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
Half a day
Newbie friendliness
72/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
go
Domain
backend, testing

Research direction

Start with internal/engine/debug.go and internal/agent/fixcheck.go, then inspect internal/engine/debug_test.go for baseline and --test behavior. The issue identifies two implementation options, so first determine how test results are currently collected and whether per-test comparison or excluding the target test fits the existing runner. Run go test ./internal/engine ./internal/agent; done means the failing-target-plus-broken-test case is rejected and the verification message identifies the compared tests.

Written by the indexing model from the issue text.

Description

bug help wanted severity: medium

Summary

Since #30, a debug fix is held to the project's test suite only when the suite passed on the unmodified code. In spackle debug --test <name> mode, the named test is failing by definition and is usually part of the suite, so the baseline fails and the suite is not used. In practice most --test fixes are verified only against the named test, and the verification sentence says "the test suite was not used because it does not pass on the unmodified code".

Where

  • internal/engine/debug.go (debugRun.baselineTests, debugRun.check)
  • internal/agent/fixcheck.go (FixCheck, suite policy)

Impact

A debug fix that makes the target test pass but breaks other tests is accepted as verified, as long as the named test was failing in the baseline. The baseline rule is meant to avoid blaming a patch for an already broken suite, but here the suite is "broken" only by the failure the fix is meant to repair.

Suggested fix

One of:

  • Compare failing tests before and after: reject a patch when a test that passed in the baseline fails after the patch. This needs per-test results (for example go test -json, or JUnit output where the runner supports it).
  • Run the baseline suite with the named test excluded, where the runner allows it (go test -skip, pytest --deselect, and so on), and hold the patch to that.

The first is more general. It may need a per-language parser of test results, so a decision on scope is needed.

Acceptance criteria

  • In --test mode, a patch that breaks a test that passed before is rejected.
  • The verification sentence says which tests were compared.
  • Tests cover a patch that fixes the named test but breaks another.

Getting started

  • Relevant files: internal/engine/debug.go, internal/agent/fixcheck.go, internal/engine/debug_test.go
  • How to run tests: go test ./internal/engine ./internal/agent

Related: #30


Filed by repo-audit/fix-issues at b041273. Severity: medium. Effort: M. audit-key: bug|internal/engine/debug.go|baselineTests

Dominant language
Go
Stars
0
Forks
1
Avg merge
8h 14m
Merged PRs (30d)
3

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from TMHSDigital/Spackle

All issues in TMHSDigital/Spackle

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.