Skip to content

Commit

Permalink
Update test to exclude augur version comparison
Browse files Browse the repository at this point in the history
Exclude the Augur version from the diff, otherwise it'll fail on the
next release. Some of these tests were added via this PR but many
weren't, so it's easier to do it all in a single commit.

<#1355 (comment)>
  • Loading branch information
jameshadfield committed Dec 30, 2023
1 parent 33348bd commit dd4ac03
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 14 deletions.
6 changes: 4 additions & 2 deletions tests/functional/ancestral/cram/case-sensitive.t
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ Change the _reference_ to lowercase

$ python3 "$TESTDIR/../../../../scripts/diff_jsons.py" \
> "$TESTDIR/../data/simple-genome/nt_muts.ref-seq.json" \
> "nt_muts.ref-seq.json"
> "nt_muts.ref-seq.json" \
> --exclude-paths "root['meta']['updated']"
{}


Expand All @@ -36,5 +37,6 @@ be lowecase which will be compared against the uppercase reference

$ python3 "$TESTDIR/../../../../scripts/diff_jsons.py" \
> "$TESTDIR/../data/simple-genome/nt_muts.ref-seq.json" \
> "nt_muts.ref-seq.json"
> "nt_muts.ref-seq.json" \
> --exclude-paths "root['meta']['updated']"
{}
6 changes: 4 additions & 2 deletions tests/functional/ancestral/cram/general.t
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ node-data JSON we diff against.

$ python3 "$TESTDIR/../../../../scripts/diff_jsons.py" \
> "$TESTDIR/../data/simple-genome/nt_muts.ref-seq.json" \
> "nt_muts.ref-seq.json"
> "nt_muts.ref-seq.json" \
> --exclude-paths "root['meta']['updated']"
{}

