Skip to content

Comments

feat: [#576] Add a new Cmd function for Running#1228

Merged
hwbrzzl merged 1 commit intomasterfrom
bowen/#576-3
Oct 15, 2025
Merged

feat: [#576] Add a new Cmd function for Running#1228
hwbrzzl merged 1 commit intomasterfrom
bowen/#576-3

Conversation

@hwbrzzl
Copy link
Contributor

@hwbrzzl hwbrzzl commented Oct 15, 2025

📑 Description

Relate goravel/goravel#576

This pull request adds support for accessing the underlying exec.Cmd instance from the Running process interface and its mock implementations. This enhancement allows consumers to interact directly with the exec.Cmd object, which can be useful for advanced process management or inspection.

API Enhancements:

  • Added a Cmd() method to the Running interface in contracts/process/running.go, allowing retrieval of the underlying *exec.Cmd instance.
  • Implemented the Cmd() method in the concrete Running struct in process/running.go, returning the stored *exec.Cmd.

Testing and Mocking Improvements:

  • Updated the mock Running struct in mocks/process/Running.go to include a mockable Cmd() method, with support for setting expectations and return values for tests.
  • Added os/exec import to the mock file to support the new method.

✅ Checks

  • Added test cases for my code

@hwbrzzl hwbrzzl requested a review from a team as a code owner October 15, 2025 12:22
Copilot AI review requested due to automatic review settings October 15, 2025 12:22
Copy link
Contributor

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 adds a new Cmd() method to the Running interface and its implementation, allowing access to the underlying exec.Cmd instance of a running process. This addresses issue #576 by exposing the command object for external inspection or manipulation.

  • Adds Cmd() method to Running interface contract
  • Implements Cmd() method in running.go to return the underlying exec.Cmd
  • Updates mock implementation with generated mock code for the new method

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
contracts/process/running.go Adds Cmd() method signature to the Running interface with documentation
process/running.go Implements the Cmd() getter method to expose the internal cmd field
mocks/process/Running.go Adds generated mock implementation for the new Cmd() method

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@codecov
Copy link

codecov bot commented Oct 15, 2025

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 66.68%. Comparing base (2cd1634) to head (b5721f2).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
process/running.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1228      +/-   ##
==========================================
- Coverage   66.69%   66.68%   -0.01%     
==========================================
  Files         237      237              
  Lines       15918    15920       +2     
==========================================
  Hits        10617    10617              
- Misses       4933     4935       +2     
  Partials      368      368              

☔ 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.

@hwbrzzl hwbrzzl merged commit 88bdeab into master Oct 15, 2025
12 of 14 checks passed
@hwbrzzl hwbrzzl deleted the bowen/#576-3 branch October 15, 2025 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant