Skip to content

Added macos tests#10200

Closed
sougata-progress wants to merge 4 commits intomainfrom
sougata/macos_test
Closed

Added macos tests#10200
sougata-progress wants to merge 4 commits intomainfrom
sougata/macos_test

Conversation

@sougata-progress
Copy link
Copy Markdown
Contributor

@sougata-progress sougata-progress commented Feb 9, 2026

Copilot AI review requested due to automatic review settings February 9, 2026 22:48
@netlify
Copy link
Copy Markdown

netlify bot commented Feb 9, 2026

👷 Deploy Preview for chef-habitat processing.

Name Link
🔨 Latest commit 9d47213
🔍 Latest deploy log https://app.netlify.com/projects/chef-habitat/deploys/69957dcba4f1670008b6db37

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

Adds macOS unit-test execution to the Expeditor verify pipeline and updates verify scripts to support macOS by using Homebrew instead of Habitat packages.

Changes:

  • Added macOS unit-test steps for multiple components in the verify pipeline.
  • Updated shared verify script to skip Habitat license acceptance on macOS.
  • Updated cargo test runner to perform platform-specific dependency/toolchain setup for macOS.

Reviewed changes

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

File Description
.expeditor/verify.pipeline.yml Adds macOS unit-test steps to the CI verify pipeline.
.expeditor/scripts/verify/shared.sh Makes license acceptance conditional on OS to support macOS runs.
.expeditor/scripts/verify/run_cargo_test.sh Adds macOS setup path using Homebrew and adjusts protoc/ZMQ configuration by platform.

Comment thread .expeditor/scripts/verify/run_cargo_test.sh Outdated
Comment thread .expeditor/scripts/verify/run_cargo_test.sh Outdated
Comment thread .expeditor/scripts/verify/run_cargo_test.sh Outdated
Comment thread .expeditor/scripts/verify/shared.sh Outdated
Comment thread .expeditor/verify.pipeline.yml
Comment thread .expeditor/verify.pipeline.yml
Comment thread .expeditor/verify.pipeline.yml Outdated
Comment thread .expeditor/verify.pipeline.yml
Copilot AI review requested due to automatic review settings February 10, 2026 07:32
Copy link
Copy Markdown
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

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

Comment thread VERSION
Comment thread CHANGELOG.md
Comment thread CHANGELOG.md
Comment thread .expeditor/verify.pipeline.yml Outdated
@sougata-progress sougata-progress force-pushed the sougata/macos_test branch 2 times, most recently from f212875 to 2e5f7d0 Compare February 10, 2026 08:52
Copilot AI review requested due to automatic review settings February 10, 2026 08:52
Copy link
Copy Markdown
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

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

Comment thread .expeditor/scripts/verify/shared.sh Outdated
Comment thread .expeditor/scripts/verify/run_cargo_test.sh Outdated
Comment thread .expeditor/scripts/verify/run_cargo_test.sh Outdated
Comment thread .expeditor/verify.pipeline.yml Outdated
@sougata-progress sougata-progress marked this pull request as ready for review February 10, 2026 10:38
@sougata-progress sougata-progress requested a review from a team as a code owner February 10, 2026 10:38
@sougata-progress sougata-progress force-pushed the sougata/macos_test branch 2 times, most recently from 8b1ef5f to 60368bf Compare February 10, 2026 11:08
Copilot AI review requested due to automatic review settings February 10, 2026 11:08
Copy link
Copy Markdown
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

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

Comment thread .expeditor/scripts/verify/run_cargo_test.sh Outdated
@sougata-progress sougata-progress marked this pull request as draft February 10, 2026 11:18
Copilot AI review requested due to automatic review settings February 10, 2026 11:39
Copy link
Copy Markdown
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

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

Comment thread .expeditor/scripts/verify/run_cargo_test.sh Outdated
Comment thread .expeditor/scripts/verify/run_cargo_test.sh Outdated
Comment thread .expeditor/scripts/verify/run_cargo_test.sh
Comment thread .expeditor/scripts/verify/shared.sh Outdated
Comment thread .expeditor/verify.pipeline.yml Outdated
Copilot AI review requested due to automatic review settings February 11, 2026 12:57
Copy link
Copy Markdown
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

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

