From b68029f6cc25e4e0c8342b5c628e8be34d861a5e Mon Sep 17 00:00:00 2001 From: "Michael Kavulich, Jr" Date: Thu, 22 Feb 2024 17:20:49 +0000 Subject: [PATCH 1/9] Test python for all repositories, not just main one --- .github/workflows/python.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index c630c438..0a05138d 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -22,7 +22,6 @@ jobs: pip install flake8 pytest if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - name: Test with pytest - if: github.repository == 'NCAR/ccpp-framework' # Only run on main repo run: | export PYTHONPATH=$(pwd)/scripts:$(pwd)/scripts/parse_tools pytest From e9f08cb90923e772d8dc3fd3fa5c3325df264336 Mon Sep 17 00:00:00 2001 From: "Michael Kavulich, Jr" Date: Thu, 22 Feb 2024 17:22:16 +0000 Subject: [PATCH 2/9] Update python version and other workflow tags to hopefully fix failure --- .github/workflows/python.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 0a05138d..b659d621 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -8,12 +8,12 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.7] + python-version: [3.10] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - name: Install dependencies From 71621c9a14f961dad3bb02f5e8d26df8214f4396 Mon Sep 17 00:00:00 2001 From: "Michael Kavulich, Jr" Date: Thu, 22 Feb 2024 17:27:12 +0000 Subject: [PATCH 3/9] Fix python versions for both tests (test 3.8 - 3.11) --- .github/workflows/prebuild.yaml | 5 ++--- .github/workflows/python.yaml | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/prebuild.yaml b/.github/workflows/prebuild.yaml index 80e34608..97436b69 100644 --- a/.github/workflows/prebuild.yaml +++ b/.github/workflows/prebuild.yaml @@ -1,7 +1,6 @@ name: ccpp-prebuild -on: - pull_request: +on: [push] concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} @@ -17,7 +16,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.10"] + python-version: ["3.8","3.9","3.10","3.11"] steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index b659d621..c1953cba 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.10] + python-version: ["3.8","3.9","3.10","3.11"] steps: - uses: actions/checkout@v4 From fd1196efcebb3998f440d4f2654c9c083a9212b0 Mon Sep 17 00:00:00 2001 From: "Michael Kavulich, Jr" Date: Thu, 22 Feb 2024 23:14:59 +0000 Subject: [PATCH 4/9] Testing theory about pytest failure --- {test_prebuild => tests}/test_blocked_data/CMakeLists.txt | 0 {test_prebuild => tests}/test_blocked_data/README.md | 0 .../test_blocked_data/blocked_data_scheme.F90 | 0 .../test_blocked_data/blocked_data_scheme.meta | 0 .../test_blocked_data/ccpp_prebuild_config.py | 0 {test_prebuild => tests}/test_blocked_data/data.F90 | 0 {test_prebuild => tests}/test_blocked_data/data.meta | 0 {test_prebuild => tests}/test_blocked_data/main.F90 | 0 .../test_blocked_data/suite_blocked_data_suite.xml | 0 {test_prebuild => tests}/test_metadata_parser.py | 0 {test_prebuild => tests}/test_mkstatic.py | 0 11 files changed, 0 insertions(+), 0 deletions(-) rename {test_prebuild => tests}/test_blocked_data/CMakeLists.txt (100%) rename {test_prebuild => tests}/test_blocked_data/README.md (100%) rename {test_prebuild => tests}/test_blocked_data/blocked_data_scheme.F90 (100%) rename {test_prebuild => tests}/test_blocked_data/blocked_data_scheme.meta (100%) rename {test_prebuild => tests}/test_blocked_data/ccpp_prebuild_config.py (100%) rename {test_prebuild => tests}/test_blocked_data/data.F90 (100%) rename {test_prebuild => tests}/test_blocked_data/data.meta (100%) rename {test_prebuild => tests}/test_blocked_data/main.F90 (100%) rename {test_prebuild => tests}/test_blocked_data/suite_blocked_data_suite.xml (100%) rename {test_prebuild => tests}/test_metadata_parser.py (100%) rename {test_prebuild => tests}/test_mkstatic.py (100%) diff --git a/test_prebuild/test_blocked_data/CMakeLists.txt b/tests/test_blocked_data/CMakeLists.txt similarity index 100% rename from test_prebuild/test_blocked_data/CMakeLists.txt rename to tests/test_blocked_data/CMakeLists.txt diff --git a/test_prebuild/test_blocked_data/README.md b/tests/test_blocked_data/README.md similarity index 100% rename from test_prebuild/test_blocked_data/README.md rename to tests/test_blocked_data/README.md diff --git a/test_prebuild/test_blocked_data/blocked_data_scheme.F90 b/tests/test_blocked_data/blocked_data_scheme.F90 similarity index 100% rename from test_prebuild/test_blocked_data/blocked_data_scheme.F90 rename to tests/test_blocked_data/blocked_data_scheme.F90 diff --git a/test_prebuild/test_blocked_data/blocked_data_scheme.meta b/tests/test_blocked_data/blocked_data_scheme.meta similarity index 100% rename from test_prebuild/test_blocked_data/blocked_data_scheme.meta rename to tests/test_blocked_data/blocked_data_scheme.meta diff --git a/test_prebuild/test_blocked_data/ccpp_prebuild_config.py b/tests/test_blocked_data/ccpp_prebuild_config.py similarity index 100% rename from test_prebuild/test_blocked_data/ccpp_prebuild_config.py rename to tests/test_blocked_data/ccpp_prebuild_config.py diff --git a/test_prebuild/test_blocked_data/data.F90 b/tests/test_blocked_data/data.F90 similarity index 100% rename from test_prebuild/test_blocked_data/data.F90 rename to tests/test_blocked_data/data.F90 diff --git a/test_prebuild/test_blocked_data/data.meta b/tests/test_blocked_data/data.meta similarity index 100% rename from test_prebuild/test_blocked_data/data.meta rename to tests/test_blocked_data/data.meta diff --git a/test_prebuild/test_blocked_data/main.F90 b/tests/test_blocked_data/main.F90 similarity index 100% rename from test_prebuild/test_blocked_data/main.F90 rename to tests/test_blocked_data/main.F90 diff --git a/test_prebuild/test_blocked_data/suite_blocked_data_suite.xml b/tests/test_blocked_data/suite_blocked_data_suite.xml similarity index 100% rename from test_prebuild/test_blocked_data/suite_blocked_data_suite.xml rename to tests/test_blocked_data/suite_blocked_data_suite.xml diff --git a/test_prebuild/test_metadata_parser.py b/tests/test_metadata_parser.py similarity index 100% rename from test_prebuild/test_metadata_parser.py rename to tests/test_metadata_parser.py diff --git a/test_prebuild/test_mkstatic.py b/tests/test_mkstatic.py similarity index 100% rename from test_prebuild/test_mkstatic.py rename to tests/test_mkstatic.py From ffafd69b19a640a2e82705c39c9926322aa5686d Mon Sep 17 00:00:00 2001 From: "Michael Kavulich, Jr" Date: Thu, 22 Feb 2024 23:19:48 +0000 Subject: [PATCH 5/9] Theory confirmed! --- {tests => test_prebuild}/test_blocked_data/CMakeLists.txt | 0 {tests => test_prebuild}/test_blocked_data/README.md | 0 .../test_blocked_data/blocked_data_scheme.F90 | 0 .../test_blocked_data/blocked_data_scheme.meta | 0 .../test_blocked_data/ccpp_prebuild_config.py | 0 {tests => test_prebuild}/test_blocked_data/data.F90 | 0 {tests => test_prebuild}/test_blocked_data/data.meta | 0 {tests => test_prebuild}/test_blocked_data/main.F90 | 0 .../test_blocked_data/suite_blocked_data_suite.xml | 0 {tests => test_prebuild}/test_metadata_parser.py | 0 {tests => test_prebuild}/test_mkstatic.py | 0 11 files changed, 0 insertions(+), 0 deletions(-) rename {tests => test_prebuild}/test_blocked_data/CMakeLists.txt (100%) rename {tests => test_prebuild}/test_blocked_data/README.md (100%) rename {tests => test_prebuild}/test_blocked_data/blocked_data_scheme.F90 (100%) rename {tests => test_prebuild}/test_blocked_data/blocked_data_scheme.meta (100%) rename {tests => test_prebuild}/test_blocked_data/ccpp_prebuild_config.py (100%) rename {tests => test_prebuild}/test_blocked_data/data.F90 (100%) rename {tests => test_prebuild}/test_blocked_data/data.meta (100%) rename {tests => test_prebuild}/test_blocked_data/main.F90 (100%) rename {tests => test_prebuild}/test_blocked_data/suite_blocked_data_suite.xml (100%) rename {tests => test_prebuild}/test_metadata_parser.py (100%) rename {tests => test_prebuild}/test_mkstatic.py (100%) diff --git a/tests/test_blocked_data/CMakeLists.txt b/test_prebuild/test_blocked_data/CMakeLists.txt similarity index 100% rename from tests/test_blocked_data/CMakeLists.txt rename to test_prebuild/test_blocked_data/CMakeLists.txt diff --git a/tests/test_blocked_data/README.md b/test_prebuild/test_blocked_data/README.md similarity index 100% rename from tests/test_blocked_data/README.md rename to test_prebuild/test_blocked_data/README.md diff --git a/tests/test_blocked_data/blocked_data_scheme.F90 b/test_prebuild/test_blocked_data/blocked_data_scheme.F90 similarity index 100% rename from tests/test_blocked_data/blocked_data_scheme.F90 rename to test_prebuild/test_blocked_data/blocked_data_scheme.F90 diff --git a/tests/test_blocked_data/blocked_data_scheme.meta b/test_prebuild/test_blocked_data/blocked_data_scheme.meta similarity index 100% rename from tests/test_blocked_data/blocked_data_scheme.meta rename to test_prebuild/test_blocked_data/blocked_data_scheme.meta diff --git a/tests/test_blocked_data/ccpp_prebuild_config.py b/test_prebuild/test_blocked_data/ccpp_prebuild_config.py similarity index 100% rename from tests/test_blocked_data/ccpp_prebuild_config.py rename to test_prebuild/test_blocked_data/ccpp_prebuild_config.py diff --git a/tests/test_blocked_data/data.F90 b/test_prebuild/test_blocked_data/data.F90 similarity index 100% rename from tests/test_blocked_data/data.F90 rename to test_prebuild/test_blocked_data/data.F90 diff --git a/tests/test_blocked_data/data.meta b/test_prebuild/test_blocked_data/data.meta similarity index 100% rename from tests/test_blocked_data/data.meta rename to test_prebuild/test_blocked_data/data.meta diff --git a/tests/test_blocked_data/main.F90 b/test_prebuild/test_blocked_data/main.F90 similarity index 100% rename from tests/test_blocked_data/main.F90 rename to test_prebuild/test_blocked_data/main.F90 diff --git a/tests/test_blocked_data/suite_blocked_data_suite.xml b/test_prebuild/test_blocked_data/suite_blocked_data_suite.xml similarity index 100% rename from tests/test_blocked_data/suite_blocked_data_suite.xml rename to test_prebuild/test_blocked_data/suite_blocked_data_suite.xml diff --git a/tests/test_metadata_parser.py b/test_prebuild/test_metadata_parser.py similarity index 100% rename from tests/test_metadata_parser.py rename to test_prebuild/test_metadata_parser.py diff --git a/tests/test_mkstatic.py b/test_prebuild/test_mkstatic.py similarity index 100% rename from tests/test_mkstatic.py rename to test_prebuild/test_mkstatic.py From e193508709872b7faa1f7f6b1cfd72ccd286cb9a Mon Sep 17 00:00:00 2001 From: "Michael Kavulich, Jr" Date: Thu, 22 Feb 2024 23:38:00 +0000 Subject: [PATCH 6/9] Okay, from what I can tell, python.yaml should be deprecated, and prebuild.yaml needs to be updated to run pytest on the test scripts rather than running them directly --- .github/workflows/prebuild.yaml | 3 +-- .github/workflows/python.yaml | 27 --------------------------- 2 files changed, 1 insertion(+), 29 deletions(-) delete mode 100644 .github/workflows/python.yaml diff --git a/.github/workflows/prebuild.yaml b/.github/workflows/prebuild.yaml index 97436b69..72666d29 100644 --- a/.github/workflows/prebuild.yaml +++ b/.github/workflows/prebuild.yaml @@ -34,8 +34,7 @@ jobs: run: | export PYTHONPATH=$(pwd)/scripts:$(pwd)/scripts/parse_tools cd test_prebuild - python3 test_metadata_parser.py - python3 test_mkstatic.py + pytest - name: ccpp-prebuild blocked data tests run: | cd test_prebuild/test_blocked_data diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml deleted file mode 100644 index c1953cba..00000000 --- a/.github/workflows/python.yaml +++ /dev/null @@ -1,27 +0,0 @@ -name: Python package - -on: [push] - -jobs: - build: - - runs-on: ubuntu-latest - strategy: - matrix: - python-version: ["3.8","3.9","3.10","3.11"] - - steps: - - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install flake8 pytest - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - - name: Test with pytest - run: | - export PYTHONPATH=$(pwd)/scripts:$(pwd)/scripts/parse_tools - pytest From bddce895d0dfcb44b479e76f8b2adce26f98c397 Mon Sep 17 00:00:00 2001 From: "Michael Kavulich, Jr" Date: Thu, 22 Feb 2024 23:39:13 +0000 Subject: [PATCH 7/9] Run Python 3.12 because why not?? --- .github/workflows/prebuild.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/prebuild.yaml b/.github/workflows/prebuild.yaml index 72666d29..4b117760 100644 --- a/.github/workflows/prebuild.yaml +++ b/.github/workflows/prebuild.yaml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.8","3.9","3.10","3.11"] + python-version: ["3.8","3.9","3.10","3.11","3.12"] steps: - uses: actions/checkout@v4 From a57ed3d8eedd873c66ea18aab550bdbf3242aa4a Mon Sep 17 00:00:00 2001 From: "Michael Kavulich, Jr" Date: Fri, 23 Feb 2024 00:56:01 +0000 Subject: [PATCH 8/9] Removing now-unused pytest.ini --- pytest.ini | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 pytest.ini diff --git a/pytest.ini b/pytest.ini deleted file mode 100644 index 83323d6a..00000000 --- a/pytest.ini +++ /dev/null @@ -1,4 +0,0 @@ -[pytest] -addopts = -ra -q --ignore=tests/test_capgen.py -testpaths = - tests \ No newline at end of file From 8d75fa16c98ffe9511de7443e969b8107ba5fc85 Mon Sep 17 00:00:00 2001 From: "Michael Kavulich, Jr" Date: Fri, 23 Feb 2024 01:03:20 +0000 Subject: [PATCH 9/9] Restore "pull request" rule now that all the kinks are sorted out --- .github/workflows/prebuild.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/prebuild.yaml b/.github/workflows/prebuild.yaml index 4b117760..3f8085fb 100644 --- a/.github/workflows/prebuild.yaml +++ b/.github/workflows/prebuild.yaml @@ -1,6 +1,7 @@ name: ccpp-prebuild -on: [push] +on: + pull_request: concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}