test: add godog BDD suite and fuzz targets (#16)#25
Merged
Conversation
Adds the BDD contract layer and two fuzz targets:
* tests/bdd/bdd_test.go — godog entry with Strict: true, build
tag bdd, mirrors axonops/mask verbatim.
* tests/bdd/steps/steps.go — step defs; per-scenario World
carried through context.WithValue, fresh instance per
scenario via sc.Before. Type assertion in worldFrom is
guarded with a comma-ok panic message per the project's
no-unguarded-assertions rule.
* tests/bdd/features/syncmap.feature — one Feature with 15
Rule blocks and 37 scenarios covering every public symbol
plus a concurrent Store scenario. No @wip/@skip/@pending
tags.
* syncmap_fuzz_test.go — FuzzLoadStore (round-trip invariant)
and FuzzConcurrent (4 goroutines over the fuzz bytes; race-
clean, no ordering assertions).
* .github/workflows/ci.yml — bdd-strict-mode-guard job ported
verbatim from mask.
* go.mod/go.sum — github.com/cucumber/godog v0.15.1.
All 37 BDD scenarios pass under -race -tags bdd. Fuzz smoke green
over 1s at 75k+ and 22k+ executions respectively. Coverage remains
at 100%.
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.
Summary
Closes Phase 4 by landing the BDD contract and fuzz layer. Mirrors
axonops/mask's godog scaffolding and addsFuzzLoadStore+FuzzConcurrentfor randomised input coverage.Closes #16.
What's in this PR
tests/bdd/bdd_test.goStrict: true(mask template verbatim)tests/bdd/steps/steps.gocontext.WithValue; guarded type assertion inworldFromtests/bdd/features/syncmap.featuresyncmap_fuzz_test.goFuzzLoadStore(round-trip) andFuzzConcurrent(4 goroutines, race-clean).github/workflows/ci.ymlbdd-strict-mode-guardjob added (mask verbatim)go.mod/go.sumgithub.com/cucumber/godog v0.15.1+ transitivesScenario coverage
Per
Rule: Load ×3, Store ×2, LoadOrStore ×3, LoadAndDelete ×3, Delete ×3, Swap ×3, Clear ×2, Range ×3, Len ×2, Map ×1, Keys ×2, Values ×2, CompareAndSwap ×4, CompareAndDelete ×3, Concurrency ×1 = 37 scenarios.Local validation
Agent gates
bdd-strict-mode-guardjob is only useful once the feature file + entry land (no split value).newparam rename →from/to; removed unusedWorld.err).worldFromtype assertion; fixed with comma-ok + explicit panic message.Deferrals
tests/bdd/— docs: add README, CHANGELOG, NOTICE, SECURITY, and LLM docs bundle #17.Test plan
BDD strict mode guardincluded)testjob (run implicitly viago testwhen-fuzzis not set — they run as unit tests)