Comment thread .expeditor/scripts/verify/run_cargo_test.sh Outdated
Comment thread .expeditor/scripts/verify/run_cargo_test.sh Outdated
@sougata-progress sougata-progress marked this pull request as ready for review February 11, 2026 14:00
Copilot AI review requested due to automatic review settings February 11, 2026 14:00
Copy link
Copy Markdown
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

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

# TODO: fix this upstream, it looks like it's not saving correctly.
if ${BUILDKITE:-false}; then
# Only do buildkite-agent chown on Linux systems
if ${BUILDKITE:-false} && [[ "$OSTYPE" != "darwin"* ]]; then
Copy link

Copilot AI Feb 16, 2026

Choose a reason for hiding this comment

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

The negation pattern in the OSTYPE check is incorrect. It should use == instead of != to match the pattern used elsewhere in the file (lines 25, 77), or the logic needs to be inverted.

Suggested change
if ${BUILDKITE:-false} && [[ "$OSTYPE" != "darwin"* ]]; then
if ${BUILDKITE:-false} && [[ "$OSTYPE" == "linux"* ]]; then

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
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

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

# This script should contain all shared functions for the verify pipeline

# Set up writable HAB_ROOT_PATH on macOS to avoid read-only filesystem issues
if [[ "$OSTYPE" == darwin* ]]; then
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

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

The OSTYPE check uses darwin* without quotes around the pattern, while other checks in this PR use "darwin"* with quotes (see run_cargo_test.sh lines 20, 25). For consistency with the rest of the codebase and this PR, this should be "darwin"* with quotes.

Suggested change
if [[ "$OSTYPE" == darwin* ]]; then
if [[ "$OSTYPE" == "darwin"* ]]; then

Copilot uses AI. Check for mistakes.
# Create symlinks for the certificate extraction function
temp_bin_dir=$(mktemp -d)
ln -s "${brew_prefix}/bin/gtail" "${temp_bin_dir}/tail"
ln -s "${brew_prefix}/bin/gtar" "${temp_bin_dir}/tar"
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

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

This line has trailing whitespace at the end, which should be removed for consistency with code style.

Suggested change
ln -s "${brew_prefix}/bin/gtar" "${temp_bin_dir}/tar"
ln -s "${brew_prefix}/bin/gtar" "${temp_bin_dir}/tar"

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
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

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

Comment on lines +5 to +12
# Set up writable HAB_ROOT_PATH on macOS BEFORE sourcing shared.sh to avoid read-only filesystem issues
if [[ "$OSTYPE" == "darwin"* ]]; then
export HAB_ROOT_PATH
HAB_ROOT_PATH=$(mktemp -d /tmp/hab-root-XXXXXX)
# Clean up Darwin-specific temp directory on exit
trap 'rm -rf "$HAB_ROOT_PATH"' EXIT

# Set HAB_LICENSE to skip prompts entirely
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

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

The HAB_ROOT_PATH setup code is duplicated between this file and shared.sh (lines 10-14 in shared.sh). This creates a maintenance issue where the same logic exists in two places. Additionally, the code in shared.sh gets sourced after this setup, which may cause the trap cleanup handler to be overridden. Consider removing this block and relying solely on the shared.sh implementation, or move the sourcing of shared.sh to after this block if there's a specific ordering requirement.

Suggested change
# Set up writable HAB_ROOT_PATH on macOS BEFORE sourcing shared.sh to avoid read-only filesystem issues
if [[ "$OSTYPE" == "darwin"* ]]; then
export HAB_ROOT_PATH
HAB_ROOT_PATH=$(mktemp -d /tmp/hab-root-XXXXXX)
# Clean up Darwin-specific temp directory on exit
trap 'rm -rf "$HAB_ROOT_PATH"' EXIT
# Set HAB_LICENSE to skip prompts entirely
# Set HAB_LICENSE on macOS before sourcing shared.sh to skip prompts entirely
if [[ "$OSTYPE" == "darwin"* ]]; then

