From 9ff5e66ce96d9445166c8fab180efdec569dab45 Mon Sep 17 00:00:00 2001 From: Daniel Berge Sollien Date: Wed, 1 Nov 2023 14:32:21 +0100 Subject: [PATCH 01/14] Fix tests --- tests/test_functions.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/test_functions.py b/tests/test_functions.py index 3e47e56d..a029d5d0 100644 --- a/tests/test_functions.py +++ b/tests/test_functions.py @@ -30,7 +30,6 @@ def test_submodules_dict(): """Test generation of submodule list""" sublist, submods = _define_submodules() - print(sublist, submods) LOGGER.info(submods) assert isinstance(sublist, tuple) assert isinstance(submods, dict) @@ -126,7 +125,7 @@ def test_export_results_w_options(tmp_path, submod="summary"): CHECK_DICT = { "global_variables_w_eclpath.yml": { "nrdatafile": 1, - "nrsubmods": 17, + "nrsubmods": 3, "nroptions": 1, "arrow": True, }, @@ -257,7 +256,6 @@ def test_convert_to_arrow(): } ) dframe["DATE"] = dframe["DATE"].astype("datetime64[ms]") - print(dframe.dtypes) table = convert_to_arrow(dframe) assert isinstance(table, pa.Table), "Did not convert to table" From b9730c83ad3ea21b90b502087f23011690704e96 Mon Sep 17 00:00:00 2001 From: Daniel Berge Sollien Date: Wed, 1 Nov 2023 14:33:06 +0100 Subject: [PATCH 02/14] Add running of tests with github actions --- .github/workflows/run_tests.yaml | 51 ++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/workflows/run_tests.yaml diff --git a/.github/workflows/run_tests.yaml b/.github/workflows/run_tests.yaml new file mode 100644 index 00000000..7aa3af5e --- /dev/null +++ b/.github/workflows/run_tests.yaml @@ -0,0 +1,51 @@ +name: Build and test fmu-sumo-uploader + +on: + pull_request: + branches: [main] + schedule: + - cron: "5 5 * * *" + +jobs: + build_pywheels: + name: PY ${{ matrix.python-version }} on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + python-version: ["3.8", "3.9", "3.10", "3.11"] + os: [ubuntu-latest, windows-latest] + permissions: + contents: read + id-token: write + + steps: + - uses: actions/checkout@v3 + + - name: Azure Login + uses: Azure/login@v1 + with: + client-id: f96c150d-cacf-4257-9cc9-54b2c68ec4ce + tenant-id: 3aa4a235-b6e2-48d5-9195-7fcf05b459b0 + subscription-id: 87897772-fb27-495f-ae40-486a2df57baa + + - name: Set up Python + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + + - name: Install fmu-sumo-sim2sumo + run: > + python -m pip install --upgrade pip && + python -m pip install . + - name: Run tests + shell: bash + run: | + az --version + az account list + pip show sumo-wrapper-python + python -c 'import sys; print(sys.platform)' + python -c 'import os; import sys; print(os.path.dirname(sys.executable))' + access_token=$(az account get-access-token --scope api://88d2b022-3539-4dda-9e66-853801334a86/.default --query accessToken --output tsv) + export ACCESS_TOKEN=$access_token + + pytest -s --timeout=300 From 9efa94446c6b8c4d97279eebb7b137a19386784d Mon Sep 17 00:00:00 2001 From: Daniel Berge Sollien Date: Wed, 1 Nov 2023 14:57:26 +0100 Subject: [PATCH 03/14] Pip install fmu-sumo-uploader from git --- .github/workflows/run_tests.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/run_tests.yaml b/.github/workflows/run_tests.yaml index 7aa3af5e..0887cc87 100644 --- a/.github/workflows/run_tests.yaml +++ b/.github/workflows/run_tests.yaml @@ -37,12 +37,14 @@ jobs: run: > python -m pip install --upgrade pip && python -m pip install . + python -m pip install git+https://github.com/equinor/fmu-sumo-uploader.git@main - name: Run tests shell: bash run: | az --version az account list pip show sumo-wrapper-python + pip show fmu-sumo-uploader python -c 'import sys; print(sys.platform)' python -c 'import os; import sys; print(os.path.dirname(sys.executable))' access_token=$(az account get-access-token --scope api://88d2b022-3539-4dda-9e66-853801334a86/.default --query accessToken --output tsv) From 780ca793dba62f9f7a9399f59eaf3731d411d394 Mon Sep 17 00:00:00 2001 From: Daniel Berge Sollien Date: Wed, 1 Nov 2023 15:07:01 +0100 Subject: [PATCH 04/14] Remove && --- .github/workflows/run_tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run_tests.yaml b/.github/workflows/run_tests.yaml index 0887cc87..1ec7ab5c 100644 --- a/.github/workflows/run_tests.yaml +++ b/.github/workflows/run_tests.yaml @@ -35,7 +35,7 @@ jobs: - name: Install fmu-sumo-sim2sumo run: > - python -m pip install --upgrade pip && + python -m pip install --upgrade pip python -m pip install . python -m pip install git+https://github.com/equinor/fmu-sumo-uploader.git@main - name: Run tests From 182c62253c4d2280cf8cd13b4ea5a5b6d91e66e1 Mon Sep 17 00:00:00 2001 From: Daniel Berge Sollien Date: Wed, 1 Nov 2023 15:10:58 +0100 Subject: [PATCH 05/14] Add sufficient &&'s --- .github/workflows/run_tests.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run_tests.yaml b/.github/workflows/run_tests.yaml index 1ec7ab5c..1a3ec344 100644 --- a/.github/workflows/run_tests.yaml +++ b/.github/workflows/run_tests.yaml @@ -35,8 +35,8 @@ jobs: - name: Install fmu-sumo-sim2sumo run: > - python -m pip install --upgrade pip - python -m pip install . + python -m pip install --upgrade pip && + python -m pip install . && python -m pip install git+https://github.com/equinor/fmu-sumo-uploader.git@main - name: Run tests shell: bash From 5a96d54560569fcff9ce92bdbdb590b8f90d7b99 Mon Sep 17 00:00:00 2001 From: Daniel Berge Sollien Date: Wed, 1 Nov 2023 15:14:33 +0100 Subject: [PATCH 06/14] Move uploader up in install --- .github/workflows/run_tests.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run_tests.yaml b/.github/workflows/run_tests.yaml index 1a3ec344..10834b65 100644 --- a/.github/workflows/run_tests.yaml +++ b/.github/workflows/run_tests.yaml @@ -36,8 +36,8 @@ jobs: - name: Install fmu-sumo-sim2sumo run: > python -m pip install --upgrade pip && - python -m pip install . && - python -m pip install git+https://github.com/equinor/fmu-sumo-uploader.git@main + python -m pip install git+https://github.com/equinor/fmu-sumo-uploader.git@main && + python -m pip install . - name: Run tests shell: bash run: | From 89701d802aaad44db77f3651dc17b2cde17cf6db Mon Sep 17 00:00:00 2001 From: Daniel Berge Sollien Date: Wed, 1 Nov 2023 15:18:45 +0100 Subject: [PATCH 07/14] Add install of pytest --- .github/workflows/run_tests.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/run_tests.yaml b/.github/workflows/run_tests.yaml index 10834b65..2adbe39c 100644 --- a/.github/workflows/run_tests.yaml +++ b/.github/workflows/run_tests.yaml @@ -13,7 +13,7 @@ jobs: strategy: matrix: python-version: ["3.8", "3.9", "3.10", "3.11"] - os: [ubuntu-latest, windows-latest] + os: [ubuntu-latest] permissions: contents: read id-token: write @@ -37,6 +37,7 @@ jobs: run: > python -m pip install --upgrade pip && python -m pip install git+https://github.com/equinor/fmu-sumo-uploader.git@main && + python -m pip install pytest && python -m pip install . - name: Run tests shell: bash From 58a1b88ca03b91946a18e1c23b230ec90f47dd62 Mon Sep 17 00:00:00 2001 From: Daniel Berge Sollien Date: Wed, 1 Nov 2023 15:28:26 +0100 Subject: [PATCH 08/14] Add install of pytest-timeout --- .github/workflows/run_tests.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/run_tests.yaml b/.github/workflows/run_tests.yaml index 2adbe39c..8672b3d0 100644 --- a/.github/workflows/run_tests.yaml +++ b/.github/workflows/run_tests.yaml @@ -38,6 +38,7 @@ jobs: python -m pip install --upgrade pip && python -m pip install git+https://github.com/equinor/fmu-sumo-uploader.git@main && python -m pip install pytest && + python -m pip install pytest-timeout && python -m pip install . - name: Run tests shell: bash @@ -51,4 +52,4 @@ jobs: access_token=$(az account get-access-token --scope api://88d2b022-3539-4dda-9e66-853801334a86/.default --query accessToken --output tsv) export ACCESS_TOKEN=$access_token - pytest -s --timeout=300 + pytest -s -v --timeout=300 From a9e0eca1124e976b531a9da8c133cbddc0922506 Mon Sep 17 00:00:00 2001 From: Daniel Berge Sollien Date: Wed, 1 Nov 2023 15:35:13 +0100 Subject: [PATCH 09/14] Add opm as requirement --- setup.cfg | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.cfg b/setup.cfg index f16f5951..8bd15d26 100644 --- a/setup.cfg +++ b/setup.cfg @@ -37,6 +37,7 @@ python_requires = >=3.8 install_requires = urllib3 <2.0 ert + opm ecl2df fmu-sumo-uploader fmu-dataio From 00770f72a5d4b70faa681dfe9d984be467faf508 Mon Sep 17 00:00:00 2001 From: Daniel Berge Sollien Date: Wed, 1 Nov 2023 15:53:19 +0100 Subject: [PATCH 10/14] Add install of opm from github --- .github/workflows/run_tests.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/run_tests.yaml b/.github/workflows/run_tests.yaml index 8672b3d0..c11260a6 100644 --- a/.github/workflows/run_tests.yaml +++ b/.github/workflows/run_tests.yaml @@ -37,6 +37,7 @@ jobs: run: > python -m pip install --upgrade pip && python -m pip install git+https://github.com/equinor/fmu-sumo-uploader.git@main && + python -m pip install git+https://github.com/OPM/opm-common.git@main && python -m pip install pytest && python -m pip install pytest-timeout && python -m pip install . From 8a67dec6cea2d6f00c1800e388597c477f5ef5e9 Mon Sep 17 00:00:00 2001 From: Daniel Berge Sollien Date: Wed, 1 Nov 2023 15:56:35 +0100 Subject: [PATCH 11/14] Move from main -> master --- .github/workflows/run_tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run_tests.yaml b/.github/workflows/run_tests.yaml index c11260a6..5763cdea 100644 --- a/.github/workflows/run_tests.yaml +++ b/.github/workflows/run_tests.yaml @@ -37,7 +37,7 @@ jobs: run: > python -m pip install --upgrade pip && python -m pip install git+https://github.com/equinor/fmu-sumo-uploader.git@main && - python -m pip install git+https://github.com/OPM/opm-common.git@main && + python -m pip install git+https://github.com/OPM/opm-common.git@master && python -m pip install pytest && python -m pip install pytest-timeout && python -m pip install . From fec9cc45312ee8af0b6748610bc4a12336cd68c3 Mon Sep 17 00:00:00 2001 From: Daniel Berge Sollien Date: Wed, 1 Nov 2023 16:05:31 +0100 Subject: [PATCH 12/14] Move from > to |, install opm differently --- .github/workflows/run_tests.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/run_tests.yaml b/.github/workflows/run_tests.yaml index 5763cdea..5e79fa77 100644 --- a/.github/workflows/run_tests.yaml +++ b/.github/workflows/run_tests.yaml @@ -34,12 +34,12 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install fmu-sumo-sim2sumo - run: > - python -m pip install --upgrade pip && - python -m pip install git+https://github.com/equinor/fmu-sumo-uploader.git@main && - python -m pip install git+https://github.com/OPM/opm-common.git@master && - python -m pip install pytest && - python -m pip install pytest-timeout && + run: | + python -m pip install opm + python -m pip install --upgrade pip + python -m pip install git+https://github.com/equinor/fmu-sumo-uploader.git@main + python -m pip install pytest + python -m pip install pytest-timeout python -m pip install . - name: Run tests shell: bash From d5679c4259bc0a111d04bb9b547de2981a610601 Mon Sep 17 00:00:00 2001 From: Daniel Berge Sollien Date: Wed, 1 Nov 2023 16:38:06 +0100 Subject: [PATCH 13/14] Remove tests on 3.11 --- .github/workflows/run_tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run_tests.yaml b/.github/workflows/run_tests.yaml index 5e79fa77..1dbe2497 100644 --- a/.github/workflows/run_tests.yaml +++ b/.github/workflows/run_tests.yaml @@ -12,7 +12,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - python-version: ["3.8", "3.9", "3.10", "3.11"] + python-version: ["3.8", "3.9", "3.10"] os: [ubuntu-latest] permissions: contents: read From a1fd157d627de4fccab69576e8bbadec6e710c74 Mon Sep 17 00:00:00 2001 From: Daniel Berge Sollien Date: Thu, 2 Nov 2023 10:02:35 +0100 Subject: [PATCH 14/14] Install fmu-dataio from github --- .github/workflows/run_tests.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/run_tests.yaml b/.github/workflows/run_tests.yaml index 1dbe2497..77325541 100644 --- a/.github/workflows/run_tests.yaml +++ b/.github/workflows/run_tests.yaml @@ -35,9 +35,10 @@ jobs: - name: Install fmu-sumo-sim2sumo run: | - python -m pip install opm python -m pip install --upgrade pip + python -m pip install opm python -m pip install git+https://github.com/equinor/fmu-sumo-uploader.git@main + python -m pip install git+https://github.com/equinor/fmu-dataio.git@main python -m pip install pytest python -m pip install pytest-timeout python -m pip install .