2d0e3b500f8e1d5f1ecf372797f942204fa729b8 hiram Thu May 2 10:08:25 2019 -0700 correctly manage list chromosomes function with various table types refs #18869 diff --git src/hg/hubApi/tests/makefile src/hg/hubApi/tests/makefile index 7f565e6..81823ef 100644 --- src/hg/hubApi/tests/makefile +++ src/hg/hubApi/tests/makefile @@ -1,24 +1,25 @@ -test:: test0 test1 test2 test3 test4 test5 test6 test7 test8 test9 test10 \ - test11 test12 test13 test14 test15 test16 test19 test21 test22 test23 \ - test26 test27 test28 test29 test30 test31 test39 test40 \ +test:: test0 test6 test7 test8 test9 test10 \ + test11 test12 test13 test14 test15 test16 test19 test21 \ + test26 test27 test28 test29 test39 test40 \ listFunctions getFunctions getSequence wigData errorTests all:: listFunctions getFunctions getSequence wigData errorTests -listFunctions: test1 test2 test3 test4 test5 test22 test23 test30 test31 +listFunctions: list01 list02 list03 list04 list05 list06 list07 list08 list09 \ + list10 list11 list12 list13 list14 list15 getFunctions: test6 test7 test8 test9 test10 test11 test12 test13 test14 \ test15 test16 test19 test21 test26 test27 test28 \ test29 test39 test40 getSequence: getSeq01 getSeq02 getSeq03 wigData: wig01 wig02 wig03 wig04 wig05 wig06 wig07 wig08 wig09 wig10 \ wig11 wig12 wig13 wig14 wig15 wig16 wig17 wig18 wig19 wig20 \ wig21 wig22 wig23 wig24 errorTests: err01 err02 err03 err04 err05 err06 err07 err08 err09 err10 \ err11 err12 err13 err14 err15 err16 err17 err18 err19 err20 \ err21 err22 err23 err24 err25 err26 err27 err28 err29 @@ -28,55 +29,125 @@ @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 @echo '### test0: ./jsonConsumer.pl -test0 - OK' +################################################### list functions ########### # testing /list/hubGenomes -test1: setOutput - @./jsonConsumer.pl -hubUrl=http://genome-test.gi.ucsc.edu/~hiram/hubs/Plants/hub.txt -endpoint="/list/hubGenomes" | egrep -v "${excludeLines}" | gzip -c > testOutput/$@.gz +list01: setOutput + @printf "### $@ 'https://hgwdev-hiram.gi.ucsc.edu/cgi-bin/hubApi/list/hubGenomes?hubUrl=http://genome-test.gi.ucsc.edu/~hiram/hubs/Plants/hub.txt'\n" + @./jsonConsumer.pl -hubUrl=http://genome-test.gi.ucsc.edu/~hiram/hubs/Plants/hub.txt -endpoint="/list/hubGenomes" 2>&1 | egrep -v "${excludeLines}" | sed -e 's#https://.*/list#/list#;' | gzip -c > testOutput/$@.gz @zdiff expected/$@.gz testOutput/$@.gz # testing /list/tracks? hubUrl genome=_araTha1 trackLeavesOnly -test2: setOutput - @./jsonConsumer.pl -hubUrl=http://genome-test.gi.ucsc.edu/~hiram/hubs/Plants/hub.txt -endpoint="/list/tracks" -genome="_araTha1" -trackLeavesOnly | egrep -v "${excludeLines}" | gzip -c > testOutput/$@.gz +list02: setOutput + @printf "### $@ 'https://hgwdev-hiram.gi.ucsc.edu/cgi-bin/hubApi/list/tracks?trackLeavesOnly=1;genome=_araTha1;hubUrl=http://genome-test.gi.ucsc.edu/~hiram/hubs/Plants/hub.txt'\n" + @./jsonConsumer.pl -hubUrl=http://genome-test.gi.ucsc.edu/~hiram/hubs/Plants/hub.txt -endpoint="/list/tracks" -genome="_araTha1" -trackLeavesOnly 2>&1 | egrep -v "${excludeLines}" | sed -e 's#https://.*/list#/list#;' | gzip -c > testOutput/$@.gz @zdiff expected/$@.gz testOutput/$@.gz # testing /list/tracks?genome=ce11 trackLeavesOnly=1 -test3: setOutput - @./jsonConsumer.pl -endpoint="/list/tracks" -genome="ce11" -trackLeavesOnly | egrep -v "${excludeLines}" | gzip -c > testOutput/$@.gz +list03: setOutput + @printf "### $@ 'https://hgwdev-hiram.gi.ucsc.edu/cgi-bin/hubApi/list/tracks?trackLeavesOnly=1;genome=ce11'\n" + @./jsonConsumer.pl -endpoint="/list/tracks" -genome="ce11" -trackLeavesOnly 2>&1 | egrep -v "${excludeLines}" | sed -e 's#https://.*/list#/list#;' | gzip -c > testOutput/$@.gz @zdiff expected/$@.gz testOutput/$@.gz # testing /list/chromosomes?genome=ce11 -test4: setOutput - @./jsonConsumer.pl -endpoint="/list/chromosomes" -genome="ce11" | egrep -v "${excludeLines}" | gzip -c > testOutput/$@.gz +list04: setOutput + @printf "### $@ 'https://hgwdev-hiram.gi.ucsc.edu/cgi-bin/hubApi/list/chromosomes?genome=ce11'\n" + @./jsonConsumer.pl -endpoint="/list/chromosomes" -genome="ce11" 2>&1 | egrep -v "${excludeLines}" | sed -e 's#https://.*/list#/list#;' | gzip -c > testOutput/$@.gz @zdiff expected/$@.gz testOutput/$@.gz # testing /list/chromosomes?genome=ce11&track=gold -test5: setOutput - @./jsonConsumer.pl -endpoint="/list/chromosomes" -genome="ce11" -track="gold" | egrep -v "${excludeLines}" | gzip -c > testOutput/$@.gz +list05: setOutput + @printf "### $@ 'https://hgwdev-hiram.gi.ucsc.edu/cgi-bin/hubApi/list/chromosomes?track=gold;genome=ce11'\n" + @./jsonConsumer.pl -endpoint="/list/chromosomes" -genome="ce11" -track="gold" 2>&1 | egrep -v "${excludeLines}" | sed -e 's#https://.*/list#/list#;' | gzip -c > testOutput/$@.gz @zdiff expected/$@.gz testOutput/$@.gz +# testing /list/chromosomes? hubUrl genome=_araTha1 +list06: setOutput + @printf "### $@ 'https://hgwdev-hiram.gi.ucsc.edu/cgi-bin/hubApi/list/chromosomes?genome=_araTha1;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" -genome="_araTha1" 2>&1 | egrep -v "${excludeLines}" | sed -e 's#https://.*/list#/list#;' | gzip -c > testOutput/$@.gz + @zdiff expected/$@.gz testOutput/$@.gz + +# testing /list/chromosomes? hubUrl genome=_araTha1 track=assembly_ +list07: setOutput + @printf "### $@ 'https://hgwdev-hiram.gi.ucsc.edu/cgi-bin/hubApi/list/chromosomes?track=assembly_;genome=_araTha1;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" -genome="_araTha1" -track="assembly_" 2>&1 | egrep -v "${excludeLines}" | sed -e 's#https://.*/list#/list#;' | gzip -c > testOutput/$@.gz + @zdiff expected/$@.gz testOutput/$@.gz + +# testing /list/tracks? hubUrl genome=_araTha1 +list08: setOutput + @printf "### $@ 'https://hgwdev-hiram.gi.ucsc.edu/cgi-bin/hubApi/list/tracks?genome=_araTha1;hubUrl=http://genome-test.gi.ucsc.edu/~hiram/hubs/Plants/hub.txt'\n" + @./jsonConsumer.pl -hubUrl=http://genome-test.gi.ucsc.edu/~hiram/hubs/Plants/hub.txt -endpoint="/list/tracks" -genome="_araTha1" 2>&1 | egrep -v "${excludeLines}" | sed -e 's#https://.*/list#/list#;' | gzip -c > testOutput/$@.gz + @zdiff expected/$@.gz testOutput/$@.gz + +# testing /list/tracks?genome=ce11 +list09: setOutput + @printf "### $@ 'https://hgwdev-hiram.gi.ucsc.edu/cgi-bin/hubApi/list/tracks?genome=ce11'\n" + @./jsonConsumer.pl -endpoint="/list/tracks" -genome="ce11" 2>&1 | egrep -v "${excludeLines}" | sed -e 's#https://.*/list#/list#;' | gzip -c > testOutput/$@.gz + @zdiff expected/$@.gz testOutput/$@.gz + +# testing /list/chromosomes?genome=ce11&track=mrna SQL table name is all_mrna +list10: setOutput + @printf "### $@ 'https://hgwdev-hiram.gi.ucsc.edu/cgi-bin/hubApi/list/chromosomes?track=mrna;genome=ce11'\n" + @./jsonConsumer.pl -endpoint="/list/chromosomes" -genome="ce11" -track="mrna" 2>&1 | egrep -v "${excludeLines}" | sed -e 's#https://.*/list#/list#;' | gzip -c > testOutput/$@.gz + @zdiff expected/$@.gz testOutput/$@.gz + +# testing /list/chromosomes?genome=ce4&track=mrna SQL table name is all_mrna +# and ce4 has split tables +list11: setOutput + @printf "### $@ 'https://hgwdev-hiram.gi.ucsc.edu/cgi-bin/hubApi/list/chromosomes?track=mrna;genome=ce4'\n" + @./jsonConsumer.pl -endpoint="/list/chromosomes" -genome="ce4" -track="mrna" 2>&1 | egrep -v "${excludeLines}" | sed -e 's#https://.*/list#/list#;' | gzip -c > testOutput/$@.gz + @zdiff expected/$@.gz testOutput/$@.gz + +# testing /list/chromosomes?genome=ce11&track=rmsk different chrom name column +list12: setOutput + @printf "### $@ 'https://hgwdev-hiram.gi.ucsc.edu/cgi-bin/hubApi/list/chromosomes?track=rmsk;genome=ce11'\n" + @./jsonConsumer.pl -endpoint="/list/chromosomes" -genome="ce11" -track="rmsk" 2>&1 | egrep -v "${excludeLines}" | sed -e 's#https://.*/list#/list#;' | gzip -c > testOutput/$@.gz + @zdiff expected/$@.gz testOutput/$@.gz + +# testing /list/chromosomes?genome=ce4&track=rmsk different chrom name column +# and ce4 has split tables +list13: setOutput + @printf "### $@ 'https://hgwdev-hiram.gi.ucsc.edu/cgi-bin/hubApi/list/chromosomes?track=rmsk;genome=ce4'\n" + @./jsonConsumer.pl -endpoint="/list/chromosomes" -genome="ce4" -track="rmsk" 2>&1 | egrep -v "${excludeLines}" | sed -e 's#https://.*/list#/list#;' | gzip -c > testOutput/$@.gz + @zdiff expected/$@.gz testOutput/$@.gz + +# testing /list/chromosomes?genome=ce11&track=est different chrom name column +list14: setOutput + @printf "### $@ 'https://hgwdev-hiram.gi.ucsc.edu/cgi-bin/hubApi/list/chromosomes?track=est;genome=ce11'\n" + @./jsonConsumer.pl -endpoint="/list/chromosomes" -genome="ce11" -track="est" 2>&1 | egrep -v "${excludeLines}" | sed -e 's#https://.*/list#/list#;' | gzip -c > testOutput/$@.gz + @zdiff expected/$@.gz testOutput/$@.gz + +# testing /list/chromosomes?genome=ce4&track=est different chrom name column +# and ce4 has split tables +list15: setOutput + @printf "### $@ 'https://hgwdev-hiram.gi.ucsc.edu/cgi-bin/hubApi/list/chromosomes?track=est;genome=ce4'\n" + @./jsonConsumer.pl -endpoint="/list/chromosomes" -genome="ce4" -track="est" 2>&1 | egrep -v "${excludeLines}" | sed -e 's#https://.*/list#/list#;' | gzip -c > testOutput/$@.gz + @zdiff expected/$@.gz testOutput/$@.gz + +########################## getData functions ############################# # testing /getData/sequence?genome=ce11&chrom=chrM test6: setOutput @./jsonConsumer.pl -endpoint="/getData/sequence" -genome="ce11" -chrom="chrM" | egrep -v "${excludeLines}" | gzip -c > testOutput/$@.gz @zdiff expected/$@.gz testOutput/$@.gz # testing /getData/sequence?genome=ce11&chrom=chrM&start=1&end=128 test7: setOutput @./jsonConsumer.pl -endpoint="/getData/sequence" -genome="ce11" -chrom="chrM" -start=1 -end=128 | egrep -v "${excludeLines}" | gzip -c > testOutput/$@.gz @zdiff expected/$@.gz testOutput/$@.gz # testing /getData/track?genome=ce11&track=gold test8: setOutput @./jsonConsumer.pl -maxItemsOutput=123 -endpoint="/getData/track" -genome="ce11" -track="gold" | egrep -v "${excludeLines}" | gzip -c > testOutput/$@.gz @zdiff expected/$@.gz testOutput/$@.gz @@ -121,74 +192,54 @@ @zdiff expected/$@.gz testOutput/$@.gz # bigBed data from a database # /getData/track? genome=galGal6 &track=ncbiRefSeqOther&chrom=chr1&start=750000&end=5700000 test19: setOutput @./jsonConsumer.pl -endpoint="/getData/track" -genome="galGal6" -track="ncbiRefSeqOther" -chrom="chr1" -start=750000 -end=55700000 | egrep -v "${excludeLines}" | gzip -c > testOutput/$@.gz @zdiff expected/$@.gz testOutput/$@.gz # wiggle data from a database where the SQL table name is different than the # track name # /getData/track? genome=hg19 &track=wgEncodeRegMarkH3k4me1H1hesc&chrom=chr1&start=62300000&end=62301000 test21: setOutput @./jsonConsumer.pl -endpoint="/getData/track" -genome="hg19" -track="wgEncodeRegMarkH3k4me1H1hesc" -chrom="chr1" -start=62300000 -end=62301000 | egrep -v "${excludeLines}" | gzip -c > testOutput/$@.gz @zdiff expected/$@.gz testOutput/$@.gz -# testing /list/chromosomes? hubUrl genome=_araTha1 -test22: setOutput - @./jsonConsumer.pl -endpoint="/list/chromosomes" -hubUrl="http://genome-test.gi.ucsc.edu/~hiram/hubs/Plants/hub.txt" -genome="_araTha1" | egrep -v "${excludeLines}" | gzip -c > testOutput/$@.gz - @zdiff expected/$@.gz testOutput/$@.gz - -# testing /list/chromosomes? hubUrl genome=_araTha1 track=assembly_ -test23: setOutput - @./jsonConsumer.pl -endpoint="/list/chromosomes" -hubUrl="http://genome-test.gi.ucsc.edu/~hiram/hubs/Plants/hub.txt" -genome="_araTha1" -track="assembly_" | egrep -v "${excludeLines}" | gzip -c > testOutput/$@.gz - @zdiff expected/$@.gz testOutput/$@.gz - # testing genePred track # /getData/track?genome=ce11&chrom=chrV&track=refGene&start=5231045&end=5241045 test26: setOutput @./jsonConsumer.pl -endpoint="/getData/track" -genome="ce11" -track="refGene" -chrom="chrV" -start=5231045 -end=5241045 | egrep -v "${excludeLines}" | gzip -c > testOutput/$@.gz @zdiff expected/$@.gz testOutput/$@.gz # testing PSL track # /getData/track?genome=ce11&chrom=chrV&track=ncbiRefSeqPsl&start=5231045&end=5241045 test27: setOutput @./jsonConsumer.pl -endpoint="/getData/track" -genome="ce11" -track="ncbiRefSeqPsl" -chrom="chrV" -start=5231045 -end=5241045 | egrep -v "${excludeLines}" | gzip -c > testOutput/$@.gz @zdiff expected/$@.gz testOutput/$@.gz # testing RMSK track # /getData/track?genome=ce11&debug=0&chrom=chrV&track=rmsk&start=5231045&end=5241045 test28: setOutput @./jsonConsumer.pl -endpoint="/getData/track" -genome="ce11" -track="rmsk" -chrom="chrV" -start=5231045 -end=5241045 | egrep -v "${excludeLines}" | gzip -c > testOutput/$@.gz @zdiff expected/$@.gz testOutput/$@.gz # test superTrack child getData # /getData/track?genome=ce11&chrom=chrV&track=cpgIslandExt&start=5001045&end=5241045 test29: setOutput @./jsonConsumer.pl -endpoint="/getData/track" -genome="ce11" -track="cpgIslandExt" -chrom="chrV" -start=5001045 -end=5241045 | egrep -v "${excludeLines}" | gzip -c > testOutput/$@.gz @zdiff expected/$@.gz testOutput/$@.gz -# testing /list/tracks? hubUrl genome=_araTha1 -test30: setOutput - @./jsonConsumer.pl -hubUrl=http://genome-test.gi.ucsc.edu/~hiram/hubs/Plants/hub.txt -endpoint="/list/tracks" -genome="_araTha1" | egrep -v "${excludeLines}" | gzip -c > testOutput/$@.gz - @zdiff expected/$@.gz testOutput/$@.gz - -# testing /list/tracks?genome=ce11 -test31: setOutput - @./jsonConsumer.pl -endpoint="/list/tracks" -genome="ce11" | egrep -v "${excludeLines}" | gzip -c > testOutput/$@.gz - @zdiff expected/$@.gz testOutput/$@.gz - # testing /getData/track?genome=ce4&track=gold for split table operation test39: setOutput @./jsonConsumer.pl -maxItemsOutput=123 -endpoint="/getData/track" -genome="ce4" -track="gold" | egrep -v "${excludeLines}" | gzip -c > testOutput/$@.gz @zdiff expected/$@.gz testOutput/$@.gz # testing /getData/track?genome=ce4&track=gold for split table operation # plus jsonArrayOutput test40: setOutput @./jsonConsumer.pl -jsonOutputArrays -maxItemsOutput=123 -endpoint="/getData/track" -genome="ce4" -track="gold" | egrep -v "${excludeLines}" | gzip -c > testOutput/$@.gz @zdiff expected/$@.gz testOutput/$@.gz ############################################################################### # /getData/sequence testing ############################################################################### # testing /getData/sequence? hubUrl genome=hg19&chrom=chrCp&start=4321&end=5647