Copilot uses AI. Check for mistakes.
set -eou pipefail

# Set up writable HAB_ROOT_PATH on macOS BEFORE sourcing shared.sh to avoid read-only filesystem issues
if [[ "$OSTYPE" == "darwin"* ]]; then
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

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

The OSTYPE check pattern is inconsistent within this file. Line 6 uses the pattern "darwin"* (with quotes around darwin) while line 10 uses the same pattern darwin* (without quotes on line 10 in shared.sh). While both may work, this inconsistency could lead to confusion. The pattern on line 31 of this file also uses "darwin"*. For consistency, adopt a single pattern throughout, preferably matching what's used elsewhere in the file.

Copilot uses AI. Check for mistakes.
export HAB_ROOT_PATH
HAB_ROOT_PATH=$(mktemp -d /tmp/hab-root-XXXXXX)
# Clean up Darwin-specific temp directory on exit
trap 'rm -rf "$HAB_ROOT_PATH"' EXIT
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

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

The trap cleanup handler may be overridden when multiple traps are set for the same signal. Since both this file (line 10) and shared.sh (line 14) set a trap for EXIT to clean up HAB_ROOT_PATH, and shared.sh is sourced after this trap is set (line 17), the trap from shared.sh will override this one. This means only one cleanup will occur, which could be problematic if both temporary directories were created. Consider consolidating the trap setup to a single location or using trap additions with the proper trap syntax to chain handlers.

Copilot uses AI. Check for mistakes.
Comment on lines +72 to +81
temp_bin_dir=$(mktemp -d)
ln -s "${brew_prefix}/bin/gtail" "${temp_bin_dir}/tail"
ln -s "${brew_prefix}/bin/gtar" "${temp_bin_dir}/tar"
export PATH="${temp_bin_dir}:$PATH"

macos_use_cert_file_from_linux_cacerts_package

# Restore original PATH and cleanup
export PATH="$original_PATH"
rm -rf "$temp_bin_dir"
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

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

The temporary directory created at line 72 is cleaned up manually at line 81, but if an error occurs between these lines (e.g., during certificate extraction at line 77), the cleanup won't happen due to the set -eou pipefail at the top of the file. Consider adding this directory to a trap handler to ensure it's cleaned up even on error.

Copilot uses AI. Check for mistakes.
Comment thread .expeditor/verify.pipeline.yml Outdated
macos:
os-version: "12"
inherit-environment-vars: true
timeout_in_minutes: 20
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

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

The "[unit] :darwin: core" test step has soft_fail: true (line 627) while the other macOS unit tests (common, hab, http-client) do not. This inconsistency suggests that core tests are expected to fail but should still run. Consider adding a comment explaining why this specific test is allowed to soft fail while others are not, to help future maintainers understand the rationale.

Suggested change
timeout_in_minutes: 20
timeout_in_minutes: 20
# macOS core tests can be flaky / environment-dependent; allow soft failure
# so they still run for signal without failing the entire verify pipeline.

Copilot uses AI. Check for mistakes.
Comment on lines +64 to +82
# Temporarily modify PATH to prioritize GNU tools over BSD tools
brew_prefix=$(brew --prefix)
gnu_coreutils_bin="${brew_prefix}/bin"
gnu_tar_bin="${brew_prefix}/bin"
original_PATH="$PATH"
export PATH="${gnu_coreutils_bin}:${gnu_tar_bin}:$PATH"

# Create symlinks for the certificate extraction function
temp_bin_dir=$(mktemp -d)
ln -s "${brew_prefix}/bin/gtail" "${temp_bin_dir}/tail"
ln -s "${brew_prefix}/bin/gtar" "${temp_bin_dir}/tar"
export PATH="${temp_bin_dir}:$PATH"

