Repository navigation
refactor: build the boot test's project with the menu's local-build method - #771
Merged
Merged
Conversation
…ethod variant_boot_test.generate() repeated App.test_build_locally()'s three steps by hand: seed the template, write the project files without the workflow, and render a BlueBuild recipe into a Containerfile. The boot test is only meaningful while it builds what the menu builds, and the two copies were compared by nothing. Move the three steps into App.write_local_build_context() and call it from both places. Same calls, same order, same error handling at each caller. A new test pins generate() to that method. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: architect <320561496+danathar-atomic-hive[bot]@users.noreply.github.com>
Contributor
Author
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.
The nightly boot test is meant to build the same project a user gets from the menu's "Test build locally", then boot it. Until now it repeated that menu item's three setup steps by hand rather than calling them. This PR moves the steps into one method that both use. The test can no longer drift away from what users actually build. Nothing changes for users.
What changed
atomic_image_builder.py: newApp.write_local_build_context(context, repo_dir) -> bool. It seeds the template, writes the project files without the workflow, and for BlueBuild renders the recipe into a Containerfile. It returnsFalsewhen that render fails, whichrender_bluebuild_containerfile()has already reported.App.test_build_locally()now calls it in place of the three inline steps.variant_boot_test.py:generate()calls the same method. Its error handling is unchanged: aCommandErrorand a failed render both still become agenerate-stageStageFailurewith the same messages. The module docstring names the method.tests/test_variant_boot_test.py:test_the_project_is_written_by_the_same_method_as_the_menus_local_buildpinsgenerate()toApp.write_local_build_context()and checks the arguments it passes.Why
Closes #770
The boot test (#759) exists so a broken generated project is found by CI, not by a user (#756). That only holds while it builds what the menu builds. With two hand copies of the sequence, a change on the menu's side would leave the nightly test passing against a project the tool no longer writes, and no test compared the copies.
Same calls, same order, same arguments. The only condition that moved is the BlueBuild check:
generate()testedslot.method, the method testsself.config.method, andtest_config()sets the one from the other.Tier 2 under
docs/risk-tiers.md(atomic_image_builder.py).How it was checked
python3 -m unittest discover -s tests: 2606 tests, OK (50 skipped)python3 -m coverage run -m unittest discover -s tests && python3 -m coverage report --fail-under=90: total 99%. The new method's lines are covered.variant_boot_test.pylines 288-289 (theCommandErrorbranch) were already uncovered onmain.ruff check(0.17.0): all checks passedvariant_boot_test.pyreverted tomain(the hand copy) and the rest of this PR kept, the new test fails.Anything a reviewer should look at first
The method name.
write_local_build_contextsays what the menu's local build and the boot test share: the directory podman builds from. The menu-only parts (the podman check,AIB_DISABLE_LOCAL_BUILD, the pauses) stay intest_build_locally().Filed by architect agent (ACMM L6 — full mode)
🤖 Generated with Claude Code
— hive: agent=architect backend=claude model=claude-opus-5-5 effort=high claude=2.1.303