05c7e605c01e595561c32690eb44a7512041e540 braney Wed Sep 23 09:34:08 2026 -0700 hubCheck: reject a bigBed type line that declares fewer than three fields, refs #36940 hgc already stops on "type bigBed 1" or "type bigBed 2", but hubCheck passed both, so a hub author only found out when a user clicked an item. Check the declared count against the minimum of three next to the existing check against the file's field count. A bare "type bigBed" does not reach this code and is unchanged. Adds a fieldCountTooFew test with bigBed 1 and bigBed 2 tracks. diff --git src/hg/utils/hubCheck/tests/makefile src/hg/utils/hubCheck/tests/makefile index 6e251d6b7a4..24ac7ce051b 100644 --- src/hg/utils/hubCheck/tests/makefile +++ src/hg/utils/hubCheck/tests/makefile @@ -1,99 +1,103 @@ kentSrc = ../../../.. include ../../../../inc/common.mk hubCheck = ${DESTBINDIR}/hubCheck -test:: one two errors supertrackChild genomesErrors badType badSubgroups autoScale noLongLabel badGroups goodGroups noCompositeGroup allowWarnings seqNameCheck noSeqNameCheck selfParent dotInName fieldCountMismatch relPath missingFile +test:: one two errors supertrackChild genomesErrors badType badSubgroups autoScale noLongLabel badGroups goodGroups noCompositeGroup allowWarnings seqNameCheck noSeqNameCheck selfParent dotInName fieldCountMismatch fieldCountTooFew relPath missingFile one: mkout -${hubCheck} input/hub1.txt > output/output1.txt diff expected/output1.txt output/output1.txt two: mkout -${hubCheck} input/hub2.txt > output/output2.txt 2> /dev/null diff expected/output2.txt output/output2.txt supertrackChild: mkout -${hubCheck} input/supertrackChild.txt > output/supertrackChild.txt 2> /dev/null diff expected/supertrackChild.txt output/supertrackChild.txt errors: mkout -${hubCheck} input/manyErrorsHub.txt > output/manyErrors.output.txt 2>/dev/null diff expected/manyErrors.output.txt output/manyErrors.output.txt genomesErrors: mkout -${hubCheck} input/genomesConfigErrorsHub.txt > output/genomesConfigErrors.output.txt 2>/dev/null diff expected/genomesConfigErrors.output.txt output/genomesConfigErrors.output.txt badType: mkout -${hubCheck} input/badType.txt > output/badType.output.txt 2>/dev/null diff expected/badType.output.txt output/badType.output.txt badSubgroups: mkout -${hubCheck} input/badSubGroups.txt > output/badSubGroups.output.txt 2>/dev/null diff expected/badSubGroups.output.txt output/badSubGroups.output.txt autoScale: mkout -${hubCheck} input/autoScaleHub.txt > output/autoScaleHub.output.txt 2>/dev/null diff expected/autoScaleHub.txt output/autoScaleHub.output.txt noLongLabel: mkout -${hubCheck} input/noLongLabel.txt > output/noLongLabel.txt diff expected/noLongLabel.txt output/noLongLabel.txt badGroups: mkout -${hubCheck} input/badGroups.txt > output/badGroups.output.txt 2>/dev/null diff expected/badGroups.output.txt output/badGroups.output.txt goodGroups: mkout -${hubCheck} input/goodGroups.txt > output/goodGroups.output.txt diff expected/goodGroups.output.txt output/goodGroups.output.txt noCompositeGroup: mkout -${hubCheck} input/noCompositeGroup.txt > output/noCompositeGroup.output.txt 2>/dev/null diff expected/noCompositeGroup.output.txt output/noCompositeGroup.output.txt allowWarnings: mkout ${hubCheck} -allowWarnings input/supertrackChild.txt > output/allowWarnings.output.txt 2> /dev/null diff expected/allowWarnings.output.txt output/allowWarnings.output.txt seqNameCheck: mkout -${hubCheck} input/seqNameHub.txt > output/seqNameCheck.output.txt 2>/dev/null diff expected/seqNameCheck.output.txt output/seqNameCheck.output.txt noSeqNameCheck: mkout -${hubCheck} -noSeqNameCheck input/seqNameHub.txt > output/noSeqNameCheck.output.txt 2>/dev/null diff expected/noSeqNameCheck.output.txt output/noSeqNameCheck.output.txt selfParent: mkout -${hubCheck} input/selfParent.txt > output/selfParent.output.txt 2>/dev/null diff expected/selfParent.output.txt output/selfParent.output.txt dotInName: mkout -${hubCheck} input/dotInName.txt > output/dotInName.output.txt 2>/dev/null diff expected/dotInName.output.txt output/dotInName.output.txt fieldCountMismatch: mkout -cd input && ${hubCheck} fieldCountMismatch.txt > ../output/fieldCountMismatch.output.txt 2>/dev/null diff expected/fieldCountMismatch.output.txt output/fieldCountMismatch.output.txt +fieldCountTooFew: mkout + -cd input && ${hubCheck} fieldCountTooFew.txt > ../output/fieldCountTooFew.output.txt 2>/dev/null + diff expected/fieldCountTooFew.output.txt output/fieldCountTooFew.output.txt + # A hub reached by a relative path, with its data file in a subdirectory below # hub.txt. Deliberately NOT run from inside input/, because the point is to check # that the hub directory is prepended to bigDataUrl once and not twice. The # expected output is a field count mismatch, which hubCheck can only report if it # found and opened the file. relPath: mkout -${hubCheck} input/relPath/hub.txt > output/relPath.output.txt 2>/dev/null diff expected/relPath.output.txt output/relPath.output.txt # A bigDataUrl that does not exist has to be reported. hubCheck used to prune such a # track out of the list before it ever got checked, and then exited 0 saying nothing. missingFile: mkout -${hubCheck} input/relPath/missingFile.txt > output/missingFile.output.txt 2>/dev/null diff expected/missingFile.output.txt output/missingFile.output.txt mkout:: @mkdir -p output clean:: rm -rf output