macos_use_cert_file_from_linux_cacerts_package

# Restore original PATH and cleanup
export PATH="$original_PATH"
rm -rf "$temp_bin_dir"

Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

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

The approach of creating temporary symlinks and PATH manipulation (lines 72-75) is overly complex and differs from the established pattern. The macos_install_bootstrap_package function already adds /opt/mac-bootstrapper/embedded/bin to the PATH (shared.sh line 388), which provides GNU tail and tar. After calling macos_install_bootstrap_package at line 58, the PATH should already be configured correctly. The symlink creation and PATH juggling is unnecessary and adds complexity. Consider simplifying this by relying on the bootstrap package's PATH setup, which is the pattern used in other scripts like build_mac_hab_binary.sh.

Suggested change
# Temporarily modify PATH to prioritize GNU tools over BSD tools
brew_prefix=$(brew --prefix)
gnu_coreutils_bin="${brew_prefix}/bin"
gnu_tar_bin="${brew_prefix}/bin"
original_PATH="$PATH"
export PATH="${gnu_coreutils_bin}:${gnu_tar_bin}:$PATH"
# Create symlinks for the certificate extraction function
temp_bin_dir=$(mktemp -d)
ln -s "${brew_prefix}/bin/gtail" "${temp_bin_dir}/tail"
ln -s "${brew_prefix}/bin/gtar" "${temp_bin_dir}/tar"
export PATH="${temp_bin_dir}:$PATH"
macos_use_cert_file_from_linux_cacerts_package
# Restore original PATH and cleanup
export PATH="$original_PATH"
rm -rf "$temp_bin_dir"
macos_use_cert_file_from_linux_cacerts_package

Copilot uses AI. Check for mistakes.
Comment thread .expeditor/verify.pipeline.yml Outdated
Comment on lines +599 to +650
- label: "[unit] :darwin: common"
env:
HAB_LICENSE: "accept-no-persist"
HOMEBREW_NO_AUTO_UPDATE: 1
command:
- .expeditor/scripts/verify/run_cargo_test.sh common
expeditor:
executor:
macos:
os-version: "12"
inherit-environment-vars: true
timeout_in_minutes: 20
retry:
automatic:
limit: 1

- label: "[unit] :darwin: core"
env:
HAB_LICENSE: "accept-no-persist"
HOMEBREW_NO_AUTO_UPDATE: 1
command:
- .expeditor/scripts/verify/run_cargo_test.sh core
expeditor:
executor:
macos:
os-version: "12"
inherit-environment-vars: true
timeout_in_minutes: 20
soft_fail: true
retry:
automatic:
limit: 1

- label: "[unit] :darwin: hab"
env:
HAB_LICENSE: "accept-no-persist"
HOMEBREW_NO_AUTO_UPDATE: 1
command:
- .expeditor/scripts/verify/run_cargo_test.sh hab
expeditor:
executor:
macos:
os-version: "12"
inherit-environment-vars: true
timeout_in_minutes: 20
retry:
automatic:
limit: 1

- label: "[unit] :darwin: http-client"
env:
HAB_LICENSE: "accept-no-persist"
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

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

HAB_LICENSE is set redundantly in the step-level env (lines 601, 617, 634, 650) when it's already defined globally at line 10. This creates unnecessary duplication. Consider removing the step-level HAB_LICENSE environment variable definitions and relying on the global setting, which is the pattern used for other environment variables like HAB_BLDR_CHANNEL.

Copilot uses AI. Check for mistakes.
environment:
- HAB_LICENSE
- HAB_AUTH_TOKEN
- HAB_BLDR_CHANNEL
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

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

The lint step has been converted from using expeditor.executor.docker to using the docker plugin with explicit configuration. While this change works, the environment variables passed through (lines 63-66) only include HAB_LICENSE, HAB_AUTH_TOKEN, and HAB_BLDR_CHANNEL. The original executor configuration might have automatically passed through other environment variables defined at the global level (lines 11-13), such as HAB_STUDIO_SECRET_HAB_REFRESH_CHANNEL and HAB_REFRESH_CHANNEL. Verify that these environment variables aren't needed for the lint step, or add them to the environment list if they are.

