Skip to content

Conversation

@sudiptob2
Copy link
Contributor

@sudiptob2 sudiptob2 commented Jun 21, 2025

This PR introduces scripts to automate the setup and cleanup of docker-mac-net-connect for local macOS development environments.

Features

  • Prompt Mac users to install and start the service before running e2e tests.
  • Automatically stop the service afterward. Users will be responsible for stopping the service if needed.
  • Disable via DOCKER_MAC_NET_CONNECT=false.

Covered Logic

  • Skips setup if the application is already installed and running.
  • Supports proxy via HOMEBREW_GOPROXY.

Fixes #6325

@sudiptob2 sudiptob2 force-pushed the test/6325/e23-mac branch from 0e89455 to 110abd4 Compare June 21, 2025 06:03
@codecov
Copy link

codecov bot commented Jun 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 71.09%. Comparing base (268aef8) to head (481174c).
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6368      +/-   ##
==========================================
+ Coverage   71.05%   71.09%   +0.03%     
==========================================
  Files         220      220              
  Lines       37892    37892              
==========================================
+ Hits        26926    26938      +12     
+ Misses       9393     9383      -10     
+ Partials     1573     1571       -2     

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

@sudiptob2 sudiptob2 force-pushed the test/6325/e23-mac branch from 110abd4 to 7882ff4 Compare June 21, 2025 06:36
Comment on lines +17 to +19
is_running() {
brew services info docker-mac-net-connect --json 2>/dev/null | \
jq -e '.[] | .user != null' >/dev/null
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

brew services info docker-mac-net-connect --json provides following output while my testing.

[
  {
    "name": "docker-mac-net-connect",
    "service_name": "homebrew.mxcl.docker-mac-net-connect",
    "running": false,
    "loaded": false,
    "schedulable": false,
    "pid": null,
    "exit_code": null,
    "user": "root",
    "status": "none",
    "file": "/Users/sudiptobaral/Library/LaunchAgents/homebrew.mxcl.docker-mac-net-connect.plist",
    "registered": true,
    "loaded_file": null,
    "command": "/opt/homebrew/opt/docker-mac-net-connect/bin/docker-mac-net-connect",
    "working_dir": null,
    "root_dir": null,
    "log_path": "/opt/homebrew/var/log/docker-mac-net-connect/std_out.log",
    "error_log_path": "/opt/homebrew/var/log/docker-mac-net-connect/std_error.log",
    "interval": null,
    "cron": null
  }
]

During testing, I noticed that "running": false was returned even when docker-mac-net-connect was clearly running. The only reliable indicator I found was the user field:

  • If the service is stopped, the user field is null.
  • If the service is running, the user field is always populated (e.g., "root").

@sudiptob2 sudiptob2 force-pushed the test/6325/e23-mac branch from b23bb6f to d835b00 Compare June 21, 2025 15:55
@sudiptob2 sudiptob2 marked this pull request as ready for review June 21, 2025 17:31
@sudiptob2 sudiptob2 requested a review from a team as a code owner June 21, 2025 17:31
@zirain zirain changed the title test(ci): Install and run docker-mac-net-connect when running e2e on … test(ci): Install and run docker-mac-net-connect when running e2e on macos Jun 22, 2025
@sudiptob2 sudiptob2 force-pushed the test/6325/e23-mac branch 4 times, most recently from 56b9583 to bb08f7e Compare July 1, 2025 18:03
@sudiptob2 sudiptob2 force-pushed the test/6325/e23-mac branch from bb08f7e to fa17030 Compare July 4, 2025 16:12
@arkodg arkodg added this to the v1.5.0-rc.1 Release milestone Jul 9, 2025
@sudiptob2 sudiptob2 force-pushed the test/6325/e23-mac branch from fa17030 to 1aae2a8 Compare July 15, 2025 22:59
Copy link
Contributor

@arkodg arkodg left a comment

Choose a reason for hiding this comment

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

LGTM thanks

@arkodg arkodg requested review from a team July 17, 2025 01:20
@zirain zirain force-pushed the test/6325/e23-mac branch from 1aae2a8 to 481174c Compare July 17, 2025 01:46
@zirain zirain enabled auto-merge (squash) July 17, 2025 01:46
@zirain zirain merged commit 88cec5a into envoyproxy:main Jul 17, 2025
44 of 47 checks passed
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.

Install and run docker-mac-net-connect when running e2e on Mac

3 participants