test: fix test isolation issues and improve sandbox testing#1512
Merged
test: fix test isolation issues and improve sandbox testing#1512
Conversation
- Add proper cleanup of Terraform artifacts before and after tests to prevent conflicts - Implement comprehensive sandbox testing framework with component isolation - Move sandbox functionality to testhelpers package to avoid import cycles - Clean up terraform state files, lock files, and backend configs between tests - Ensure tests can run repeatedly without interference from previous runs - Add test coverage for sandbox creation, cleanup, environment variables, and artifact exclusion - Fix all linting issues and reduce cyclomatic complexity - Remove obsolete demo_enhanced_errors.md file 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
|
Warning This PR exceeds the recommended limit of 1,000 lines.Large PRs are difficult to review and may be rejected due to their size. Please verify that this PR does not address multiple issues. |
…orm tests - Fix all sandbox test fixture paths to use correct relative path (../fixtures/) - Add sandbox flag to tests that run terraform commands for better isolation: - atmos-functions.yaml: terraform output tests - exec-command.yaml: terraform plan/apply tests - metadata.yaml: terraform plan test - All sandbox tests now passing - Tests with terraform operations now use isolated component copies 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com)
- Add TestSandboxComponentIsolation to prove sandbox truly isolates components - Creates sandbox and modifies a component file in it - Verifies original component remains unchanged - Proves paths are different and contain sandbox identifier - Add TestSandboxActuallyUsedByAtmos to verify sandbox is properly used - Verifies environment variables point to sandbox temp directory - Creates marker files in sandbox to prove isolation - Lists actual components copied to sandbox (6 items found) - Verifies markers don't appear in original locations These tests conclusively prove the sandbox mechanism works correctly and provides true component isolation for parallel test execution. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Add GetComponentPath() function to handle all path resolution logic - Respect environment variable overrides (ATMOS_COMPONENTS_*_BASE_PATH) - Support custom component paths (e.g., opentofu/, terragrunt/) - Fix sandbox test isolation issues on all platforms - Ensure paths are always absolute and properly cleaned - Add comprehensive tests for path resolution logic This refactor fixes test failures by ensuring that sandbox environment variables correctly override component paths, regardless of the user's configuration or directory structure. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1512 +/- ##
==========================================
+ Coverage 56.98% 57.03% +0.04%
==========================================
Files 284 286 +2
Lines 30292 30587 +295
==========================================
+ Hits 17261 17444 +183
- Misses 11207 11302 +95
- Partials 1824 1841 +17
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
- Modified path construction functions to avoid converting simple test paths to absolute paths - Only use GetComponentPath with absolute conversion when resolved absolute paths are present - Added Windows-specific handling for file permission tests that don't apply on Windows - Fixes test failures on Windows CI while maintaining backward compatibility 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
aknysh
approved these changes
Sep 25, 2025
|
These changes were released in v1.192.0. |
|
These changes were released in v1.193.0-test.1. |
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.
what
why
references
🤖 Generated with Claude Code