Skip to content

test(ci): Install and run docker-mac-net-connect when running e2e on macos #6368

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

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
Copy link

codecov bot commented Jun 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.82%. Comparing base (d809446) to head (39631ee).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6368      +/-   ##
==========================================
+ Coverage   70.77%   70.82%   +0.04%     
==========================================
  Files         220      220              
  Lines       37132    37132              
==========================================
+ Hits        26280    26298      +18     
+ Misses       9308     9292      -16     
+ Partials     1544     1542       -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.

@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 from d835b00 to bbd5f1d Compare June 25, 2025 06:24
@sudiptob2 sudiptob2 force-pushed the test/6325/e23-mac branch from bbd5f1d to 39631ee Compare June 25, 2025 15:49
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
1 participant