diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 8d5de4f3571..1dc534b7a45 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -93,3 +93,9 @@ jobs: env: GH_TOKEN: ${{github.token}} if: steps.release.outputs.release_created + + distcheck-macos: + runs-on: macos-latest + steps: + - uses: actions/checkout@v4 + - run: env PYTESTFLAGS="--verbose -p no:cacheprovider --color=yes" test/macos-script.sh diff --git a/test/macos-script.sh b/test/macos-script.sh new file mode 100755 index 00000000000..6cc067e4149 --- /dev/null +++ b/test/macos-script.sh @@ -0,0 +1,26 @@ +#!/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 + +oldpwd=$(pwd) + +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}" diff --git a/test/t/conftest.py b/test/t/conftest.py index 8d38d873990..bbd6b1abb36 100644 --- a/test/t/conftest.py +++ b/test/t/conftest.py @@ -951,7 +951,9 @@ def prepare_fixture_dir( the tarball. This is to work better with case insensitive file systems. """ tempdir = Path(tempfile.mkdtemp(prefix="bash-completion-fixture-dir")) - request.addfinalizer(lambda: shutil.rmtree(str(tempdir))) + request.addfinalizer( + lambda: shutil.rmtree(str(tempdir), ignore_errors=True) + ) old_cwd = os.getcwd() try: diff --git a/test/t/test_make.py b/test/t/test_make.py index 34fc7e5906a..49cbae749d0 100644 --- a/test/t/test_make.py +++ b/test/t/test_make.py @@ -12,12 +12,22 @@ def test_1(self, completion): @pytest.mark.complete("make .", cwd="make", require_cmd=True) def test_2(self, bash, completion): + import glob + + print(f"Files in {bash.cwd}/make") + for filename in glob.iglob(f"{bash.cwd}/make/**/*", recursive=True): + print(filename) """Hidden targets.""" assert completion == ".cache/ .test_passes".split() os.remove(f"{bash.cwd}/make/extra_makefile") @pytest.mark.complete("make .cache/", cwd="make", require_cmd=True) def test_3(self, bash, completion): + import glob + + print(f"Files in {bash.cwd}/make") + for filename in glob.iglob(f"{bash.cwd}/make/**/*", recursive=True): + print(filename) assert completion == ".cache/1 .cache/2".split() os.remove(f"{bash.cwd}/make/extra_makefile") @@ -31,6 +41,11 @@ def test_5(self, completion): @pytest.mark.complete("make ", cwd="make", require_cmd=True) def test_6(self, bash, completion): + import glob + + print(f"Files in {bash.cwd}/make") + for filename in glob.iglob(f"{bash.cwd}/make/**/*", recursive=True): + print(filename) assert completion == "all clean extra_makefile install sample".split() os.remove(f"{bash.cwd}/make/extra_makefile")