Skip to content

Commit

Permalink
Merge branch 'trs/merge/tests'
Browse files Browse the repository at this point in the history
  • Loading branch information
tsibley committed Sep 6, 2024
2 parents 2476aea + 81db604 commit 1f8fa35
Showing 1 changed file with 25 additions and 23 deletions.
48 changes: 25 additions & 23 deletions tests/functional/merge/cram/merge.t
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
SETUP

$ export AUGUR="${AUGUR:-$TESTDIR/../../../../bin/augur}"
$ set -o pipefail


BASIC USAGE
Expand Down Expand Up @@ -183,29 +184,6 @@ Metadata field values with metachars (field or record delimiters) are handled pr
x" 1 1
two X2a X2b X2c 1 1

Output column renamed when it conflicts with id column.

$ cat >id-and-strain.csv <<~~
> id,strain
> one,1
> two,2
> three,3
> ~~
$ ${AUGUR} merge \
> --metadata strain-only=x.tsv id-and-strain=id-and-strain.csv \
> --metadata-id-columns id strain \
> --output-metadata - | csv2tsv --csv-delim $'\t' | tsv-pretty
ERROR: Non-id column names in metadata inputs may not conflict with the
output id column name ('strain', the first input's id column).

The following input column would conflict:

'strain' in metadata table 'id-and-strain' (id column: 'id')

Please rename or drop the conflicting column before merging.
Renaming may be done with `augur curate rename`.



ERROR HANDLING

Expand Down Expand Up @@ -323,6 +301,30 @@ No id column found.
ERROR: x-id-column.tsv: None of the possible id columns ('strain') were found in the metadata's columns ('id', 'a', 'b', 'c').
[2]

Non-id column names conflicting with output id column name.

$ cat >id-and-strain.csv <<~~
> id,strain
> one,1
> two,2
> three,3
> ~~
$ ${AUGUR} merge \
> --metadata strain-only=x.tsv id-and-strain=id-and-strain.csv \
> --metadata-id-columns id strain \
> --output-metadata /dev/null --quiet
ERROR: Non-id column names in metadata inputs may not conflict with the
output id column name ('strain', the first input's id column).

The following input column would conflict:

'strain' in metadata table 'id-and-strain' (id column: 'id')

Please rename or drop the conflicting column before merging.
Renaming may be done with `augur curate rename`.

[2]

SQLITE3 env var can be used to override `sqlite3` location (and failure is
handled).

Expand Down

0 comments on commit 1f8fa35

Please sign in to comment.