Skip to content

Commit

Permalink
Separate integration test working directories by feature name
Browse files Browse the repository at this point in the history
  • Loading branch information
djhoese committed Oct 6, 2023
1 parent 2e70596 commit 0c77816
Showing 1 changed file with 6 additions and 2 deletions.
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

0 comments on commit 0c77816

Please sign in to comment.