Testing batch: golden-file YAML test + 7 behavioural coverage findings#392
Merged
Conversation
cloudofficer-admin
approved these changes
May 17, 2026
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 8 of the 9 Medium Testing findings from the deep code review, adding behavioural coverage for failure paths plus a flagship golden-file test for the generator's core output. Three findings carried a small, low-risk production hardening; the rest are pure test additions. Full suite: 338 examples, 0 failures; line coverage 94.6% → 98.5%. RuboCop clean across all 47 files.
Key changes:
spec/ghb/integration/workflow_generation_spec.rbruns the realApplication#executepipeline in an isolated tmpdir against a minimal Ruby fixture and diffs the generated.github/workflows/build.ymlagainst the checked-in golden filespec/fixtures/workflow_generation/build.yml(UPDATE_SNAPSHOTS=1regenerates).GitignoreManagerwraps transientNet::OpenTimeout/ReadTimeout/ECONNRESET/ECONNREFUSED/SocketErrorfrom the gitignore.io fetch into an actionable error; specs cover 503/504 and each network error.RepositoryConfigurator#build_branch_protection_payloadusesfilter_mapso malformed user/team dicts can't yield a[null]list (GitHub 422); spec added.Workflow#readraisesGHB::ConfigErrorwith file context on malformed YAML / non-mapping root instead of a rawPsych::SyntaxError/NoMethodError; specs added.options_specasserts publicoriginal_argvinstead ofinstance_variable_get(:@argv).sleep(1)/(2)/(3)back-off assertion to the API-client retry specs.Application#detect_default_branchunit-tested (success / fallback / explicit master).validate_entriespermissive non-Hash skip documented by tests (plus a guard that Hash entries still validate).Deferred to a separate PR: TEST-001 (collapsing 20
__send__(:private)calls ingitignore_manager_spec) — best done with aGitignoreRulesmodule extraction; collapsing them blindly trades precise failure localisation for purity and risks coverage regressions.Types of changes
Checklist