From 32c98512eacbb3fa2cb04d9fd3043b189493762b Mon Sep 17 00:00:00 2001 From: Trygve Aspenes Date: Mon, 11 Nov 2024 15:45:00 +0100 Subject: [PATCH 01/29] update --- .github/workflows/pytest.yml | 2 +- test-requirements.txt | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 test-requirements.txt diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 02db741..2255964 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -23,7 +23,7 @@ jobs: - name: Install Dependencies run: | pip install --upgrade pip - pip install -r requirements.txt + pip install -r test-requirements.txt pip install pytest-timeout pip install pytest-cov - name: Run Tests diff --git a/test-requirements.txt b/test-requirements.txt new file mode 100644 index 0000000..ef8062c --- /dev/null +++ b/test-requirements.txt @@ -0,0 +1,12 @@ +python==3.11 +jinja2 +pyyaml +pytest-mock +uvicorn +requests +fastapi +boto3 +rasterio +satpy +mapserver +cmocean From edee6424193492de4fcb904278e6577266791513 Mon Sep 17 00:00:00 2001 From: Trygve Aspenes Date: Mon, 11 Nov 2024 15:47:14 +0100 Subject: [PATCH 02/29] update --- test-requirements.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/test-requirements.txt b/test-requirements.txt index ef8062c..54414d9 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,4 +1,3 @@ -python==3.11 jinja2 pyyaml pytest-mock From 19657e46b8f67382353c982a155a4499f60a1233 Mon Sep 17 00:00:00 2001 From: Trygve Aspenes Date: Mon, 11 Nov 2024 16:01:21 +0100 Subject: [PATCH 03/29] updated to conda-forge --- .github/workflows/pytest.yml | 19 +++++++++++++------ continuous_integration/environment.yaml | 18 ++++++++++++++++++ test-requirements.txt | 11 ----------- 3 files changed, 31 insertions(+), 17 deletions(-) create mode 100644 continuous_integration/environment.yaml delete mode 100644 test-requirements.txt diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 2255964..a78ab53 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -20,12 +20,19 @@ jobs: architecture: x64 - name: Checkout Source uses: actions/checkout@v2 - - name: Install Dependencies - run: | - pip install --upgrade pip - pip install -r test-requirements.txt - pip install pytest-timeout - pip install pytest-cov + - name: Setup Conda Environment + uses: conda-incubator/setup-miniconda@v3 + with: + miniforge-version: latest + python-version: ${{ matrix.python-version }} + activate-environment: test-environment + channels: conda-forge + conda-remove-defaults: true + channel-priority: strict + - name: Update environment + run: mamba env update -n test-environment -f continuous_integration/environment.yaml + if: steps.cache.outputs.cache-hit != 'true' + - name: Run Tests run: python -m pytest -v --cov=./ --cov-report=xml --timeout=60 - name: Upload to Codecov diff --git a/continuous_integration/environment.yaml b/continuous_integration/environment.yaml new file mode 100644 index 0000000..4e86d5f --- /dev/null +++ b/continuous_integration/environment.yaml @@ -0,0 +1,18 @@ +name: test-environment +channels: + - conda-forge +dependencies: + - jinja2 + - pyyaml + - pytest-mock + - uvicorn + - requests + - boto3 + - rasterio + - satpy + - mapserver + - cmocean + - pip: + - pytest-lazy-fixtures + - pytest-timeout + - pytest-cov diff --git a/test-requirements.txt b/test-requirements.txt deleted file mode 100644 index 54414d9..0000000 --- a/test-requirements.txt +++ /dev/null @@ -1,11 +0,0 @@ -jinja2 -pyyaml -pytest-mock -uvicorn -requests -fastapi -boto3 -rasterio -satpy -mapserver -cmocean From 323772f2abb7eb92604d0c0e1360569f89631981 Mon Sep 17 00:00:00 2001 From: Trygve Aspenes Date: Mon, 11 Nov 2024 16:04:16 +0100 Subject: [PATCH 04/29] updated to conda-forge --- continuous_integration/environment.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/continuous_integration/environment.yaml b/continuous_integration/environment.yaml index 4e86d5f..cdadd41 100644 --- a/continuous_integration/environment.yaml +++ b/continuous_integration/environment.yaml @@ -12,7 +12,9 @@ dependencies: - satpy - mapserver - cmocean + - pytest + - pytest-cov + - pip - pip: - pytest-lazy-fixtures - pytest-timeout - - pytest-cov From 3c739a0ce5a7a795946c48c4752e8a5cc2f77faf Mon Sep 17 00:00:00 2001 From: Trygve Aspenes Date: Mon, 11 Nov 2024 16:09:14 +0100 Subject: [PATCH 05/29] updated to conda-forge --- continuous_integration/environment.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/continuous_integration/environment.yaml b/continuous_integration/environment.yaml index cdadd41..90cf5cb 100644 --- a/continuous_integration/environment.yaml +++ b/continuous_integration/environment.yaml @@ -12,9 +12,10 @@ dependencies: - satpy - mapserver - cmocean - - pytest - - pytest-cov - pip - pip: - pytest-lazy-fixtures - pytest-timeout + - pytest + - pytest-cov + \ No newline at end of file From edcac24c3f0dffc41bfcf4cb6bdf0af315759206 Mon Sep 17 00:00:00 2001 From: Trygve Aspenes Date: Mon, 11 Nov 2024 16:11:38 +0100 Subject: [PATCH 06/29] updated to conda-forge --- .github/workflows/pytest.yml | 2 +- continuous_integration/environment.yaml | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index a78ab53..65f5353 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -34,7 +34,7 @@ jobs: if: steps.cache.outputs.cache-hit != 'true' - name: Run Tests - run: python -m pytest -v --cov=./ --cov-report=xml --timeout=60 + run: python3 -m pytest -v --cov=./ --cov-report=xml --timeout=60 - name: Upload to Codecov uses: codecov/codecov-action@v2 with: diff --git a/continuous_integration/environment.yaml b/continuous_integration/environment.yaml index 90cf5cb..cdadd41 100644 --- a/continuous_integration/environment.yaml +++ b/continuous_integration/environment.yaml @@ -12,10 +12,9 @@ dependencies: - satpy - mapserver - cmocean + - pytest + - pytest-cov - pip - pip: - pytest-lazy-fixtures - pytest-timeout - - pytest - - pytest-cov - \ No newline at end of file From f709bfcd179b3a6a24a1deacb8d1c46e27ed61c1 Mon Sep 17 00:00:00 2001 From: Trygve Aspenes Date: Mon, 11 Nov 2024 16:16:36 +0100 Subject: [PATCH 07/29] updated to conda-forge --- continuous_integration/environment.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/continuous_integration/environment.yaml b/continuous_integration/environment.yaml index cdadd41..90cf5cb 100644 --- a/continuous_integration/environment.yaml +++ b/continuous_integration/environment.yaml @@ -12,9 +12,10 @@ dependencies: - satpy - mapserver - cmocean - - pytest - - pytest-cov - pip - pip: - pytest-lazy-fixtures - pytest-timeout + - pytest + - pytest-cov + \ No newline at end of file From 69627973913d79aa7bfce1ab2dd8870ffdb78847 Mon Sep 17 00:00:00 2001 From: Trygve Aspenes Date: Mon, 11 Nov 2024 16:22:57 +0100 Subject: [PATCH 08/29] updated to conda-forge --- .github/workflows/pytest.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 65f5353..ee1aeb0 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -32,9 +32,14 @@ jobs: - name: Update environment run: mamba env update -n test-environment -f continuous_integration/environment.yaml if: steps.cache.outputs.cache-hit != 'true' - + - name: Run unit tests + shell: bash -l {0} + run: | + ls -al; + pwd; + python -v - name: Run Tests - run: python3 -m pytest -v --cov=./ --cov-report=xml --timeout=60 + run: pytest -v --cov=./ --cov-report=xml --timeout=60 - name: Upload to Codecov uses: codecov/codecov-action@v2 with: From 5151e8991057e8a07363d25c8b9a4efae7055d0a Mon Sep 17 00:00:00 2001 From: Trygve Aspenes Date: Tue, 12 Nov 2024 08:34:11 +0100 Subject: [PATCH 09/29] updated to conda-forge --- .github/workflows/pytest.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index ee1aeb0..b3c5e32 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -12,6 +12,10 @@ jobs: matrix: python-version: [3.9, '3.10', '3.11', '3.12'] runs-on: ubuntu-latest + env: + PYTHON_VERSION: ${{ matrix.python-version }} + OS: ${{ matrix.os }} + steps: - name: Python Setup uses: actions/setup-python@v2 @@ -29,6 +33,12 @@ jobs: channels: conda-forge conda-remove-defaults: true channel-priority: strict + - name: Set cache environment variables + shell: bash -l {0} + run: | + echo "DATE=$(date +'%Y%m%d')" >> $GITHUB_ENV + CONDA_PREFIX=$(python -c "import sys; print(sys.prefix)") + echo "CONDA_PREFIX=$CONDA_PREFIX" >> $GITHUB_ENV - name: Update environment run: mamba env update -n test-environment -f continuous_integration/environment.yaml if: steps.cache.outputs.cache-hit != 'true' @@ -37,7 +47,10 @@ jobs: run: | ls -al; pwd; - python -v + python -v; + env; + which python; + which pytest; - name: Run Tests run: pytest -v --cov=./ --cov-report=xml --timeout=60 - name: Upload to Codecov From 1e4873d7353231599112341604e181cc4f706e10 Mon Sep 17 00:00:00 2001 From: Trygve Aspenes Date: Tue, 12 Nov 2024 08:59:19 +0100 Subject: [PATCH 10/29] updated to conda-forge --- .github/workflows/pytest.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index b3c5e32..ee692be 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -52,7 +52,9 @@ jobs: which python; which pytest; - name: Run Tests - run: pytest -v --cov=./ --cov-report=xml --timeout=60 + shell: bash -l {0} + run: | + pytest -v --cov=./ --cov-report=xml --timeout=60 - name: Upload to Codecov uses: codecov/codecov-action@v2 with: From 66fc4039c0e93f5e58c668b7c45794c33fd54d1f Mon Sep 17 00:00:00 2001 From: Trygve Aspenes Date: Tue, 12 Nov 2024 09:03:13 +0100 Subject: [PATCH 11/29] add gdal --- .github/workflows/pytest.yml | 9 --------- continuous_integration/environment.yaml | 1 + 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index ee692be..c0a34ec 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -42,15 +42,6 @@ jobs: - name: Update environment run: mamba env update -n test-environment -f continuous_integration/environment.yaml if: steps.cache.outputs.cache-hit != 'true' - - name: Run unit tests - shell: bash -l {0} - run: | - ls -al; - pwd; - python -v; - env; - which python; - which pytest; - name: Run Tests shell: bash -l {0} run: | diff --git a/continuous_integration/environment.yaml b/continuous_integration/environment.yaml index 90cf5cb..c040789 100644 --- a/continuous_integration/environment.yaml +++ b/continuous_integration/environment.yaml @@ -11,6 +11,7 @@ dependencies: - rasterio - satpy - mapserver + - gdal - cmocean - pip - pip: From 335ecf28890c7265a26437bf7a37603848020a61 Mon Sep 17 00:00:00 2001 From: Trygve Aspenes Date: Tue, 12 Nov 2024 09:06:27 +0100 Subject: [PATCH 12/29] add lxml --- continuous_integration/environment.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/continuous_integration/environment.yaml b/continuous_integration/environment.yaml index c040789..bec1efc 100644 --- a/continuous_integration/environment.yaml +++ b/continuous_integration/environment.yaml @@ -13,6 +13,7 @@ dependencies: - mapserver - gdal - cmocean + - lxml - pip - pip: - pytest-lazy-fixtures From 40a2a77261b06ff8f0353a2aeac2cf33894ae59e Mon Sep 17 00:00:00 2001 From: Trygve Aspenes Date: Tue, 12 Nov 2024 09:11:25 +0100 Subject: [PATCH 13/29] add modules --- continuous_integration/environment.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/continuous_integration/environment.yaml b/continuous_integration/environment.yaml index bec1efc..2c9682f 100644 --- a/continuous_integration/environment.yaml +++ b/continuous_integration/environment.yaml @@ -14,6 +14,9 @@ dependencies: - gdal - cmocean - lxml + - cartopy + - metpy + - pandas - pip - pip: - pytest-lazy-fixtures From 054fbad7f82bcabaf93e38c1535c3b91e5fdb6fc Mon Sep 17 00:00:00 2001 From: Trygve Aspenes Date: Tue, 12 Nov 2024 09:18:47 +0100 Subject: [PATCH 14/29] add modules --- .github/workflows/pytest.yml | 6 ++++++ continuous_integration/environment.yaml | 1 + 2 files changed, 7 insertions(+) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index c0a34ec..2dd7e8d 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -42,6 +42,12 @@ jobs: - name: Update environment run: mamba env update -n test-environment -f continuous_integration/environment.yaml if: steps.cache.outputs.cache-hit != 'true' + + - name: Install mapgen + shell: bash -l {0} + run: | + python -m pip install --no-deps -e . + - name: Run Tests shell: bash -l {0} run: | diff --git a/continuous_integration/environment.yaml b/continuous_integration/environment.yaml index 2c9682f..ce42bcf 100644 --- a/continuous_integration/environment.yaml +++ b/continuous_integration/environment.yaml @@ -23,4 +23,5 @@ dependencies: - pytest-timeout - pytest - pytest-cov + - WebTest \ No newline at end of file From 8e8e7a76a95df8b1cd9d47a93620587c8c27b6f5 Mon Sep 17 00:00:00 2001 From: Trygve Aspenes Date: Tue, 12 Nov 2024 09:34:42 +0100 Subject: [PATCH 15/29] update CSW test --- tests/test_arome_arctic.py | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/tests/test_arome_arctic.py b/tests/test_arome_arctic.py index 96392cf..a690c27 100644 --- a/tests/test_arome_arctic.py +++ b/tests/test_arome_arctic.py @@ -31,12 +31,14 @@ def _create_arome_arctic_dataset_from_orig_data_without_reference_time(): ds_trimmed.to_netcdf("test_arome_arctic_without_forecast_time_20241111T06Z.nc") @patch('mapgen.modules.get_quicklook.find_config_for_this_netcdf') -def test_read_dataset(mock_read_config, tmpdir, caplog): +@patch('mapgen.modules.helpers._find_summary_from_csw') +def test_read_dataset(mock_csw, mock_read_config, tmpdir, caplog): """Test reading the dataset""" netcdf_path = "tests/data/test_arome_arctic.nc" query_string = "" http_host = "localhost" url_scheme = "http" + mock_csw.return_value = "TEST_CSW" mock_read_config.return_value = {'pattern': '^(.*data/test_arome_arctic.nc)$', 'base_netcdf_directory': '.', 'module': 'mapgen.modules.arome_arctic_quicklook', @@ -63,12 +65,14 @@ def test_read_dataset(mock_read_config, tmpdir, caplog): tmpdir.remove() @patch('mapgen.modules.get_quicklook.find_config_for_this_netcdf') -def test_get_quicklook_arome_arctic_no_reference_time(mock_read_config, tmpdir, caplog): +@patch('mapgen.modules.helpers._find_summary_from_csw') +def test_get_quicklook_arome_arctic_no_reference_time(mock_csw, mock_read_config, tmpdir, caplog): """Test for a none existing netcdf file""" netcdf_path = "tests/data/test_arome_arctic_without_forecast_time_20241111T06Z.nc" query_string = "" http_host = "localhost" url_scheme = "http" + mock_csw.return_value = "TEST CSW" mock_read_config.return_value = {'pattern': '^(.*data/test_arome_arctic_without_forecast_time_(\d{8}T\d{2})Z.nc)$', 'base_netcdf_directory': '.', 'module': 'mapgen.modules.arome_arctic_quicklook', @@ -133,7 +137,8 @@ def test_read_dataset_base_path_missing_base(mock_read_config, tmpdir): tmpdir.remove() @patch('mapgen.modules.get_quicklook.find_config_for_this_netcdf') -def test_read_dataset_request_getmap(mock_read_config, tmpdir, caplog): +@patch('mapgen.modules.helpers._find_summary_from_csw') +def test_read_dataset_request_getmap(mock_csw, mock_read_config, tmpdir, caplog): """Test reading the dataset""" netcdf_path = "tests/data/test_arome_arctic.nc" query_string = ("?&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&LAYERS=air_temperature_2m&WIDTH=767&HEIGHT=880&CRS=EPSG%3A3857&" @@ -141,6 +146,7 @@ def test_read_dataset_request_getmap(mock_read_config, tmpdir, caplog): "TRANSPARENT=TRUE&&TIME=2024-11-11T07%3A00%3A00Z") http_host = "localhost" url_scheme = "http" + mock_csw.return_value = "TEST CSW" mock_read_config.return_value = {'pattern': '^(.*data/test_arome_arctic.nc)$', 'base_netcdf_directory': '.', 'module': 'mapgen.modules.arome_arctic_quicklook', @@ -171,7 +177,8 @@ def test_read_dataset_request_getmap(mock_read_config, tmpdir, caplog): tmpdir.remove() @patch('mapgen.modules.get_quicklook.find_config_for_this_netcdf') -def test_read_dataset_request_getmap_contour_style(mock_read_config, tmpdir, caplog): +@patch('mapgen.modules.helpers._find_summary_from_csw') +def test_read_dataset_request_getmap_contour_style(mock_csw, mock_read_config, tmpdir, caplog): """Test reading the dataset""" netcdf_path = "tests/data/test_arome_arctic.nc" query_string = ("?&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&LAYERS=air_temperature_2m&WIDTH=767&HEIGHT=880&CRS=EPSG%3A3857&" @@ -179,6 +186,7 @@ def test_read_dataset_request_getmap_contour_style(mock_read_config, tmpdir, cap "TRANSPARENT=TRUE&&TIME=2024-11-11T07%3A00%3A00Z") http_host = "localhost" url_scheme = "http" + mock_csw.return_value = "TEST CSW" mock_read_config.return_value = {'pattern': '^(.*data/test_arome_arctic.nc)$', 'base_netcdf_directory': '.', 'module': 'mapgen.modules.arome_arctic_quicklook', @@ -199,7 +207,8 @@ def test_read_dataset_request_getmap_contour_style(mock_read_config, tmpdir, cap assert "STYLES: contour" in caplog.text @patch('mapgen.modules.get_quicklook.find_config_for_this_netcdf') -def test_read_dataset_request_getmap_vector_barbs(mock_read_config, tmpdir, caplog): +@patch('mapgen.modules.helpers._find_summary_from_csw') +def test_read_dataset_request_getmap_vector_barbs(mock_csw, mock_read_config, tmpdir, caplog): """Test reading the dataset""" netcdf_path = "tests/data/test_arome_arctic.nc" query_string = ("?&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&LAYERS=wind_10m_vector&WIDTH=767&HEIGHT=880&CRS=EPSG%3A3857&" @@ -207,6 +216,7 @@ def test_read_dataset_request_getmap_vector_barbs(mock_read_config, tmpdir, capl "FORMAT=image/png&TRANSPARENT=TRUE&&TIME=2024-11-11T07%3A00%3A00Z&DIM_SPACING=32&DIM_COLOUR=light-green") http_host = "localhost" url_scheme = "http" + mock_csw.return_value = "TEST CSW" mock_read_config.return_value = {'pattern': '^(.*data/test_arome_arctic.nc)$', 'base_netcdf_directory': '.', 'module': 'mapgen.modules.arome_arctic_quicklook', @@ -225,7 +235,8 @@ def test_read_dataset_request_getmap_vector_barbs(mock_read_config, tmpdir, capl assert 'VECTOR wind_10m_vector x_wind_10m y_wind_10m' in caplog.text @patch('mapgen.modules.get_quicklook.find_config_for_this_netcdf') -def test_read_dataset_request_getmap_vector_vector(mock_read_config, tmpdir, caplog): +@patch('mapgen.modules.helpers._find_summary_from_csw') +def test_read_dataset_request_getmap_vector_vector(mock_csw, mock_read_config, tmpdir, caplog): """Test reading the dataset""" netcdf_path = "tests/data/test_arome_arctic.nc" query_string = ("?&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&LAYERS=wind_10m_vector&WIDTH=767&HEIGHT=880&CRS=EPSG%3A3857&" @@ -233,6 +244,7 @@ def test_read_dataset_request_getmap_vector_vector(mock_read_config, tmpdir, cap "FORMAT=image/png&TRANSPARENT=TRUE&&TIME=2024-11-11T07%3A00%3A00Z&DIM_SPACING=32&DIM_COLOUR=light-green") http_host = "localhost" url_scheme = "http" + mock_csw.return_value = "TEST CSW" mock_read_config.return_value = {'pattern': '^(.*data/test_arome_arctic.nc)$', 'base_netcdf_directory': '.', 'module': 'mapgen.modules.arome_arctic_quicklook', From 552e7cf6cda33518c006e0130e4e510f86af2fe3 Mon Sep 17 00:00:00 2001 From: Trygve Aspenes Date: Tue, 12 Nov 2024 09:43:28 +0100 Subject: [PATCH 16/29] check test data --- .github/workflows/pytest.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 2dd7e8d..3c629d4 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -46,8 +46,10 @@ jobs: - name: Install mapgen shell: bash -l {0} run: | - python -m pip install --no-deps -e . - + python -m pip install --no-deps -e .: + pwd; + ls -al; + ls -al tests/data; - name: Run Tests shell: bash -l {0} run: | From aff71db0f1aa190503183dde0cef267b5949efbb Mon Sep 17 00:00:00 2001 From: Trygve Aspenes Date: Tue, 12 Nov 2024 09:46:01 +0100 Subject: [PATCH 17/29] check test data --- .github/workflows/pytest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 3c629d4..c7a3a1d 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -46,7 +46,7 @@ jobs: - name: Install mapgen shell: bash -l {0} run: | - python -m pip install --no-deps -e .: + python -m pip install --no-deps -e .; pwd; ls -al; ls -al tests/data; From 8819ed0283910c6677611f5bf88b0e254ba8afa7 Mon Sep 17 00:00:00 2001 From: Trygve Aspenes Date: Tue, 12 Nov 2024 10:04:25 +0100 Subject: [PATCH 18/29] More debug --- mapgen/modules/helpers.py | 1 + 1 file changed, 1 insertion(+) diff --git a/mapgen/modules/helpers.py b/mapgen/modules/helpers.py index da2418e..28b6f7c 100644 --- a/mapgen/modules/helpers.py +++ b/mapgen/modules/helpers.py @@ -160,6 +160,7 @@ def handle_request(map_object, full_request): logger.debug("STYLES not in the request. Nothing to reset.") pass try: + logger.debug(f"PWD {os.getcwd()}") map_object.OWSDispatch( ows_req ) except Exception as e: logger.error(f"status_code=500, mapscript fails to parse query parameters: {str(full_request)}, with error: {str(e)}") From 4fd1e6ec89576d4dc3372ebd23a101c8de9ebd2c Mon Sep 17 00:00:00 2001 From: Trygve Aspenes Date: Tue, 12 Nov 2024 10:15:04 +0100 Subject: [PATCH 19/29] cwd --- tests/test_arome_arctic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_arome_arctic.py b/tests/test_arome_arctic.py index a690c27..15fc795 100644 --- a/tests/test_arome_arctic.py +++ b/tests/test_arome_arctic.py @@ -148,7 +148,7 @@ def test_read_dataset_request_getmap(mock_csw, mock_read_config, tmpdir, caplog) url_scheme = "http" mock_csw.return_value = "TEST CSW" mock_read_config.return_value = {'pattern': '^(.*data/test_arome_arctic.nc)$', - 'base_netcdf_directory': '.', + 'base_netcdf_directory': os.getcwd(), 'module': 'mapgen.modules.arome_arctic_quicklook', 'module_function': 'arome_arctic_quicklook', 'mapfile_template': os.path.join(tmpdir, 'test.map'), From d1cb51ad147c6be686bd7b76cd18a90961315036 Mon Sep 17 00:00:00 2001 From: Trygve Aspenes Date: Tue, 12 Nov 2024 10:19:12 +0100 Subject: [PATCH 20/29] debug --- .github/workflows/pytest.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index c7a3a1d..a063770 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -50,6 +50,8 @@ jobs: pwd; ls -al; ls -al tests/data; + mamba list; + pip list; - name: Run Tests shell: bash -l {0} run: | From 554e17418bcf2a9e28cdd1d82d64d396eceacd6e Mon Sep 17 00:00:00 2001 From: Trygve Aspenes Date: Tue, 12 Nov 2024 10:29:16 +0100 Subject: [PATCH 21/29] libgdal --- continuous_integration/environment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/continuous_integration/environment.yaml b/continuous_integration/environment.yaml index ce42bcf..359e06e 100644 --- a/continuous_integration/environment.yaml +++ b/continuous_integration/environment.yaml @@ -11,7 +11,7 @@ dependencies: - rasterio - satpy - mapserver - - gdal + - libgdal - cmocean - lxml - cartopy From 953b1c6531531b03077cb7abbb985048930e8099 Mon Sep 17 00:00:00 2001 From: Trygve Aspenes Date: Tue, 12 Nov 2024 10:31:49 +0100 Subject: [PATCH 22/29] gdal --- continuous_integration/environment.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/continuous_integration/environment.yaml b/continuous_integration/environment.yaml index 359e06e..3c4598c 100644 --- a/continuous_integration/environment.yaml +++ b/continuous_integration/environment.yaml @@ -11,6 +11,7 @@ dependencies: - rasterio - satpy - mapserver + - gdal - libgdal - cmocean - lxml From 117f18fc5df8068bd2855628d060e09918240380 Mon Sep 17 00:00:00 2001 From: Trygve Aspenes Date: Tue, 12 Nov 2024 10:41:48 +0100 Subject: [PATCH 23/29] need robots and favicon for tests --- favicon.ico | Bin 0 -> 15086 bytes robots.txt | 2 ++ 2 files changed, 2 insertions(+) create mode 100644 favicon.ico create mode 100644 robots.txt diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..0a6d3769756a2291e520457933656cbc4cd08982 GIT binary patch literal 15086 zcmeI3ziV7a5XaXj#9bm6E`*Cy;eg#KF6_oesRG7z2)GI+MIeD|o$9&-Ttx1L~eMm;Edm?m+zb?WCpN#Q~d@Tn8nJDCd4&%ym z);8y}>3qae98Y$v!&f5mh8Sn-mg18hHKKmh2|tk4|5mD79ZT<$2-~Sx%;jX}M{;o9 zv*#*DhE8?fo+TsKYxZ2_$fC~7nl5Tz^=r?vufvCYUVc`;sXEIJ?9}#>#hb+wJ!;8X zLX5G^)+Y5OJ#c`Py#q0x8P|K~{(9=%t8M2P8x04Vd*>r|RM;sh&U?3;r z;E&j0ZN&`(a){U))LHz3$S~X~seM&fey9Wf$FWUEbB19YJCT6_o0~S*l*c$Tds?y$ zQFcExjk&U0Rp4!_fcl&>kUhtqc=-neba;Ju@X>lE8!&+dAkK!80hIdMM=auGe`m(16?2+*u z#bk9{HuQAk`r&^WAF{O`D#mWP$p?Fr{1@)s#Ma_BzB|PDMSCZSZ}l(6p7^l+Q=Ega zTmS8tzfvwA?0fS9u`licV#e6JrMOLB_SQd~=L_#)bVYXeEv~)Ahs%$h=j`QL z3^6vkjn2(9c8pIh=8v|9e97*3-0+n#g^zZ z(fIcim-X;J{b(J}Lv`s(=d!3T(r=aLe@b-cdzvp*9I%7wktmBxGO+K7hN4Au*>APF z^U>8y72~4FVu5ce2hD-qbikCwRiayuZZQqTydnBI;+n{zf`=ULCb|>rkkS2B^VxhC zLs+k+7*jdSz!Of1s5^mcj_z&ACUoo3G}DN<(si(&flr)pQP*&>X7hC4R1U2B6n3jl z%)#=l)3qFqWp~?rbior`S?m_KP?sFoKecDI`ESY}b!S?HZzilK?Vuu$v1 zD7~X`Pcz(>2XjWuJrKRoJQSb1R*IW3xTrBdD_9RPW)4|Zztel>tThn^`+1leQ&TXp z2DLqoj)+_=4}4(T`F+!JiSZ2ko}P>Q02>ke!FsK4{=4LgN6#4ciJxstqB*qE?(At;NBY$o4}geI);^b!Rc;+iKIv z8puC=-+JwnwN2}D*XG;e!fyNQQCmK%e!7Ywznu5BZ#(Hva#0N43#>7*T6-VJSGu;H zopFl8dz!PE^I_?;&DIxR(I>ud*nHa@-y*}`=K1ztz;9<~m;GaB9I@K$ANKE_h`rV2 z{_V#Y#A-}^c zsf(!f8YO<&U#;IAEC=~!4br>r(tRX<>D{ySbv5k9V?5TFT5--b&H-Cd>Z`SPmf@Yn zV_bV5@UG|HvhaRDH`>Y$5_-PIbeVI9tS@`#6X z!?0LS(Z~G?F-M(E7mn?}(lfa{6rWyTEx<=Fk;6Pf2VHCy?zvq2Hs^(hv&4Q+1;)Kd zjHxv;blxi5xf+18YpmhRLi#^WV}5)x+~)b<`B@Ks^wa$v_{n!49>7m~Ye(?2?QdVe zhl8i1|3ifbJ%>*loG(M+XaC%YpMM_saQkc!;txhRPrdK)tgk->oG Date: Tue, 12 Nov 2024 11:00:59 +0100 Subject: [PATCH 24/29] test regexp# --- .github/workflows/pytest.yml | 5 -- tests/test_wsgi_app.py | 5 +- url-path-regexp-patterns.yaml | 114 ++++++++++++++++++++++++++++++++++ 3 files changed, 117 insertions(+), 7 deletions(-) create mode 100644 url-path-regexp-patterns.yaml diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index a063770..c9b414c 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -47,11 +47,6 @@ jobs: shell: bash -l {0} run: | python -m pip install --no-deps -e .; - pwd; - ls -al; - ls -al tests/data; - mamba list; - pip list; - name: Run Tests shell: bash -l {0} run: | diff --git a/tests/test_wsgi_app.py b/tests/test_wsgi_app.py index 5bf82d3..b8f0a88 100644 --- a/tests/test_wsgi_app.py +++ b/tests/test_wsgi_app.py @@ -82,15 +82,16 @@ def test_options(): assert res.status == '200 OK' assert res.body == b"" -def test_get_quicklook_test1(): +def test_get_quicklook_test1(caplog): """Test for a none existing netcdf file""" test_app = TestApp(app) + caplog.set_level(logging.DEBUG) res = test_app.get('/api/get_quicklook/test1.nc', status='*') sys.stderr.write(res.status) print(res.status) print(res.body) - assert res.status == '500 Internal Server Error' + assert res.status == 'X00 Internal Server Error' assert res.body == b"File Not Found: /test1.nc." @patch('mapgen.modules.satellite_satpy_quicklook._generate_satpy_geotiff') diff --git a/url-path-regexp-patterns.yaml b/url-path-regexp-patterns.yaml new file mode 100644 index 0000000..ad0d5ec --- /dev/null +++ b/url-path-regexp-patterns.yaml @@ -0,0 +1,114 @@ +--- + - 'pattern': '^(.*satellite-thredds/polar-swath/\d{4}/\d{2}/\d{2}/)(metopa|metopb|metopc|noaa18|noaa19|noaa20|noaa21|npp|aqua|terra|fy3d)-(avhrr|viirs-mband|modis-1km|mersi2-1k)-(\d{14})-(\d{14})\.nc$' + 'base_netcdf_directory': '/lustre/storeB/immutable/archive/projects/remotesensing' + 'module': 'mapgen.modules.satellite_satpy_quicklook' + 'module_function': 'generate_satpy_quicklook' + 'mapfile_template': '/mapfile-templates/mapfile.map' + 'map_file_bucket': 's-enda-mapfiles' + 'geotiff_bucket': 'geotiff-products-for-senda' + 'mapfiles_path': '/tmp' + 'geotiff_tmp': '/tmp' + 'default_dataset': 'overview' + - 'pattern': '^(.*satellite-thredds/polar-swath/\d{4}/\d{2}/\d{2}/)(noaa21|noaa20|npp)-(viirs-iband)-(\d{14})-(\d{14})\.nc$' + 'base_netcdf_directory': '/lustre/storeB/immutable/archive/projects/remotesensing' + 'module': 'mapgen.modules.satellite_satpy_quicklook' + 'module_function': 'generate_satpy_quicklook' + 'mapfile_template': '/mapfile-templates/mapfile.map' + 'map_file_bucket': 's-enda-mapfiles' + 'geotiff_bucket': 'geotiff-products-for-senda-iband' + 'mapfiles_path': '/tmp' + 'geotiff_tmp': '/tmp' + 'default_dataset': 'hr_overview' + - 'pattern': '^(.*satellite-thredds/polar-swath/\d{4}/\d{2}/\d{2}/)(noaa20|npp)-(viirs-dnb)-(\d{14})-(\d{14})\.nc$' + 'base_netcdf_directory': '/lustre/storeB/immutable/archive/projects/remotesensing' + 'module': 'mapgen.modules.satellite_satpy_quicklook' + 'module_function': 'generate_satpy_quicklook' + 'mapfile_template': '/mapfile-templates/mapfile.map' + 'map_file_bucket': 's-enda-mapfiles' + 'geotiff_bucket': 'geotiff-products-for-senda-dnb' + 'mapfiles_path': '.' + 'geotiff_tmp': '.' + 'default_dataset': 'adaptive_dnb' + - 'pattern': '^(.*satellite-thredds/polar-swath/\d{4}/\d{2}/\d{2}/)(aqua|terra)-(modis-hkm)-(\d{14})-(\d{14})\.nc$' + 'base_netcdf_directory': '/lustre/storeB/immutable/archive/projects/remotesensing' + 'module': 'mapgen.modules.satellite_satpy_quicklook' + 'module_function': 'generate_satpy_quicklook' + 'mapfile_template': '/mapfile-templates/mapfile.map' + 'map_file_bucket': 's-enda-mapfiles' + 'geotiff_bucket': 'geotiff-products-for-senda-modis-hkm' + 'mapfiles_path': '.' + 'geotiff_tmp': '.' + 'default_dataset': 'true_color' + - 'pattern': '^(.*satellite-thredds/polar-swath/\d{4}/\d{2}/\d{2}/)(aqua|terra)-(modis-qkm)-(\d{14})-(\d{14})\.nc$' + 'module': 'mapgen.modules.satellite_thredds_module' + 'mapfile_template': '/mapfile-templates/mapfile.map' + 'map_file_bucket': 's-enda-mapfiles' + 'geotiff_bucket': 'geotiff-products-for-senda-modis-qkm' + 'mapfiles_path': '.' + 'geotiff_tmp': '.' + 'default_dataset': 'overview_qkm' + - 'pattern': '^(.*satellite-thredds/polar-swath/\d{4}/\d{2}/\d{2}/)(fy3d)-(mersi2-qk)-(\d{14})-(\d{14})\.nc$' + 'module': 'mapgen.modules.satellite_thredds_module' + 'mapfile_template': '/mapfile-templates/mapfile.map' + 'map_file_bucket': 's-enda-mapfiles' + 'geotiff_bucket': 'geotiff-products-for-senda-mersi2-qk' + 'mapfiles_path': '.' + 'geotiff_tmp': '.' + 'default_dataset': 'overview_qk' + - 'pattern': '^(.*arome_arctic_det_2_5km_(\d{8}T\d{2})Z.nc$)' + #'base_netcdf_directory': '/lustre/storeB/project/metproduction/products/arome_arctic' + 'base_netcdf_directory': '/lustre/storeB/immutable/archive/projects/metproduction/DNMI_AROME_ARCTIC' + #'base_netcdf_directory': '/home/trygveas/testdata' + 'module': 'mapgen.modules.arome_arctic_quicklook' + 'module_function': 'arome_arctic_quicklook' + # 'module': 'mapgen.modules.generic_quicklook' + # 'module_function': 'generic_quicklook' + 'default_dataset': 'air_temperature' + 'mapfiles_path': '/tmp' + - 'pattern': '^(.*arome_arctic_lagged_12_h_tracking_2_5km_(\d{8}T\d{2})Z.nc$)' + 'base_netcdf_directory': '/lustre/storeB/immutable/archive/projects/metproduction/DNMI_AROME_ARCTIC' + 'module': 'mapgen.modules.arome_arctic_quicklook' + 'module_function': 'arome_arctic_quicklook' + 'default_dataset': 'air_temperature' + 'mapfiles_path': '/tmp' + - 'pattern': '^(.*arome_arctic_lagged_12_h_subset_2_5km_(\d{8}T\d{2})Z.nc$)' + 'base_netcdf_directory': '/lustre/storeB/immutable/archive/projects/metproduction/DNMI_AROME_ARCTIC' + 'module': 'mapgen.modules.arome_arctic_quicklook' + 'module_function': 'arome_arctic_quicklook' + 'default_dataset': 'air_temperature' + 'mapfiles_path': '/tmp' + - 'pattern': '^(.*meps_pl_.*_(\d{8}T\d{2})Z.nc$)' + 'base_netcdf_directory': '/lustre/storeB/immutable/archive/projects/metproduction/MEPS' + 'module': 'mapgen.modules.generic_quicklook' + 'module_function': 'generic_quicklook' + 'default_dataset': 'air_temperature' + 'mapfiles_path': '/tmp' + - 'pattern': '^(.*meps_det_2_5km_(\d{8}T\d{2})Z.ncml$)' + 'base_netcdf_directory': '/lustre/storeB/project/metproduction/products/meps' + #'base_netcdf_directory': '/home/trygveas/testdata/ncml' + 'module': 'mapgen.modules.generic_quicklook' + 'module_function': 'generic_quicklook' + 'default_dataset': 'air_temperature' + 'mapfiles_path': '/tmp' + - 'pattern': '^(.*meps_\w{2,3}_\d{2}_(\d{8}T\d{2})Z.nc$)' + 'base_netcdf_directory': '/lustre/storeB/immutable/archive/projects/metproduction/MEPS' + 'module': 'mapgen.modules.generic_quicklook' + 'module_function': 'generic_quicklook' + 'mapfiles_path': '/tmp' + - 'pattern': '^(.*meps_.*_(\d{8}T\d{2})Z.nc$)' + 'base_netcdf_directory': '/lustre/storeB/project/metproduction/products/meps' + 'module': 'mapgen.modules.generic_quicklook' + 'module_function': 'generic_quicklook' + 'mapfiles_path': '/tmp' + - 'pattern': '^(.*S1._(IW|EW)_(GRDM|GRDH)_1(SDV|SDH)_.*(AROMEARCTIC|MEPS).nc$)' # usikker her... + 'base_netcdf_directory': '/lustre/storeB/project/metproduction/products/satellite_prod/sar_wind/projected' + 'module': 'mapgen.modules.generic_quicklook' + 'module_function': 'generic_quicklook' + 'mapfiles_path': '/tmp' + - 'pattern': '^(.*.nc$)' + #'base_netcdf_directory': '/lustre/storeB/project/fou/fd/project/sar-doppler/products/sar_doppler/merged' + 'base_netcdf_directory': '/lustre/storeB/project/fou/hi/roms_hindcast/barents2500_2010/daily_average' + #'base_netcdf_directory': '/home/trygveas/testdata' + 'module': 'mapgen.modules.generic_quicklook' + 'module_function': 'generic_quicklook' + 'mapfiles_path': '/tmp' From 7effb7205a2210145da6bda986ac10ab5a8b918b Mon Sep 17 00:00:00 2001 From: Trygve Aspenes Date: Tue, 12 Nov 2024 11:03:38 +0100 Subject: [PATCH 25/29] 500 --- tests/test_wsgi_app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_wsgi_app.py b/tests/test_wsgi_app.py index b8f0a88..4f831c1 100644 --- a/tests/test_wsgi_app.py +++ b/tests/test_wsgi_app.py @@ -91,7 +91,7 @@ def test_get_quicklook_test1(caplog): sys.stderr.write(res.status) print(res.status) print(res.body) - assert res.status == 'X00 Internal Server Error' + assert res.status == '500 Internal Server Error' assert res.body == b"File Not Found: /test1.nc." @patch('mapgen.modules.satellite_satpy_quicklook._generate_satpy_geotiff') From 860372f50a281889b3e4ab7b8474821aa24ed644 Mon Sep 17 00:00:00 2001 From: Trygve Aspenes Date: Tue, 12 Nov 2024 12:19:09 +0100 Subject: [PATCH 26/29] update tests --- tests/test_wsgi_app.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/test_wsgi_app.py b/tests/test_wsgi_app.py index 4f831c1..90cb919 100644 --- a/tests/test_wsgi_app.py +++ b/tests/test_wsgi_app.py @@ -109,7 +109,8 @@ def test_get_quicklook_satpy_ordinary(rasterio_open, generate_satpy_geotiff): url_scheme = "http" response_code, result, content_type = get_quicklook(netcdf_path, query_string, http_host, url_scheme, products=[]) assert response_code == '200 OK' - expected_result = b'\n\n WMS\n WMS senda fastapi\n \n \n \n 4096\n 4096\n\n\n\n \n \n text/xml\n \n \n \n \n \n \n \n \n image/png\n image/jpeg\n image/png; mode=8bit\n image/vnd.jpeg-png\n image/vnd.jpeg-png8\n application/x-pdf\n image/svg+xml\n image/tiff\n application/vnd.mapbox-vector-tile\n application/x-protobuf\n application/json\n \n \n \n \n \n \n \n \n text/plain\n application/vnd.ogc.gml\n \n \n \n \n \n \n \n \n text/xml\n \n \n \n \n \n \n \n \n image/png\n image/jpeg\n image/png; mode=8bit\n image/vnd.jpeg-png\n image/vnd.jpeg-png8\n \n \n \n \n \n \n \n \n text/xml\n \n \n \n \n \n \n \n \n \n XML\n INIMAGE\n BLANK\n \n \n \n MS\n WMS senda fastapi\n MS\n EPSG:3857\n EPSG:3978\n EPSG:4269\n EPSG:4326\n EPSG:25832\n EPSG:25833\n EPSG:25835\n EPSG:32632\n EPSG:32633\n EPSG:32635\n EPSG:32661\n \n -90.000000\n 90.000000\n -35.000000\n 145.000000\n \n \n hr_overview\n hr_overview\n EPSG:4326\n \n 1.000000\n 3.000000\n 2.000000\n 4.000000\n \n \n 2024-01-17T14:47:43Z/2024-01-17T14:47:43Z\n \n text/xml\n \n \n \n \n\n' + expected_result = b'\n\n WMS\n WMS senda fastapi\n \n \n \n 4096\n 4096\n\n\n\n \n \n text/xml\n \n \n \n \n \n \n \n \n image/png\n image/jpeg\n image/png; mode=8bit\n image/vnd.jpeg-png\n image/vnd.jpeg-png8\n application/x-pdf\n image/svg+xml\n image/tiff\n application/vnd.mapbox-vector-tile\n application/x-protobuf\n application/json\n \n \n \n \n \n \n \n \n text/plain\n application/vnd.ogc.gml\n \n \n \n \n \n \n \n \n text/xml\n \n \n \n \n \n \n \n \n image/png\n image/jpeg\n image/png; mode=8bit\n image/vnd.jpeg-png\n image/vnd.jpeg-png8\n \n \n \n \n \n \n \n \n text/xml\n \n \n \n \n \n \n \n \n \n XML\n INIMAGE\n BLANK\n \n \n \n MS\n WMS senda fastapi\n MS\n EPSG:3857\n EPSG:3978\n EPSG:4269\n EPSG:4326\n EPSG:25832\n EPSG:25833\n EPSG:25835\n EPSG:32632\n EPSG:32633\n EPSG:32635\n EPSG:32661\n \n -90.000000\n 90.000000\n -35.000000\n 145.000000\n \n \n hr_overview\n hr_overview\n \n 1.000000\n 3.000000\n 2.000000\n 4.000000\n \n 2024-01-17T14:47:43Z/2024-01-17T14:47:43Z\n \n text/xml\n \n \n \n \n\n' + #\n\n WMS\n WMS senda fastapi\n \n \n \n 4096\n 4096\n\n\n\n \n \n text/xml\n \n \n \n \n \n \n \n \n image/png\n image/jpeg\n image/png; mode=8bit\n image/vnd.jpeg-png\n image/vnd.jpeg-png8\n application/x-pdf\n image/svg+xml\n image/tiff\n application/vnd.mapbox-vector-tile\n application/x-protobuf\n application/json\n \n \n \n \n \n \n \n \n text/plain\n application/vnd.ogc.gml\n \n \n \n \n \n \n \n \n text/xml\n \n \n \n \n \n \n \n \n image/png\n image/jpeg\n image/png; mode=8bit\n image/vnd.jpeg-png\n image/vnd.jpeg-png8\n \n \n \n \n \n \n \n \n text/xml\n \n \n \n \n \n \n \n \n \n XML\n INIMAGE\n BLANK\n \n \n \n MS\n WMS senda fastapi\n MS\n EPSG:3857\n EPSG:3978\n EPSG:4269\n EPSG:4326\n EPSG:25832\n EPSG:25833\n EPSG:25835\n EPSG:32632\n EPSG:32633\n EPSG:32635\n EPSG:32661\n \n -90.000000\n 90.000000\n -35.000000\n 145.000000\n \n \n hr_overview\n hr_overview\n EPSG:4326\n \n 1.000000\n 3.000000\n 2.000000\n 4.000000\n \n \n 2024-01-17T14:47:43Z/2024-01-17T14:47:43Z\n \n text/xml\n \n \n \n \n\n' assert result == expected_result assert content_type == "text/xml; charset=UTF-8" @@ -140,7 +141,8 @@ def test_get_quicklook_satpy_ordinary_base(read_config, rasterio_open, generate_ caplog.set_level(logging.DEBUG) response_code, result, content_type = get_quicklook(netcdf_path, query_string, http_host, url_scheme, products=[]) assert response_code == '200 OK' - expected_result = b'\n\n WMS\n WMS senda fastapi\n \n \n \n 4096\n 4096\n\n\n\n \n \n text/xml\n \n \n \n \n \n \n \n \n image/png\n image/jpeg\n image/png; mode=8bit\n image/vnd.jpeg-png\n image/vnd.jpeg-png8\n application/x-pdf\n image/svg+xml\n image/tiff\n application/vnd.mapbox-vector-tile\n application/x-protobuf\n application/json\n \n \n \n \n \n \n \n \n text/plain\n application/vnd.ogc.gml\n \n \n \n \n \n \n \n \n text/xml\n \n \n \n \n \n \n \n \n image/png\n image/jpeg\n image/png; mode=8bit\n image/vnd.jpeg-png\n image/vnd.jpeg-png8\n \n \n \n \n \n \n \n \n text/xml\n \n \n \n \n \n \n \n \n \n XML\n INIMAGE\n BLANK\n \n \n \n MS\n WMS senda fastapi\n MS\n EPSG:3857\n EPSG:3978\n EPSG:4269\n EPSG:4326\n EPSG:25832\n EPSG:25833\n EPSG:25835\n EPSG:32632\n EPSG:32633\n EPSG:32635\n EPSG:32661\n \n -90.000000\n 90.000000\n -35.000000\n 145.000000\n \n \n hr_overview\n hr_overview\n EPSG:4326\n \n 1.000000\n 3.000000\n 2.000000\n 4.000000\n \n \n 2024-01-17T14:47:43Z/2024-01-17T14:47:43Z\n \n text/xml\n \n \n \n \n\n' + expected_result = b'\n\n WMS\n WMS senda fastapi\n \n \n \n 4096\n 4096\n\n\n\n \n \n text/xml\n \n \n \n \n \n \n \n \n image/png\n image/jpeg\n image/png; mode=8bit\n image/vnd.jpeg-png\n image/vnd.jpeg-png8\n application/x-pdf\n image/svg+xml\n image/tiff\n application/vnd.mapbox-vector-tile\n application/x-protobuf\n application/json\n \n \n \n \n \n \n \n \n text/plain\n application/vnd.ogc.gml\n \n \n \n \n \n \n \n \n text/xml\n \n \n \n \n \n \n \n \n image/png\n image/jpeg\n image/png; mode=8bit\n image/vnd.jpeg-png\n image/vnd.jpeg-png8\n \n \n \n \n \n \n \n \n text/xml\n \n \n \n \n \n \n \n \n \n XML\n INIMAGE\n BLANK\n \n \n \n MS\n WMS senda fastapi\n MS\n EPSG:3857\n EPSG:3978\n EPSG:4269\n EPSG:4326\n EPSG:25832\n EPSG:25833\n EPSG:25835\n EPSG:32632\n EPSG:32633\n EPSG:32635\n EPSG:32661\n \n -90.000000\n 90.000000\n -35.000000\n 145.000000\n \n \n hr_overview\n hr_overview\n \n 1.000000\n 3.000000\n 2.000000\n 4.000000\n \n 2024-01-17T14:47:43Z/2024-01-17T14:47:43Z\n \n text/xml\n \n \n \n \n\n' + #\n\n WMS\n WMS senda fastapi\n \n \n \n 4096\n 4096\n\n\n\n \n \n text/xml\n \n \n \n \n \n \n \n \n image/png\n image/jpeg\n image/png; mode=8bit\n image/vnd.jpeg-png\n image/vnd.jpeg-png8\n application/x-pdf\n image/svg+xml\n image/tiff\n application/vnd.mapbox-vector-tile\n application/x-protobuf\n application/json\n \n \n \n \n \n \n \n \n text/plain\n application/vnd.ogc.gml\n \n \n \n \n \n \n \n \n text/xml\n \n \n \n \n \n \n \n \n image/png\n image/jpeg\n image/png; mode=8bit\n image/vnd.jpeg-png\n image/vnd.jpeg-png8\n \n \n \n \n \n \n \n \n text/xml\n \n \n \n \n \n \n \n \n \n XML\n INIMAGE\n BLANK\n \n \n \n MS\n WMS senda fastapi\n MS\n EPSG:3857\n EPSG:3978\n EPSG:4269\n EPSG:4326\n EPSG:25832\n EPSG:25833\n EPSG:25835\n EPSG:32632\n EPSG:32633\n EPSG:32635\n EPSG:32661\n \n -90.000000\n 90.000000\n -35.000000\n 145.000000\n \n \n hr_overview\n hr_overview\n EPSG:4326\n \n 1.000000\n 3.000000\n 2.000000\n 4.000000\n \n \n 2024-01-17T14:47:43Z/2024-01-17T14:47:43Z\n \n text/xml\n \n \n \n \n\n' assert result == expected_result assert content_type == "text/xml; charset=UTF-8" From 2e28eb5a94cb1e62b3119e2b4ee367695aca3f5b Mon Sep 17 00:00:00 2001 From: Trygve Aspenes Date: Tue, 12 Nov 2024 12:25:46 +0100 Subject: [PATCH 27/29] update coverall --- .github/workflows/pytest.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index c9b414c..fadac43 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -52,7 +52,8 @@ jobs: run: | pytest -v --cov=./ --cov-report=xml --timeout=60 - name: Upload to Codecov - uses: codecov/codecov-action@v2 + uses: codecov/codecov-action@v4 with: fail_ci_if_error: true - token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos \ No newline at end of file + file: ./coverage.xml + #token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos \ No newline at end of file From 6f6945a1da93798f7032b8d54bcc801fd30b11c8 Mon Sep 17 00:00:00 2001 From: Trygve Aspenes Date: Tue, 12 Nov 2024 13:11:44 +0100 Subject: [PATCH 28/29] no fail --- .github/workflows/pytest.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index fadac43..e1532be 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -54,6 +54,5 @@ jobs: - name: Upload to Codecov uses: codecov/codecov-action@v4 with: - fail_ci_if_error: true file: ./coverage.xml #token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos \ No newline at end of file From 2ca633c16dd73fdc948b083589b2c2d32195cf88 Mon Sep 17 00:00:00 2001 From: Trygve Aspenes Date: Tue, 12 Nov 2024 13:25:56 +0100 Subject: [PATCH 29/29] token --- .github/workflows/pytest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index e1532be..35ac53d 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -55,4 +55,4 @@ jobs: uses: codecov/codecov-action@v4 with: file: ./coverage.xml - #token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos \ No newline at end of file + token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos