-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1259: Update export v2 Cram tests
- Loading branch information
Showing
40 changed files
with
737 additions
and
189 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export AUGUR="${AUGUR:-$TESTDIR/../../../../bin/augur}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
Setup | ||
|
||
$ source "$TESTDIR"/_setup.sh | ||
|
||
Node-data JSONs produced from a different major version of augur | ||
are not allowed. | ||
|
||
$ ${AUGUR} export v2 \ | ||
> --tree "$TESTDIR/../data/tree.nwk" \ | ||
> --node-data "$TESTDIR/../data/div_node-data.json" "$TESTDIR/../data/location_node-data2.json" \ | ||
> --auspice-config "$TESTDIR/../data/auspice_config3.json" \ | ||
> --output dataset.json | ||
ERROR: Augur version incompatibility detected: the JSON .*location_node-data2\.json.* was generated by \{'program': 'augur', 'version': '13.1.2'\}, which is incompatible with the current augur version \([.0-9]+\). We suggest you rerun the pipeline using the current version of augur. (re) | ||
[2] | ||
|
||
Skipping validation allows mismatched augur versions to be used without error. | ||
(Note the stderr/stdout output is detailed here, including 2 empty lines) | ||
|
||
$ ${AUGUR} export v2 \ | ||
> --tree "$TESTDIR/../data/tree.nwk" \ | ||
> --node-data "$TESTDIR/../data/div_node-data.json" "$TESTDIR/../data/location_node-data2.json" \ | ||
> --auspice-config "$TESTDIR/../data/auspice_config2.json" \ | ||
> --output dataset.json \ | ||
> --skip-validation | ||
WARNING: You didn't provide information on who is maintaining this analysis. | ||
\s{0} (re) | ||
Skipping validation of produced JSON due to --validation-mode=skip or --skip-validation. | ||
\s{0} (re) | ||
Check the output from the above command against its expected contents | ||
$ python3 "$TESTDIR/../../../../scripts/diff_jsons.py" "$TESTDIR/../data/dataset2.json" dataset.json \ | ||
> --exclude-paths "root['meta']['updated']" | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
Setup | ||
|
||
$ source "$TESTDIR"/_setup.sh | ||
|
||
Export with auspice config JSON which defines scale & legend settings | ||
|
||
$ ${AUGUR} export v2 \ | ||
> --tree "$TESTDIR/../data/tree.nwk" \ | ||
> --node-data "$TESTDIR/../data/div_node-data.json" "$TESTDIR/../data/location_node-data.json" \ | ||
> --auspice-config "$TESTDIR/../data/auspice_config1.json" \ | ||
> --output dataset.json &>/dev/null | ||
|
||
$ python3 "$TESTDIR/../../../../scripts/diff_jsons.py" "$TESTDIR/../data/dataset1.json" dataset.json \ | ||
> --exclude-paths "root['meta']['updated']" | ||
{} | ||
|
||
...same but with repeated --node-data options instead of a single multi-valued option | ||
|
||
$ ${AUGUR} export v2 \ | ||
> --tree "$TESTDIR/../data/tree.nwk" \ | ||
> --node-data "$TESTDIR/../data/div_node-data.json" \ | ||
> --node-data "$TESTDIR/../data/location_node-data.json" \ | ||
> --auspice-config "$TESTDIR/../data/auspice_config1.json" \ | ||
> --output dataset.json &>/dev/null | ||
|
||
$ python3 "$TESTDIR/../../../../scripts/diff_jsons.py" "$TESTDIR/../data/dataset1.json" dataset.json \ | ||
> --exclude-paths "root['meta']['updated']" | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
Setup | ||
|
||
$ source "$TESTDIR"/_setup.sh | ||
|
||
Export with auspice config JSON with an extensions block | ||
|
||
$ ${AUGUR} export v2 \ | ||
> --tree "$TESTDIR/../data/tree.nwk" \ | ||
> --node-data "$TESTDIR/../data/div_node-data.json" "$TESTDIR/../data/location_node-data.json" \ | ||
> --auspice-config "$TESTDIR/../data/auspice_config2.json" \ | ||
> --output dataset.json &>/dev/null | ||
|
||
$ python3 "$TESTDIR/../../../../scripts/diff_jsons.py" "$TESTDIR/../data/dataset2.json" dataset.json \ | ||
> --exclude-paths "root['meta']['updated']" | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
Setup | ||
|
||
$ source "$TESTDIR"/_setup.sh | ||
|
||
# auspice_config3.json is the same as auspice_config2.json but with an extra key which the schema does not allow. | ||
# Running without --skip-validation should result in an error | ||
# Message printed: "Validation of "$TESTDIR/../data/auspice_config3.json" failed." | ||
|
||
$ ${AUGUR} export v2 \ | ||
> --tree "$TESTDIR/../data/tree.nwk" \ | ||
> --node-data "$TESTDIR/../data/div_node-data.json" "$TESTDIR/../data/location_node-data.json" \ | ||
> --auspice-config "$TESTDIR/../data/auspice_config3.json" \ | ||
> --output dataset.json &>/dev/null | ||
[2] | ||
|
||
# Skipping validation gives us the same results as `auspice_config2.json` | ||
|
||
$ ${AUGUR} export v2 \ | ||
> --tree "$TESTDIR/../data/tree.nwk" \ | ||
> --node-data "$TESTDIR/../data/div_node-data.json" "$TESTDIR/../data/location_node-data.json" \ | ||
> --auspice-config "$TESTDIR/../data/auspice_config3.json" \ | ||
> --output dataset.json \ | ||
> --skip-validation &>/dev/null | ||
|
||
$ python3 "$TESTDIR/../../../../scripts/diff_jsons.py" "$TESTDIR/../data/dataset2.json" dataset.json \ | ||
> --exclude-paths "root['meta']['updated']" | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
Setup | ||
|
||
$ source "$TESTDIR"/_setup.sh | ||
|
||
Run export with metadata and external colors TSV that contains zero values. | ||
|
||
$ ${AUGUR} export v2 \ | ||
> --tree "$TESTDIR/../data/tree.nwk" \ | ||
> --node-data "$TESTDIR/../data/div_node-data.json" "$TESTDIR/../data/location_node-data.json" \ | ||
> --auspice-config "$TESTDIR/../data/auspice_config4.json" \ | ||
> --metadata "$TESTDIR/../data/zero_value_metadata.tsv" \ | ||
> --colors "$TESTDIR/../data/zero_value_colors.tsv" \ | ||
> --output dataset.json &> /dev/null | ||
|
||
$ python3 "$TESTDIR/../../../../scripts/diff_jsons.py" "$TESTDIR/../data/dataset3.json" dataset.json \ | ||
> --exclude-paths "root['meta']['updated']" "root['meta']['maintainers']" | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
Setup | ||
|
||
$ source "$TESTDIR"/_setup.sh | ||
|
||
Test that attributes are correctly exported as branch_attrs. Currently this includes branch labels (node_data→branches), | ||
mutations (node_data→nodes) and a historical node_data→nodes→<name>→clade_annotation branch label. | ||
|
||
$ ${AUGUR} export v2 \ | ||
> --tree "$TESTDIR/../data/tree.nwk" \ | ||
> --node-data "$TESTDIR/../data/div_node-data.json" "$TESTDIR/../data/nt_muts_1.json" "$TESTDIR/../data/aa_muts_1.json" "$TESTDIR/../data/branch-labels.json" \ | ||
> --maintainers "Nextstrain Team" \ | ||
> --output dataset.json > /dev/null | ||
|
||
$ python3 "$TESTDIR/../../../../scripts/diff_jsons.py" "$TESTDIR/../data/dataset-with-branch-labels.json" dataset.json \ | ||
> --exclude-paths "root['meta']['updated']" | ||
{} |
Oops, something went wrong.