Same as above but without providing a `--root-sequence`. The effect of this on behaviour is:
Expand All @@ -38,5 +39,6 @@ mutations (as there's nothing to compare the root node to)

$ python3 "$TESTDIR/../../../../scripts/diff_jsons.py" \
> "$TESTDIR/../data/simple-genome/nt_muts.no-ref-seq.json" \
> "nt_muts.no-ref-seq.json"
> "nt_muts.no-ref-seq.json" \
> --exclude-paths "root['meta']['updated']"
{}
2 changes: 1 addition & 1 deletion tests/functional/ancestral/cram/vcf.t
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ but it will have the reference sequence attached.
$ python3 "$TESTDIR/../../../../scripts/diff_jsons.py" \
> "$DATA/nt_muts.ref-seq.json" \
> "nt_muts.vcf-input.ref-seq.json" \
> --exclude-regex-paths "root\['nodes'\]\['.+'\]\['sequence'\]"
> --exclude-regex-paths "root\['nodes'\]\['.+'\]\['sequence'\]" "root['meta']['updated']"
{}

Here's the same mutations as in $DATA/nt_muts.ref-seq.json,
Expand Down
4 changes: 2 additions & 2 deletions tests/functional/translate/cram/general.t
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ which validate the output will fail as it's missing a 'nuc' annotation.
$ python3 "$SCRIPTS/diff_jsons.py" \
> "$DATA/aa_muts.json" \
> "aa_muts.json" \
> --exclude-regex-paths "root\['annotations'\]\['.+'\]\['seqid'\]"
> --exclude-regex-paths "root\['annotations'\]\['.+'\]\['seqid'\]" "root['meta']['updated']"
{}

Same as above but using a GenBank file. This changes the 'type' of the annotations,
Expand All @@ -34,5 +34,5 @@ but this is irrelevant for Auspice's use and simply reflects the reference sourc
$ python3 "$SCRIPTS/diff_jsons.py" \
> "$DATA/aa_muts.json" \
> "aa_muts.genbank.json" \
> --exclude-regex-paths "root\['annotations'\]\['.+'\]\['seqid'\]" "root\['annotations'\]\['.+'\]\['type'\]"
> --exclude-regex-paths "root\['annotations'\]\['.+'\]\['seqid'\]" "root\['annotations'\]\['.+'\]\['type'\]" "root['meta']['updated']"
{}
5 changes: 3 additions & 2 deletions tests/functional/translate/cram/genes.t
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ as a feature ('nuc' in this case)
$ python3 "$SCRIPTS/diff_jsons.py" \
> "$DATA/aa_muts.json" \
> "aa_muts.genes-args.json" \
> --exclude-regex-paths "seqid" "gene1"
> --exclude-regex-paths "seqid" "gene1" "root['meta']['updated']"
{}
Using a text file rather than command line arguments

Expand All @@ -43,5 +43,6 @@ Using a text file rather than command line arguments

$ python3 "$SCRIPTS/diff_jsons.py" \
> "aa_muts.genes-args.json" \
> "aa_muts.genes-txt.json"
> "aa_muts.genes-txt.json" \
> --exclude-paths "root['meta']['updated']"
{}
2 changes: 1 addition & 1 deletion tests/functional/translate/cram/gff.t
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ GFF file with 'region' removed, so the only genome information is the ##sequence
$ python3 "$TESTDIR/../../../../scripts/diff_jsons.py" \
> "$DATA/aa_muts.json" \
> "aa_muts.pragma-only.json" \
> --exclude-regex-paths "root\['annotations'\]\['.+'\]\['seqid'\]"
> --exclude-regex-paths "root\['annotations'\]\['.+'\]\['seqid'\]" "root['meta']['updated']"
{}

GFF file with no genome coordinate information
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/translate/cram/root-mutations.t
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ is unchanged (MPCG*). There is also a mutation E4G at the root node to compensat
$ python3 "$SCRIPTS/diff_jsons.py" \
> "$DATA/aa_muts.json" \
> "aa_muts.json" \
> --exclude-regex-paths "root\['annotations'\]\['.+'\]\['seqid'\]"
> --exclude-regex-paths "root\['annotations'\]\['.+'\]\['seqid'\]" "root['meta']['updated']"
{'values_changed': {"root['reference']['gene1']": {'new_value': 'MPCE*', 'old_value': 'MPCG*'}}, 'iterable_item_added': {"root['nodes']['node_root']['aa_muts']['gene1'][0]": 'E4G'}}
2 changes: 1 addition & 1 deletion tests/functional/translate/cram/translate-with-genbank.t
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ Translate amino acids for genes using a GenBank file.
amino acid mutations written to .* (re)

$ python3 "$SCRIPTS/diff_jsons.py" $DATA/zika/aa_muts_genbank.json aa_muts.json \
> --exclude-regex-paths "root\['annotations'\]\['.+'\]\['seqid'\]"
> --exclude-regex-paths "root\['annotations'\]\['.+'\]\['seqid'\]" "root['meta']['updated']"
{}
2 changes: 1 addition & 1 deletion tests/functional/translate/cram/vcf-with-root-mutation.t
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@ node is E (and so are all the other nodes))
$ python3 "$SCRIPTS/diff_jsons.py" \
> aa_muts.truth.json \
> aa_muts.json \
> --exclude-regex-paths "root\['annotations'\]\['.+'\]\['seqid'\]"
> --exclude-regex-paths "root\['annotations'\]\['.+'\]\['seqid'\]" "root['meta']['updated']"
{}
2 changes: 1 addition & 1 deletion tests/functional/translate/cram/vcf.t
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Setup
$ python3 "$SCRIPTS/diff_jsons.py" \
> "$DATA/aa_muts.json" \
> aa_muts.json \
> --exclude-regex-paths "root\['annotations'\]\['.+'\]\['seqid'\]"
> --exclude-regex-paths "root\['annotations'\]\['.+'\]\['seqid'\]" "root['meta']['updated']"
{}

------------------------------ MISSING TEST ----------------------------------
Expand Down

0 comments on commit dd4ac03

Please sign in to comment.