Suggested change
- HAB_BLDR_CHANNEL
- HAB_BLDR_CHANNEL
- HAB_STUDIO_SECRET_HAB_REFRESH_CHANNEL
- HAB_REFRESH_CHANNEL
- HAB_FALLBACK_CHANNEL
- HAB_STUDIO_SECRET_HAB_FALLBACK_CHANNEL

Copilot uses AI. Check for mistakes.
Copilot AI review requested due to automatic review settings February 17, 2026 09:19
Copy link
Copy Markdown
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

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

Comment thread .expeditor/scripts/verify/shared.sh Outdated
Copy link
Copy Markdown
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

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

Comment thread .expeditor/scripts/verify/run_cargo_test.sh
Comment thread .expeditor/scripts/verify/run_cargo_test.sh
Comment thread .expeditor/verify.pipeline.yml
Comment thread .expeditor/verify.pipeline.yml
Comment thread .expeditor/verify.pipeline.yml
Signed-off-by: sougata-progress <sougatab@progress.com>
Copy link
Copy Markdown
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

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

Comment thread .expeditor/scripts/verify/run_cargo_test.sh
Comment thread .expeditor/scripts/verify/run_cargo_test.sh
Comment thread .expeditor/scripts/verify/run_cargo_test.sh
Comment thread .expeditor/verify.pipeline.yml Outdated
Comment thread .expeditor/verify.pipeline.yml Outdated
Copy link
Copy Markdown
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

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

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

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

Signed-off-by: sougata-progress <sougatab@progress.com>
Copy link
Copy Markdown
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

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

Comment on lines 52 to 71
- label: "[lint] :linux: :paperclip: clippy!"
command: make lint
expeditor:
executor:
docker:
privileged: true
agents:
queue: 'default-privileged'
plugins:
docker#v3.3.0:
always-pull: true
user: "buildkite-agent"
group: "buildkite-agent"
image: "chefes/buildkite"
privileged: true
environment:
- HAB_LICENSE
- HAB_AUTH_TOKEN
- HAB_BLDR_CHANNEL
- HAB_STUDIO_SECRET_HAB_REFRESH_CHANNEL
- HAB_REFRESH_CHANNEL
- HAB_FALLBACK_CHANNEL
- HAB_STUDIO_SECRET_HAB_FALLBACK_CHANNEL
timeout_in_minutes: 10
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

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

The clippy lint step has been significantly refactored from using the expeditor docker executor to using Buildkite's docker plugin directly with explicit agent queue and environment variable configuration. This change is not mentioned in the PR description, which only states "Added macos tests". Consider documenting this infrastructure change in the PR description to explain why this refactoring was necessary and how it relates to the macOS test additions, or split this change into a separate PR if it's unrelated to the macOS tests.

Copilot uses AI. Check for mistakes.
Comment thread .expeditor/scripts/verify/shared.sh
Comment thread .expeditor/scripts/verify/run_clippy.sh Outdated
Copy link
Copy Markdown
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

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

Comment thread .expeditor/verify.pipeline.yml Outdated
Signed-off-by: sougata-progress <sougatab@progress.com>
Copy link
Copy Markdown
Contributor

@agadgil-progress agadgil-progress left a comment

Choose a reason for hiding this comment

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

I have a very high level comment - I should have given this comment before - but somehow it fell through the cracks. Instead of writing a lot of darwin specific logic inside the run_cargo_test.sh (which also caused some logic in the clippy test to be changed also as a side effect, we could start with a separate run_cargo_test-darwin.sh and then use that script to run the component tests. Do you think it's very difficult to make that change?

Some of the changes that are made to clippy etc are becoming difficult to understand/relate.

@sougata-progress
Copy link
Copy Markdown
Contributor Author

sougata-progress commented Feb 20, 2026

fixes merged from this pr

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.

3 participants