From d8e2f73b53f459d5189bd39309eda9f0e0ddcc49 Mon Sep 17 00:00:00 2001 From: BRAUN REMI Date: Fri, 10 Jan 2025 12:38:27 +0100 Subject: [PATCH] Fixing CI --- .gitignore | 1 + ci/on_push/test_end_to_end.py | 2 +- ci/on_push/test_satellites.py | 2 +- ci/weekly/test_satellites.py | 10 +++++++--- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 978b5bbd..26cdcdb7 100644 --- a/.gitignore +++ b/.gitignore @@ -19,6 +19,7 @@ ci/**/*.npy ci/**/*.vrt ci/**/*.geojson ci/**/*.xml +ci/**/*.jp2 # Build options build/ diff --git a/ci/on_push/test_end_to_end.py b/ci/on_push/test_end_to_end.py index fc721505..ece35b89 100644 --- a/ci/on_push/test_end_to_end.py +++ b/ci/on_push/test_end_to_end.py @@ -165,7 +165,7 @@ def _test_core( LOGGER.info("Checking opening solutions") LOGGER.info("MTD") prod: Product = READER.open( - pattern_path, method=CheckMethod.MTD, remove_tmp=debug + pattern_path, method=CheckMethod.MTD, remove_tmp=not debug ) # Log name diff --git a/ci/on_push/test_satellites.py b/ci/on_push/test_satellites.py index 9c4933af..1da0cb59 100644 --- a/ci/on_push/test_satellites.py +++ b/ci/on_push/test_satellites.py @@ -139,7 +139,7 @@ def check_prod(pattern_path: str, debug: bool = WRITE_ON_DISK) -> Product: pattern_path, method=CheckMethod.MTD, constellation=prod_name.constellation, - remove_tmp=debug, + remove_tmp=not debug, ) assert prod is not None diff --git a/ci/weekly/test_satellites.py b/ci/weekly/test_satellites.py index 1e1e7d2d..b67c1bb3 100644 --- a/ci/weekly/test_satellites.py +++ b/ci/weekly/test_satellites.py @@ -1,5 +1,6 @@ """Script testing EOReader satellites weekly""" +import contextlib import logging import os import sys @@ -51,7 +52,7 @@ LOGGER = logging.getLogger(EOREADER_NAME) MERIT_DEM_SUB_DIR_PATH = test_satellites.MERIT_DEM_SUB_DIR_PATH -WRITE_ON_DISK = False +WRITE_ON_DISK = True reduce_verbosity() @@ -319,7 +320,9 @@ def core(prod_path, possible_bands, debug, **kwargs): client.scheduler.shutdown() client.retire_workers() client.close() - client.shutdown() + + with contextlib.suppress(RuntimeError): + client.shutdown() # Check products prod = test_satellites.check_prod(prod_path, debug) @@ -376,7 +379,8 @@ def core(prod_path, possible_bands, debug, **kwargs): if not WRITE_ON_DISK: test_satellites.check_clean(prod) - prod.clear() + if not WRITE_ON_DISK: + prod.clear() @s3_env