Skip to content

Commit 404595d

Browse files
committed
Improve cram test output messages
As suggested by @huddlej in PR #902 Tests originally implemented by @corneliusroemer
1 parent cfa447e commit 404595d

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

tests/functional/export_v2.t

+13-8
Original file line numberDiff line numberDiff line change
@@ -110,26 +110,31 @@ This should fail with a helpful error message.
110110
ERROR: None of the possible id columns (('strain', 'name')) were found in the metadata's columns ('invalid_id', 'div', 'mutation_length')
111111
[1]
112112

113-
# export_v2/location_node-data2.json was produced by a mismatched version
114-
# Running without --skip-validation should result in an error
115-
# Message printed: "Validation of auspice_config3.json failed."
113+
Node-data JSONs produced from a different major version of augur
114+
are not allowed.
116115
$ ${AUGUR} export v2 \
117116
> --tree export_v2/tree.nwk \
118117
> --node-data export_v2/div_node-data.json export_v2/location_node-data2.json \
119118
> --auspice-config export_v2/auspice_config3.json \
120-
> --output "$TMP/dataset4.json" &>/dev/null
119+
> --output "$TMP/dataset4.json"
120+
ERROR: Augur version incompatibility detected: the JSON export_v2/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)
121121
[2]
122122

123-
# Skipping validation gives us the same results as `location_node-data.json`
123+
124+
Skipping validation allows mismatched augur versions to be used without error.
125+
(Note the stderr/stdout output is detailed here, including 2 empty lines)
124126
$ ${AUGUR} export v2 \
125127
> --tree export_v2/tree.nwk \
126128
> --node-data export_v2/div_node-data.json export_v2/location_node-data2.json \
127129
> --auspice-config export_v2/auspice_config2.json \
128130
> --output "$TMP/dataset5.json" \
129-
> --skip-validation &>/dev/null
130-
131+
> --skip-validation
132+
WARNING: You didn't provide information on who is maintaining this analysis.
133+
134+
135+
Check the output from the above command against its expected contents
131136
$ python3 "$TESTDIR/../../scripts/diff_jsons.py" export_v2/dataset2.json "$TMP/dataset5.json" \
132137
> --exclude-paths "root['meta']['updated']"
133138
{}
134139

135-
$ popd > /dev/null
140+
$ popd > /dev/null

0 commit comments

Comments
 (0)