Skip to content

Conversation

@julio-lopez
Copy link
Collaborator

Ref:

Ref:
- Subset of the changes proposed by @NathanBaulch in kopia#4972
@julio-lopez julio-lopez changed the title chore(general): use contexts in tests chore(ci): use contexts in tests Nov 19, 2025
@codecov
Copy link

codecov bot commented Nov 19, 2025

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 78.02%. Comparing base (cb455c6) to head (b85ec40).
⚠️ Report is 771 commits behind head on master.

Files with missing lines Patch % Lines
internal/editor/editor.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5009      +/-   ##
==========================================
+ Coverage   75.86%   78.02%   +2.16%     
==========================================
  Files         470      548      +78     
  Lines       37301    31398    -5903     
==========================================
- Hits        28299    24499    -3800     
+ Misses       7071     4850    -2221     
- Partials     1931     2049     +118     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@julio-lopez julio-lopez requested a review from Copilot November 19, 2025 01:42
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates multiple test files to use context-aware command execution, replacing exec.Command with exec.CommandContext and net.Listen/net.Dial with their context-aware equivalents. This change aligns with Go best practices for cancellable operations and proper resource cleanup in tests.

Key changes:

  • Introduces testlogging.Context(t) to create test contexts
  • Replaces exec.Command with exec.CommandContext across test files
  • Updates network operations to use context-aware methods

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/tools/fio/fio.go Uses context.Background() for FIO command execution
tests/testenv/cli_exe_runner.go Uses existing ctx parameter for CLI command execution
tests/socketactivation_test/socketactivation_test.go Creates test context and uses it for network listeners
tests/recovery/recovery_test/recovery_test.go Creates test context and uses it for multiple command executions
repo/blob/sftp/sftp_storage_test.go Creates test context for command execution and network dialing
repo/blob/rclone/rclone_storage_test.go Creates test context for rclone command executions
internal/editor/editor.go Uses existing ctx parameter for editor command execution

@julio-lopez julio-lopez marked this pull request as ready for review November 19, 2025 01:47
@julio-lopez julio-lopez merged commit 7586b21 into kopia:master Nov 19, 2025
27 of 28 checks passed
@julio-lopez julio-lopez deleted the poc/ctx-tests branch November 19, 2025 01:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant