theory / tap-parser-sourcehandler-pgtap

TAP::Parser::SourceHandler::pgTAP
http://search.cpan.org/dist/TAP::Parser::SourceHandler::pgTAP
11 stars 13 forks source link

pg_prove There is a tie between TAP::Parser::SourceHandler::Perl and TAP::Parser::SourceHandler::pgTAP #28

Closed xenoterracide closed 3 years ago

xenoterracide commented 4 years ago

got this error when my tests weren't named .pg and I hadn't set --ext

pg_prove There is a tie between TAP::Parser::SourceHandler::Perl and TAP::Parser::SourceHandler::pgTAP
Calebs-MBP:service-db-main-migration calebcushing$  docker run -e POSTGRES_PASSWORD="DontUseThisPassword" xenoterracide/pg_prove:latest pg_prove --version
pg_prove 3.35
Calebs-MBP:service-db-main-migration calebcushing$  docker run -e POSTGRES_PASSWORD="DontUseThisPassword" xenoterracide/pg_prove:latest perl --version

This is perl 5, version 30, subversion 2 (v5.30.2) built for x86_64-linux-gnu
theory commented 4 years ago

What extension did you use? If it's known to neither, it is going be a tie because the score for both will be zero.

xenoterracide commented 4 years ago

I used .sql

theory commented 4 years ago

I happened to run into the same issue myself the other day, but now I can't remember what the fix was. I think something was missing. It works when you use --ext?

xenoterracide commented 4 years ago

yes --ext was missing (or wrong, might have been wrong sql instead of .sql), if this can't be fixed, would be good to document.

theory commented 4 years ago

I don't remember now what the issue was. :-( It wasn't a bug, though, something was missing, and if I could recall what it was I would document it. Will keep this open until/unless I stumble on it again.

theory commented 3 years ago

TAP::Parser::SourceHandler::pgTAP ranks as follows:

  1    if it's not a file and starts with "pgsql:".
  1    if it has a suffix equal to that in a "suffix" config
  0.9  if its suffix is ".pg"
  0.8  if its suffix is ".sql"
  0.75 if its suffix is ".s"

TAP::Parser::SourceHandler::Perl ranks as follows:

  0.9  if it has a shebang ala "#!...perl"
  0.3  if it has any shebang
  0.8  if it's a .t file
  0.9  if it's a .pl file
  0.75 if it's in a 't' directory
  0.25 by default (backwards compat)

Looks like it would tie if you put .sql files in a t directory. I suggest renaming the directory test — or just use --ext.