From 82bfd8e66e0ec220612a2b3e101c5c676035a2c5 Mon Sep 17 00:00:00 2001 From: Norwid Behrnd Date: Tue, 12 Nov 2024 17:54:15 +0100 Subject: [PATCH 1/3] test(pytest.ini): correct a functional typo Because it is `markers` and not `Markers`, the earlier version caused `pytest` to issue a warning. Signed-off-by: Norwid Behrnd --- pytest.ini | 2 +- test_generator.org | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pytest.ini b/pytest.ini index 8f466c6..1bd280b 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,5 +1,5 @@ [pytest] -Markers = +markers = default: appendfilename's default string insertions prepend: appendfilename's optional -p/--prepend flag smart: appendfilename's optional --smart-prepend flag diff --git a/test_generator.org b/test_generator.org index 282aac6..fc94086 100755 --- a/test_generator.org +++ b/test_generator.org @@ -140,7 +140,7 @@ pytest-3 test_appendfilename.py -m "default and prepend" -v #+begin_src shell :tangle pytest.ini [pytest] -Markers = +markers = default: appendfilename's default string insertions prepend: appendfilename's optional -p/--prepend flag smart: appendfilename's optional --smart-prepend flag From f79abfe06298eec70da2f8e47c872d27fd577ab0 Mon Sep 17 00:00:00 2001 From: Norwid Behrnd Date: Tue, 12 Nov 2024 18:06:24 +0100 Subject: [PATCH 2/3] test: correct pytest regex, test_smart_prepend The regex condition did not match the pattern previously established by Karl Voit -- erroneously, it would fail on the 30th and 31st of each relevant month expressed with the short date stamp (YYMMDD) of date2name. Signed-off-by: Norwid Behrnd --- test_appendfilename.py | 2 +- test_generator.org | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test_appendfilename.py b/test_appendfilename.py index e930c07..a680818 100755 --- a/test_appendfilename.py +++ b/test_appendfilename.py @@ -283,7 +283,7 @@ def test_smart_prepend(arg1, arg2, arg3): old_filename_no_timestamp = old_filename[8:] # pattern `--short` # currently fails - elif re.search(r"^\d{4}[012]\d[012]\d", old_filename): + elif re.search(r"^\d{4}[012]\d[0-3]\d", old_filename): time_stamp = old_filename[:6] time_stamp_separator = old_filename[6] old_filename_no_timestamp = old_filename[7:] diff --git a/test_generator.org b/test_generator.org index fc94086..fe27ac8 100755 --- a/test_generator.org +++ b/test_generator.org @@ -467,7 +467,7 @@ def test_smart_prepend(arg1, arg2, arg3): old_filename_no_timestamp = old_filename[8:] # pattern `--short` # currently fails - elif re.search(r"^\d{4}[012]\d[012]\d", old_filename): + elif re.search(r"^\d{4}[012]\d[0-3]\d", old_filename): time_stamp = old_filename[:6] time_stamp_separator = old_filename[6] old_filename_no_timestamp = old_filename[7:] From 3b8493bb62b65808330b8e2a98e4b54dcfbee00d Mon Sep 17 00:00:00 2001 From: Norwid Behrnd Date: Tue, 12 Nov 2024 18:15:59 +0100 Subject: [PATCH 3/3] ci(pytest.yml): adopt matrix syntax of GitHub actions The pytest based testing is redefined adopting tmatrix based syntax GitHub offers. This eases to track which versions of OSes and Python interpreters are engaged, and a format is more compact, than the one used earlier. Inspired/partially copy-pasted from a project related to chemistry.[1] [1] https://github.com/nbehrnd/datawarrior_saturate_Murcko_scaffolds Signed-off-by: Norwid Behrnd --- .github/workflows/pytest.yml | 63 ++++++++---------------------------- 1 file changed, 13 insertions(+), 50 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index c9939f8..02d87d9 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -3,7 +3,7 @@ name: CI_pytest_appendfilename # name : pytest.yml # purpose : regularly run pytest on appendfilename # date : [2024-10-31 Thu] -# edit : [2024-10-31 Thu] +# edit : [2024-11-12 Tue] on: push: @@ -17,9 +17,17 @@ on: # - cron: "0 0 1 * *" # once each 1st of a month, at 00:00 UTC (cf. https://crontab.guru/) jobs: - test-ubuntu-2404: - runs-on: ubuntu-24.04 - timeout-minutes: 5 + test: + strategy: + matrix: + # for a factorial test, an explicit selection of GitHUb runner images + # https://github.com/actions/runner-images?tab=readme-ov-file#available-images + # state of commit 23478d3 as visited on 2024-11-11 Mon + os: [ubuntu-20.04, ubuntu-22.04,ubuntu-24.04, windows-2019, windows-2022, macos-14] + python-version: ["3.10", "3.12"] + runs-on: ${{ matrix.os }} + + timeout-minutes: 5 # Timeout for each job individually steps: - uses: actions/checkout@v4 @@ -28,52 +36,7 @@ jobs: - uses: actions/setup-python@v5 with: - python-version: '3.x' - - - name: Install dependencies with PyPI - run: pip install -r requirements.txt - - - name: run the check by pytest - run: | - python -m pytest -m "default" - python -m pytest -m "prepend" - python -m pytest -m "smart" - - test-windows-2022: - runs-on: windows-2022 - timeout-minutes: 5 - - steps: - - uses: actions/checkout@v4 - # by [2024-10-23 Wed], this version possibly will be considered "old", cf. - # https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/ - - - uses: actions/setup-python@v5 - with: - python-version: '3.x' - - - name: Install dependencies with PyPI - run: pip install -r requirements.txt - - - name: run the check by pytest - run: | - python -m pytest -m "default" - python -m pytest -m "prepend" - python -m pytest -m "smart" - - - test-macos-14: - runs-on: macos-14 - timeout-minutes: 5 - - steps: - - uses: actions/checkout@v4 - # by [2024-10-23 Wed], this version possibly will be considered "old", cf. - # https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/ - - - uses: actions/setup-python@v5 - with: - python-version: '3.x' + python-version: ${{ matrix.python-version }} - name: Install dependencies with PyPI run: pip install -r requirements.txt