Repository navigation
Skip generation when zero calls were captured; document sbt 2's cached test task - #136
Merged
Merged
Conversation
…put (#135) With zero captured calls BaklavaGenerate used to hand the formatters an empty list, overwriting a previously generated spec with an empty stub. Under sbt 2 this happens on every warm-cache 'sbt test' run, since the incremental test task restores a cached result without running tests while the Tests.Cleanup generation hook still fires. Generation now skips the formatters when no calls were captured, leaving existing output intact and printing a warning that points sbt 2 users at testFull. Docs gain a prominent sbt 2 warning everywhere 'sbt test' is prescribed for generation. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #135.
Problem
Baklava generation runs as a post-
testside effect (Tests.Cleanup). It formatted whatever serialized calls were intarget/baklava/calls/— even zero — and overwrote the previous output. Under sbt 2, baretestis an incremental task cached in a global store (~/.cache/sbt/v2) that survivesclean; on a warm cache it runs 0 tests (exit 0) while the cleanup hook still fires, so a completeopenapi.ymlgot replaced by an empty stub. Reported downstream in madrileno-dev/madrileno#113 / fixed on their side in madrileno-dev/madrileno#114 by switching totestFull, with the structural fix explicitly left to Baklava.Changes
BaklavaGenerate): when zero calls were captured, skip the formatters entirely — existing output stays intact — and print a warning explaining the likely cause and pointing sbt 2 users attestFull. Serialized-call cleanup is also skipped in that case (there is nothing to clean). Covered by a newBaklavaGenerateSpec(guard skips formatters + warns; non-empty path still runs formatters).sbt testis prescribed for generation (README, intro, installation, output-formats): usesbt testFullfor complete documentation, because incrementaltestmay run a subset or nothing and the output only covers tests that actually ran.A partial incremental run (subset of the suite) still produces a partial spec — that can't be detected mechanically (partial output via
testOnlyis a feature), so it's covered by the documentation warning only.Verification
sbt +core/testgreen on Scala 2.13.18 (53 tests) and 3.3.7 (60 tests);core/scalafmtCheckAllclean.🤖 Generated with Claude Code