Fix sporadic test failures in S3BackupService specs by mocking tar compression#235
Merged
stefan-burke merged 2 commits intomainfrom Aug 22, 2025
Merged
Conversation
…king - Mock tar compression to create a compressed file during tests - Replace simple return true with file creation to simulate tar output - Add detailed stubs for system calls related to backup and compression - Improve test reliability by simulating actual file creation in mocks Co-authored-by: terragon-labs[bot] <terragon-labs[bot]@users.noreply.github.com>
…ompression mocking Refactored the S3BackupService spec to introduce a helper method `mock_tar_compression` that mocks the tar compression system call and creates a compressed file. This reduces duplication and improves readability by replacing repeated mocking code with a single reusable method. Co-authored-by: terragon-labs[bot] <terragon-labs[bot]@users.noreply.github.com>
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
S3BackupServicespecs related to tar compression mockingChanges
Test Suite Improvements
s3_backup_service_spec.rbto mock thetar -czfsystem call more realistically:true, the mock now creates a compressed file with dummy content at the expected pathTest plan
S3BackupServicespecs multiple times to confirm elimination of sporadic failures🌿 Generated by Terry
ℹ️ Tag @terragon-labs to ask questions and address PR feedback
📎 Task: https://www.terragonlabs.com/task/18b0a700-56cd-4652-ae1c-c1fb89869257