refactor: [#199] use black-box CLI execution in E2E provision tests #201
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.
📋 Overview
Refactor
src/bin/e2e_provision_and_destroy_tests.rsto be a "real" E2E test that executes the CLI as a black box, similar totests/e2e_create_command.rs.Closes #199
🎯 Goals
⚙️ Changes
Key Changes
Move ProcessRunner to shared location:
tests/support/process_runner.rs→src/testing/black_box/process_runner.rsrun_provision_commandmethod toProcessRunnersrc/testing/mod.rsto exposeblack_boxmoduletests/support/mod.rsto re-exportProcessRunnerfromsrc/testing/black_box(backward compatibility)Refactored Binary:
TestContextusagecommand_handlersimportsProcessRunnerto execute CLI commands:create environment --env-file <generated-config>provision e2e-provisiondestroy e2e-provisionverify_required_dependenciestestingmodule)Design Decisions
Dynamic Config Generation: Static fixture files don't work because Ansible runs from the build directory, requiring absolute paths for SSH keys. Config is generated at runtime with absolute SSH key paths.
Minimal Code Movement: Only moved
ProcessRunnertosrc/testing/black_box/since it's shared betweensrc/bin/andtests/. KeptTempWorkspaceandassertionsintests/support/(local to tests).Exit Code Verification Only: Trust CLI exit codes for now. Future enhancement: use
listcommand to verify environment state.✅ Checklist
./scripts/pre-commit.shcommand_handlersfor logic executiontest-e2e-provision.ymlpasses📁 Files Changed
src/bin/e2e_provision_and_destroy_tests.rs- Major refactor to use black-box CLI executionsrc/testing/black_box/mod.rs- New module for black-box testing utilitiessrc/testing/black_box/process_runner.rs- Moved fromtests/support/src/testing/mod.rs- Exposeblack_boxmoduletests/support/mod.rs- Re-exportProcessRunnerfor backward compatibilitydocs/issues/199-refactor-e2e-provision-and-destroy-tests.md- Updated implementation notes.gitignore- Ignore runtime-generated E2E config filecspell.json- Added project-specific terms