Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate integration test working directories by feature name #644

Merged
merged 2 commits into from
Oct 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions integration_tests/features/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,17 @@ def before_all(context):
import polar2grid

os.environ["POLAR2GRID_HOME"] = os.path.join(os.path.dirname(polar2grid.__file__), "..", "swbundle")


def before_feature(context, feature):
tmpdir = tempfile.gettempdir()
context.base_temp_dir = os.path.join(tmpdir, "p2g_integration_tests")
feature_name = os.path.basename(feature.filename).replace("<", "").replace(">", "").replace(".feature", "")
context.base_temp_dir = os.path.join(tmpdir, "p2g_integration_tests", feature_name)

# remove any previous test results
if os.path.isdir(context.base_temp_dir):
shutil.rmtree(context.base_temp_dir, ignore_errors=True)
os.mkdir(context.base_temp_dir)
os.makedirs(context.base_temp_dir, exist_ok=True)


def after_all(context):
Expand Down
1 change: 0 additions & 1 deletion polar2grid/glue.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,6 @@ def _set_preferred_chunk_size(preferred_chunk_size: int) -> None:
pcs_in_mb = (preferred_chunk_size * preferred_chunk_size) * 8 // (1024 * 1024)
if "PYTROLL_CHUNK_SIZE" not in os.environ:
LOG.debug(f"Setting preferred chunk size to {preferred_chunk_size} pixels or {pcs_in_mb:d}MiB")
satpy.CHUNK_SIZE = preferred_chunk_size
os.environ["PYTROLL_CHUNK_SIZE"] = f"{preferred_chunk_size:d}"
dask.config.set({"array.chunk-size": f"{pcs_in_mb:d}MiB"})
else:
Expand Down
Loading