Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add wrapper to execute shell commands #261

Merged

Conversation

achawla2012
Copy link
Contributor

@achawla2012 achawla2012 commented Mar 16, 2023

Proposed changes

  • Add ability to simulate execute commands behavior , allowing us to simulate their behavior in test environment.
  • Updated tested to use the wrapper

Checklist

Before creating a PR, run through this checklist and mark each as complete.

  • I have read the CONTRIBUTING document
  • I have run make install-tools and have attached any dependency changes to this pull request
  • If applicable, I have added tests that prove my fix is effective or that my feature works
  • If applicable, I have checked that any relevant tests pass after adding my changes
  • If applicable, I have updated any relevant documentation (README.md)
  • If applicable, I have tested my cross-platform changes on Ubuntu 22, Redhat 8, SUSE 15 and FreeBSD 13

@netlify
Copy link

netlify bot commented Mar 16, 2023

Deploy Preview for agent-public-docs canceled.

Name Link
🔨 Latest commit 0e93bb3
🔍 Latest deploy log https://app.netlify.com/sites/agent-public-docs/deploys/641c8a4a3f0bf7000731a1bc

@github-actions github-actions bot added chore Pull requests for routine tasks dependencies documentation Improvements or additions to documentation labels Mar 16, 2023
@achawla2012 achawla2012 marked this pull request as ready for review March 16, 2023 18:36
src/core/environment.go Outdated Show resolved Hide resolved
src/core/environment.go Outdated Show resolved Hide resolved
Copy link
Contributor

@ryepup ryepup left a comment

Choose a reason for hiding this comment

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

LGTM, although I don't understand why anything besides environment.go and environment_test.go is changing here.

@@ -654,15 +654,31 @@ func processorCache(item cpu.InfoStat) map[string]string {
return cache
}

type Shell interface {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: recommend having doc comments on all exported symbols

Suggested change
type Shell interface {
// Shell runs child processes, exists to enable testing.
type Shell interface {

@oliveromahony
Copy link
Contributor

Waiting on testing from @craigell

@oliveromahony oliveromahony merged commit 05ac303 into nginx:main Mar 29, 2023
@dhurley dhurley removed documentation Improvements or additions to documentation dependencies labels Apr 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Pull requests for routine tasks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants