Skip to content

Commit

Permalink
Diff refine JSONs with custom script in functional tests
Browse files Browse the repository at this point in the history
Updates functional tests to use the diff_jsons.py script instead of the
vanilla UNIX diff. This script allows tests to ignore changes in output
like the augur version number that should not be considered in diffs
anyway. This fix is required for the next augur release.
  • Loading branch information
huddlej committed Oct 23, 2020
1 parent 35cdede commit 05f2a68
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/functional/refine.t
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ Confirm that trees match expected topology and branch lengths, given that the ou

$ python3 "$TESTDIR/../../scripts/diff_trees.py" "refine/not_time_tree.nwk" "$TMP/tree.nwk" --significant-digits 2
{}
$ diff -u "refine/mutations_per_site_branch_lengths.json" "$TMP/branch_lengths.json"
$ python3 "$TESTDIR/../../scripts/diff_jsons.py" "refine/mutations_per_site_branch_lengths.json" "$TMP/branch_lengths.json" --significant-digits 0
{}

Run refine again without a time tree, but request number of mutations per branch as the divergence unit.
This approach only works when we provide an alignment FASTA.
Expand All @@ -93,7 +94,8 @@ Confirm that trees match expected topology and branch lengths, given that the ou

$ python3 "$TESTDIR/../../scripts/diff_trees.py" "refine/not_time_tree.nwk" "$TMP/tree.nwk" --significant-digits 2
{}
$ diff -u "refine/integer_branch_lengths.json" "$TMP/branch_lengths.json"
$ python3 "$TESTDIR/../../scripts/diff_jsons.py" "refine/integer_branch_lengths.json" "$TMP/branch_lengths.json" --significant-digits 0
{}

Run refine again without a time tree, but try to request number of mutations per branch as the divergence unit.
This approach does not make sense and should not work without an alignment FASTA.
Expand Down

0 comments on commit 05f2a68

Please sign in to comment.