From 2d1b652c6285760f9e0eeb9563a81321f8027cf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Mon, 31 May 2021 23:13:02 +0300 Subject: [PATCH 1/8] test: add macOS test script --- test/macos-script.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 test/macos-script.sh diff --git a/test/macos-script.sh b/test/macos-script.sh new file mode 100755 index 00000000000..d1480312fce --- /dev/null +++ b/test/macos-script.sh @@ -0,0 +1,22 @@ +#!/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 pip install -r test/requirements.txt + +export bashcomp_bash=bash +env + +autoreconf -i +./configure +make -j + +make distcheck \ + PYTESTFLAGS="${PYTESTFLAGS---verbose --numprocesses=auto --dist=loadfile}" +cp -p bash-completion-*.tar.* "$oldpwd/" From 327d48254ddade551d5a31fe5320529601b1f896 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Thu, 4 Apr 2024 21:46:12 +0000 Subject: [PATCH 2/8] TO BE REWORKED BEFORE MERGE: temporary macOS CI test config This is an interim hack to remove things from CI config unrelated to beating the test suite into shape on macOS, for a bit faster turnaround. To be cleaned up and properly integrated to check.yaml before merge. --- .github/workflows/ci.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index cf31610386c..3db371525ca 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -8,6 +8,7 @@ on: jobs: pre-commit: + if: false runs-on: ubuntu-latest steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 @@ -38,6 +39,7 @@ jobs: pre-commit run --color=always --all-files --show-diff-on-failure distcheck: + if: false runs-on: ubuntu-latest strategy: matrix: @@ -92,3 +94,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 test/macos-script.sh From a7037a353b326a465f63575735b6c3d8323d5da7 Mon Sep 17 00:00:00 2001 From: Yedaya Katsman Date: Mon, 24 Feb 2025 22:27:11 +0200 Subject: [PATCH 3/8] ci: Remove if:false --- .github/workflows/ci.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 3db371525ca..263b5a68ac8 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -8,7 +8,6 @@ on: jobs: pre-commit: - if: false runs-on: ubuntu-latest steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 @@ -39,7 +38,6 @@ jobs: pre-commit run --color=always --all-files --show-diff-on-failure distcheck: - if: false runs-on: ubuntu-latest strategy: matrix: From c7b69d731146be03a63c1ece66466dbbcd030b97 Mon Sep 17 00:00:00 2001 From: Yedaya Katsman Date: Mon, 24 Feb 2025 22:36:34 +0200 Subject: [PATCH 4/8] ci: Align macos script with current linux --- .github/workflows/ci.yaml | 2 +- test/macos-script.sh | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 263b5a68ac8..8d86873a210 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -97,4 +97,4 @@ jobs: runs-on: macos-latest steps: - uses: actions/checkout@v4 - - run: env PYTESTFLAGS=--verbose test/macos-script.sh + - run: env PYTESTFLAGS="--verbose -p no:cacheprovider" test/macos-script.sh diff --git a/test/macos-script.sh b/test/macos-script.sh index d1480312fce..7f7ad13bcd2 100755 --- a/test/macos-script.sh +++ b/test/macos-script.sh @@ -10,6 +10,10 @@ brew install \ python3 -m pip install -r test/requirements.txt +oldpwd=$(pwd) +cp -a . /work +cd /work + export bashcomp_bash=bash env @@ -18,5 +22,5 @@ autoreconf -i make -j make distcheck \ - PYTESTFLAGS="${PYTESTFLAGS---verbose --numprocesses=auto --dist=loadfile}" + PYTESTFLAGS="${PYTESTFLAGS---verbose -p no:cacheprovider --numprocesses=auto --dist=loadfile}" cp -p bash-completion-*.tar.* "$oldpwd/" From dbc73e7c4905532dfb600ea483277e5a5a95069d Mon Sep 17 00:00:00 2001 From: Yedaya Katsman Date: Mon, 24 Feb 2025 22:43:21 +0200 Subject: [PATCH 5/8] ci(macos): Use venv instead of global install MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit brew/python doesn't like installing python packages globally: ``` error: externally-managed-environment × This environment is externally managed ``` --- test/macos-script.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/macos-script.sh b/test/macos-script.sh index 7f7ad13bcd2..527759594e1 100755 --- a/test/macos-script.sh +++ b/test/macos-script.sh @@ -8,12 +8,15 @@ brew install \ automake \ bash -python3 -m pip install -r test/requirements.txt - oldpwd=$(pwd) cp -a . /work cd /work +python3 -m venv venv +#shellcheck disable=SC1091 +source venv/bin/activate +python3 -m pip install -r test/requirements.txt + export bashcomp_bash=bash env From bab0610deb2239ea36d5e3c1146e86d14b9d1fb7 Mon Sep 17 00:00:00 2001 From: Yedaya Katsman Date: Mon, 24 Feb 2025 22:46:12 +0200 Subject: [PATCH 6/8] ci: Don't move to /work --- test/macos-script.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/test/macos-script.sh b/test/macos-script.sh index 527759594e1..6cc067e4149 100755 --- a/test/macos-script.sh +++ b/test/macos-script.sh @@ -9,8 +9,6 @@ brew install \ bash oldpwd=$(pwd) -cp -a . /work -cd /work python3 -m venv venv #shellcheck disable=SC1091 @@ -26,4 +24,3 @@ make -j make distcheck \ PYTESTFLAGS="${PYTESTFLAGS---verbose -p no:cacheprovider --numprocesses=auto --dist=loadfile}" -cp -p bash-completion-*.tar.* "$oldpwd/" From cb917eaa68b6ce4082298ebdf56905b15853628e Mon Sep 17 00:00:00 2001 From: Yedaya Katsman Date: Tue, 25 Feb 2025 21:30:50 +0200 Subject: [PATCH 7/8] ci(macos): Force colored output --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 8d86873a210..f9d4d4d8092 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -97,4 +97,4 @@ jobs: runs-on: macos-latest steps: - uses: actions/checkout@v4 - - run: env PYTESTFLAGS="--verbose -p no:cacheprovider" test/macos-script.sh + - run: env PYTESTFLAGS="--verbose -p no:cacheprovider --color=yes" test/macos-script.sh From b95731c8acde1c48d8a138ad97175ae29764f2ad Mon Sep 17 00:00:00 2001 From: Yedaya Katsman Date: Tue, 25 Feb 2025 21:37:49 +0200 Subject: [PATCH 8/8] REMOVE BEFORE MERGE: ignore errors for rmtree --- test/t/conftest.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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: