Skip to content

Commit

Permalink
[e2e tests] run the e2e tests in seperate directories
Browse files Browse the repository at this point in the history
  • Loading branch information
LaraFuhrmann committed Nov 28, 2024
1 parent 1718941 commit e0d0228
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tests/data_1/shotgun_test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash

viloca run -a 0.1 -w 201 --mode shorah -x 100000 -p 0.9 -c 0 \
-r HXB2:2469-3713 -R 42 -f test_ref.fasta -b test_aln.cram --out_format csv "$@"
-r HXB2:2469-3713 -R 42 -f ../test_ref.fasta -b ../test_aln.cram --out_format csv "$@"
17 changes: 13 additions & 4 deletions tests/test_shotgun_e2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,31 @@ def run(base_files):
run(base_files)

def test_e2e_shorah():
cwd_test_e2e = "./data_1/test_e2e_shorah"
# Check if the directory exists, if not, create it
if not os.path.exists(cwd_test_e2e):
os.makedirs(cwd_test_e2e)

original = subprocess.run(
"./shotgun_test.sh", shell=True, check=True, cwd=cwd
"../shotgun_test.sh", shell=True, check=True, cwd=cwd_test_e2e
)
assert original.returncode == 0
assert os.path.isfile(os.path.join(cwd, f_path)) == False

assert filecmp.cmp(
"./data_1/test.csv",
"./data_1/work/snv/SNVs_0.010000_final.csv",
"./data_1/test_e2e_shorah/work/snv/SNVs_0.010000_final.csv",
shallow=False
)

def test_e2e_shorah_with_extended_window_mode():
cwd_test_e2e_extended_window_mode = "./data_1/test_e2e_extended_window_modee"
# Check if the directory exists, if not, create it
if not os.path.exists(cwd_test_e2e_shorah_with_extended_window_mode):
os.makedirs(cwd_test_e2e_shorah_with_extended_window_mode)
p = subprocess.run(
"./shotgun_test.sh --extended_window_mode", shell=True, check=True, cwd=cwd
"../shotgun_test.sh --extended_window_mode", shell=True, check=True, cwd=cwd_test_e2e_extended_window_mode
)

assert p.returncode == 0
assert os.path.isfile(os.path.join(cwd, f_path)) == True
assert os.path.isfile(os.path.join(cwd_test_e2e_extended_window_mode, f_path)) == True

0 comments on commit e0d0228

Please sign in to comment.