Skip to content

Commit

Permalink
Fix test log dumps
Browse files Browse the repository at this point in the history
  • Loading branch information
Ulthran committed Mar 26, 2024
1 parent 19bf48d commit 0ff589e
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 14 deletions.
38 changes: 25 additions & 13 deletions .tests/e2e/test_full_run.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import pytest
import shutil
import subprocess as sp
import sys
import tempfile
from pathlib import Path

Expand Down Expand Up @@ -39,19 +40,30 @@ def setup():
@pytest.fixture
def run_sunbeam(setup):
temp_dir, project_dir = setup

# Run the test job.
sp.check_output(
[
"sunbeam",
"run",
"--profile",
project_dir,
"all_template",
"--directory",
temp_dir,
]
)
output_fp = project_dir / "sunbeam_output"
log_fp = output_fp / "logs"
stats_fp = project_dir / "stats"

# Run the test job
try:
sp.check_output(
[
"sunbeam",
"run",
"--profile",
project_dir,
"all_template",
"--directory",
temp_dir,
]
)
except sp.CalledProcessError as e:
shutil.copytree(log_fp, "logs/")
shutil.copytree(stats_fp, "stats/")
sys.exit(e)

shutil.copytree(log_fp, "logs/")
shutil.copytree(stats_fp, "stats/")

output_fp = project_dir / "sunbeam_output"
benchmarks_fp = project_dir / "stats/"
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ The dependency .yml file can be named whatever you want, as long as you refer to

### .github/

This directory contains CI workflows for GitHub to run automatically on PRs, including tests and linting. If the linter raises errors, you can fix them by running `snakefmt` on any snakemake files and `black` on any python files.
This directory contains CI workflows for GitHub to run automatically on PRs, including tests and linting. If the linter raises errors, you can fix them by running `snakefmt` on any snakemake files and `black` on any python files. The release workflow will build and push a docker image for each environment in the extension.

### .tests/

Expand All @@ -42,6 +42,10 @@ This directory contains tests, broken down into types such as end-to-end (e2e) a

This directory contains scripts that can be run by rules. Use this for any rules that need to run python, R, etc code.

### envs/*.Dockerfile

The Dockerfiles provided with conda env specifications allow for containerized runs of sunbeam (meaning they use docker containers to run each rule rather than conda envs).

(You can delete everything above this line)
-----------------------------------------------------------------

Expand Down

0 comments on commit 0ff589e

Please sign in to comment.