d92ba8d3eb476aeeaaa7a52cf097bb8b3ba6ba46 hiram Wed Apr 24 14:30:00 2019 -0700 all errors checked in list function refs #18869 diff --git src/hg/hubApi/tests/makefile src/hg/hubApi/tests/makefile index 6447d3d..a67189d 100644 --- src/hg/hubApi/tests/makefile +++ src/hg/hubApi/tests/makefile @@ -5,31 +5,32 @@ test27 test28 test29 test30 \ test31 test39 test40 \ test41 test42 test42 getSequence errorTests all:: listFunctions getFunctions getSequence errorTests listFunctions: test1 test2 test3 test4 test5 test22 test23 test30 test31 getFunctions: test6 test7 test8 test9 test10 test11 test12 test13 test14 \ test15 test16 test17 test18 test19 test21 test26 test27 test28 \ test29 test39 test40 test41 test42 getSequence: getSeq01 getSeq02 getSeq03 errorTests: err01 err02 err03 err04 err05 err06 err07 err08 err09 err10 \ - err11 err12 err13 err14 err15 err16 + err11 err12 err13 err14 err15 err16 err17 err18 err19 err20 \ + err21 err22 err23 err24 err25 setOutput: @if [ ! -d testOutput ]; then mkdir testOutput; fi clean:: rm -f testOutput/*.gz rmdir testOutput # exclude these lines from the JSON output for comparison with expected excludeLines = downloadTime|dataTime # testing /list/noSubCommand, /list/publicHubs and /list/ucscGenomes test0: setOutput @./jsonConsumer.pl -test0 2>&1 | sed -e 's#https://.*/list#/list#;' | egrep -v "${excludeLines}" | gzip -c > testOutput/$@.gz @zdiff expected/$@.gz testOutput/$@.gz @@ -318,20 +319,70 @@ @./jsonConsumer.pl -maxItemsOutput=0 -endpoint="/getData/track" -db="ce6" -track=gold 2>&1 | egrep -v "${excludeLines}" | sed -e 's#https://.*/getData#/getData#;' | gzip -c > testOutput/$@.gz @zdiff expected/$@.gz testOutput/$@.gz # testing /getData/tracks?db=ce6 - error test no such function on endpoint err15: setOutput @printf "### $@ https://hgwdev-api.gi.ucsc.edu/getData/tracks?db=ce6;track=gold\n" @./jsonConsumer.pl -endpoint="/getData/tracks" -db="ce6" -track=gold 2>&1 | egrep -v "${excludeLines}" | sed -e 's#https://.*/getData#/getData#;' | gzip -c > testOutput/$@.gz @zdiff expected/$@.gz testOutput/$@.gz # testing /list/endpoints - error test no such function err16: setOutput @printf "### $@ https://hgwdev-api.gi.ucsc.edu/list/endpoints\n" @./jsonConsumer.pl -endpoint="/list/endpoints" 2>&1 | egrep -v "${excludeLines}" | sed -e 's#https://.*/list#/list#;' | gzip -c > testOutput/$@.gz @zdiff expected/$@.gz testOutput/$@.gz -# testing /list/endpoints - error test no such function +# testing /list/hubGenomes with hubUrl but no genome specified err17: setOutput - @printf "### $@ https://hgwdev-api.gi.ucsc.edu/noSuchCommand\n" - @./jsonConsumer.pl -endpoint="/noSuchCommand" 2>&1 | egrep -v "${excludeLines}" | sed -e 's#https://.*/list#/list#;' | gzip -c > testOutput/$@.gz + @printf "### $@ 'https://hgwdev-api.gi.ucsc.edu/list/hubGenomes?genome=araTha1'\n" + @./jsonConsumer.pl -endpoint="/list/tracks" -hubUrl="http://genome-test.gi.ucsc.edu/~hiram/hubs/GillBejerano/hub.txt" 2>&1 | sed -e 's#https://.*/list#/list#;' | egrep -v "${excludeLines}" | gzip -c > testOutput/$@.gz + @zdiff expected/$@.gz testOutput/$@.gz + +# testing /list/chromosomes? hubUrl missing genome= +err18: setOutput + @printf "### $@ https://hgwdev-api.gi.ucsc.edu/list/chromosomes?hubUrl=http://genome-test.gi.ucsc.edu/~hiram/hubs/Plants/hub.txt\n" + @./jsonConsumer.pl -endpoint="/list/chromosomes" -hubUrl="http://genome-test.gi.ucsc.edu/~hiram/hubs/Plants/hub.txt" | egrep -v "${excludeLines}" | sed -e 's#https://.*/list#/list#;' | gzip -c > testOutput/$@.gz + @zdiff expected/$@.gz testOutput/$@.gz + +# testing /list/chromosomes? hubUrl missing incorrect genome=araTha +err19: setOutput + @printf "### $@ https://hgwdev-api.gi.ucsc.edu/list/chromosomes?hubUrl=http://genome-test.gi.ucsc.edu/~hiram/hubs/Plants/hub.txt;genome=araTha\n" + @./jsonConsumer.pl -endpoint="/list/chromosomes" -hubUrl="http://genome-test.gi.ucsc.edu/~hiram/hubs/Plants/hub.txt" -genome=araTha 2>&1 | egrep -v "${excludeLines}" | sed -e 's#https://.*/list#/list#;' | gzip -c > testOutput/$@.gz + @zdiff expected/$@.gz testOutput/$@.gz + +# testing /list/chromosomes? hubUrl can not +# find specified track for genome=_braRap1 track=_assembly (wrong name) +err20: setOutput + @printf "### $@ https://hgwdev-api.gi.ucsc.edu/list/chromosomes?hubUrl=http://genome-test.gi.ucsc.edu/~hiram/hubs/bPlants/hub.txt;genome=_braRap1;track=_assembly\n" + @./jsonConsumer.pl -endpoint="/list/chromosomes" -hubUrl="http://genome-test.gi.ucsc.edu/~hiram/hubs/bPlants/hub.txt" -genome=_braRap1 -track=_assembly 2>&1 | egrep -v "${excludeLines}" | sed -e 's#https://.*/list#/list#;' | gzip -c > testOutput/$@.gz + @zdiff expected/$@.gz testOutput/$@.gz + +# testing /list/chromosomes? hubUrl can not +# find specified database in track hub +err21: setOutput + @printf "### $@ http://genome-test.gi.ucsc.edu/~hiram/hubs/GillBejerano/hub.txt?genome=hg19\n" + @./jsonConsumer.pl -endpoint="/list/chromosomes" -hubUrl="http://genome-test.gi.ucsc.edu/~hiram/hubs/GillBejerano/hub.txt" -genome=hg19 2>&1 | egrep -v "${excludeLines}" | sed -e 's#https://.*/list#/list#;' | gzip -c > testOutput/$@.gz + @zdiff expected/$@.gz testOutput/$@.gz + +# testing /list/chromosomes? bad hubUrl +err22: setOutput + @printf "### $@ http://genome-test.gi.ucsc.edu/~hiram/hubs/xGillBejerano/hub.txt\n" + @./jsonConsumer.pl -endpoint="/list/chromosomes" -hubUrl="http://genome-test.gi.ucsc.edu/~hiram/hubs/xGillBejerano/hub.txt" 2>&1 | egrep -v "${excludeLines}" | sed -e 's#https://.*/list#/list#;' | gzip -c > testOutput/$@.gz + @zdiff expected/$@.gz testOutput/$@.gz + +# testing /list/chromosomes? db=ce11 track=gbLoaded - not a position track +err23: setOutput + @printf "### $@ 'https://hgwdev-api.gi.ucsc.edu/list/chromosomes?db=ce11;track=gbLoaded'\n" + @./jsonConsumer.pl -endpoint="/list/chromosomes" -db=ce11 -track=gbLoaded 2>&1 | egrep -v "${excludeLines}" | sed -e 's#https://.*/list#/list#;' | gzip -c > testOutput/$@.gz + @zdiff expected/$@.gz testOutput/$@.gz + +# testing /list/hubGenomes illegal db=araTha1 +err24: setOutput + @printf "### $@ 'https://hgwdev-api.gi.ucsc.edu/list/hubGenomes?hubUrl=http://genome-test.gi.ucsc.edu/~hiram/hubs/GillBejerano/hub.txt'\n" + @./jsonConsumer.pl -hubUrl="http://genome-test.gi.ucsc.edu/~hiram/hubs/GillBejerano/hub.txt" -endpoint="/list/hubGenomes" -db=araTha1 2>&1 | sed -e 's#https://.*/list#/list#;' | egrep -v "${excludeLines}" | gzip -c > testOutput/$@.gz + @zdiff expected/$@.gz testOutput/$@.gz + +# testing /list/chromosomes missing hubUrl or db +err25: setOutput + @printf "### $@ 'https://hgwdev-api.gi.ucsc.edu/list/chromosomes'\n" + @./jsonConsumer.pl -endpoint="/list/chromosomes" 2>&1 | egrep -v "${excludeLines}" | sed -e 's#https://.*/list#/list#;' | gzip -c > testOutput/$@.gz @zdiff expected/$@.gz testOutput/$@.gz