Skip to content
Draft
8 changes: 8 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,11 @@ jobs:
GH_TOKEN: ${{github.token}}
RELEASE_PLEASE_TAG_NAME: ${{steps.release.outputs.tag_name}}
if: steps.release.outputs.release_created

distcheck-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false
- run: env PYTESTFLAGS="--verbose -p no:cacheprovider --color=yes" test/macos-script.sh
Copy link
Owner

Choose a reason for hiding this comment

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

Just to confirm, is --color=yes needed here? We don't seem to add it in Linux envs, but do get color nevertheless.

24 changes: 24 additions & 0 deletions test/macos-script.sh
Copy link
Owner

Choose a reason for hiding this comment

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

No that strong opinions, but perhaps we could take a look if it would become more messier than it's good for if we'd combine this with test/docker/entrypoint.sh with appropriate conditionals to avoid duplicating a bunch of things.

Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/sh -eux

# Note that this script is intended to be run only in throwaway environments;
# it may install undesirable things to system locations (if it succeeds in
# that).

brew install \
automake \
bash

python3 -m venv venv
#shellcheck disable=SC1091
source venv/bin/activate
python3 -m pip install -r test/requirements.txt

export bashcomp_bash=bash
env

autoreconf -i
./configure
make -j

make distcheck \
PYTESTFLAGS="${PYTESTFLAGS---verbose -p no:cacheprovider --numprocesses=auto --dist=loadfile}"
2 changes: 1 addition & 1 deletion test/t/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,7 @@ def startswith(self, prefix: str) -> bool:
return self.output.startswith(prefix)

def _items(self) -> List[str]:
return [x.strip() for x in self.output.strip().splitlines()]
return [x.strip() for x in self.output.strip().splitlines() if x]

def __eq__(self, expected: object) -> bool:
"""
Expand Down
2 changes: 1 addition & 1 deletion test/t/test_tar.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def test_24(self, completion):

# Test compression detection of gnu style options
@pytest.mark.complete("tar --extract --xz --file ", cwd="tar")
def test_25(self, completion):
def test_25(self, completion, gnu_tar):
assert completion == "archive.tar.xz dir/ dir2/".split()

# TODO: "tar tf escape.tar a/b"
7 changes: 1 addition & 6 deletions test/t/test_vipw.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
import sys

import pytest


class TestVipw:
@pytest.mark.complete("vipw -", require_cmd=True)
def test_1(self, completion):
if sys.platform == "darwin":
assert not completion # takes no options
else:
assert completion
assert completion
2 changes: 2 additions & 0 deletions test/t/unit/test_unit_dequote.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ def test_5_brace(self, bash, functions):
assert output.strip() == "<a1><a2><a3>"

def test_6_glob(self, bash, functions):
LC_out = assert_bash_exec(bash, "env | grep LC_", want_output=True)
print(f"LC_ vars:\n\n{LC_out}\n")
output = assert_bash_exec(bash, "__tester 'a?b'", want_output=True)
assert output.strip() == "<a b><a$b><a&b><a'b>"

Expand Down
19 changes: 10 additions & 9 deletions test/t/unit/test_unit_load.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import shutil

import pytest

Expand All @@ -24,15 +25,15 @@ def fixture_dir(self, request, bash):
set up symbolic links.
"""

tmpdir = prepare_fixture_dir(request, files=[], dirs=[])
assert_bash_exec(bash, "cp -R %s/* %s/" % (os.getcwd(), tmpdir))
assert_bash_exec(bash, "mkdir -p %s/bin" % tmpdir)
assert_bash_exec(
bash, "ln -sf ../prefix1/bin/cmd1 %s/bin/cmd1" % tmpdir
)
assert_bash_exec(
bash, "ln -sf ../prefix1/sbin/cmd2 %s/bin/cmd2" % tmpdir
)
tmpdir = prepare_fixture_dir(request, files=[], dirs=["bin"])
try:
shutil.copytree(os.getcwd(), str(tmpdir), dirs_exist_ok=True)
except TypeError: # For python <= 3.7
from distutils import dir_util # type: ignore[import-not-found]

dir_util.copy_tree(os.getcwd(), str(tmpdir))
os.symlink("../prefix1/bin/cmd1", f"{tmpdir}/bin/cmd1")
os.symlink("../prefix1/sbin/cmd2", f"{tmpdir}/bin/cmd2")
return str(tmpdir)

def test_userdir_1(self, bash, fixture_dir):
Expand Down
Loading