Skip to content

Commit ef5128c

Browse files
authored
Merge pull request #69 from rust-bio/fix_tests
Change test for annotate_dgidb
2 parents e4ec0a8 + 18450e2 commit ef5128c

File tree

4 files changed

+8
-24
lines changed

4 files changed

+8
-24
lines changed

.github/workflows/rust.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ jobs:
5252
run: |
5353
sudo apt-get install --yes libgsl0-dev
5454
55-
- name: Install starcode
55+
- name: Install test dependencies
5656
run: |
5757
export PATH="/usr/share/miniconda/bin:$PATH"
58-
conda create -c bioconda -c conda-forge -n starcode starcode
58+
conda create -c bioconda -c conda-forge -n dependencies starcode bcftools
5959
6060
- name: Install stable toolchain
6161
uses: actions-rs/toolchain@v1
@@ -66,6 +66,6 @@ jobs:
6666
- name: Run cargo test
6767
run: |
6868
export PATH="/usr/share/miniconda/bin:$PATH"
69-
source activate starcode
69+
source activate dependencies
7070
cargo test -- --test-threads=1
7171
-12.2 KB
Binary file not shown.
-12.8 KB
Binary file not shown.

tests/lib.rs

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -291,28 +291,12 @@ fn test_collapse_reads_to_fragments_from_bam() {
291291

292292
#[test]
293293
fn test_vcf_annotate_dgidb() {
294-
assert!(
295-
Command::new("bash")
296-
.arg("-c")
297-
.arg("target/debug/rbt vcf-annotate-dgidb tests/annotate_dgidb_test.vcf > /tmp/annotate_dgidb_test.bcf")
298-
.spawn().unwrap().wait().unwrap().success());
299-
test_output(
300-
"/tmp/annotate_dgidb_test.bcf",
301-
"tests/expected/annotate_dgidb_test.bcf",
302-
);
303-
}
304-
305-
#[test]
306-
fn test_vcf_annotate_dgidb_drugbank() {
307-
assert!(
308-
Command::new("bash")
294+
let exec_test = Command::new("bash")
309295
.arg("-c")
310-
.arg("target/debug/rbt vcf-annotate-dgidb tests/annotate_dgidb_test.vcf -s DrugBank > /tmp/annotate_dgidb_drugbank_test.bcf")
311-
.spawn().unwrap().wait().unwrap().success());
312-
test_output(
313-
"/tmp/annotate_dgidb_drugbank_test.bcf",
314-
"tests/expected/annotate_dgidb_drugbank_test.bcf",
315-
);
296+
.arg("target/debug/rbt vcf-annotate-dgidb tests/annotate_dgidb_test.vcf | bcftools view - | wc -l").output()
297+
.expect("failed to execute process");
298+
assert!(exec_test.status.success());
299+
assert_eq!(String::from_utf8(exec_test.stdout).unwrap().trim(), "65");
316300
}
317301

318302
#[test]

0 commit comments

Comments
 (0)