chore(tvc): refactor now-unsafe test code#157
Merged
Conversation
- in Rust 2024 `std::env::set_var` is now unsafe - those tests were not strictly necessary and can be done via the `cmd` approach
- in Rust 2024 `std::env::set_var` is now unsafe - those tests were not strictly necessary and can be done via the `cmd` approach
Contributor
There was a problem hiding this comment.
Pull request overview
Refactors TVC’s non-interactive-mode tests to avoid std::env::set_var/remove_var now being unsafe under Rust 2024, by moving the relevant coverage to CLI-level (process) tests.
Changes:
- Added
tvc deploy createnon-interactive integration tests that assert missing-required-flags behavior and pull-secret placeholder handling. - Removed unit tests and the env-mutation guard (
NonInteractiveGuard) fromdeploy/create.rstests.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tvc/tests/non_interactive.rs | Adds new CLI-driven non-interactive regression tests for deploy create. |
| tvc/src/commands/deploy/create.rs | Removes unit tests that relied on process-wide env mutation (now unsafe in Rust 2024). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
std::env::set_varis now unsafecmdapproach