Re: State of DBI::Test

"H.Merijn Brand" <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.dbi.sybase.devel
Message-ID <[email protected]>
On Tue, 6 Aug 2013 09:46:39 +0200, "H.Merijn Brand"
<[email protected]> wrote:

> On Mon, 5 Aug 2013 19:06:33 +0200, Jens Rehsack <[email protected]>
> wrote:
> 
> > Hi,
> > 
> > everybody who concern: from my point of view, DBI::Test is ready for first release to the world.
> > It's not suitable to wait until it's perfect - the strategy is, to release early and hopefully often with usable extensions.
> > 
> > If there're no objections, I upload DBI-Test-0.001.tar.gz tomorrow morning.
> > 
> > For everybody who wants to see the state and how it's used, the dbi-test branches of DBI and SQL-Statement shows a rough how-to.
> > 
> > Cheers
> 
> Just a quick run on the git checkout using the default environment (no
> bleading edge in $PERL5LIB) - I had to force-reinstall DBD::mysql :
> 
> Just to see if all my database interfaces work as expected:
> 
> Tie-Hash-DBD > make test
> /pro/bin/perl5.18.0 "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
> t/00_pod.t ...... ok
> t/01_pod.t ...... ok
> t/10_load.t ..... ok
> t/20_SQLite.t ... ok
> t/21_bulk.t ..... ok
> t/22_stream.t ... ok
> t/23_persist.t .. ok
> t/25_SQLite.t ... ok
> t/26_autoc.t .... ok
> t/30_Pg.t ....... ok
> t/31_bulk.t ..... ok
> t/32_stream.t ... ok
> t/33_persist.t .. ok
> t/35_Pg.t ....... ok
> t/36_autoc.t .... ok
> t/40_CSV.t ...... ok
> t/41_bulk.t ..... ok
> t/42_stream.t ... ok
> t/43_persist.t .. ok
> t/45_CSV.t ...... ok
> t/50_mysql.t .... ok
> t/51_bulk.t ..... ok
> t/52_stream.t ... ok
> t/53_persist.t .. ok
> t/55_mysql.t .... ok
> t/56_autoc.t .... ok
> t/60_Oracle.t ... skipped: Not a testable ORACLE env
> t/61_bulk.t ..... skipped: Not a testable ORACLE env
> t/62_stream.t ... skipped: Not a testable ORACLE env
> t/63_persist.t .. skipped: Not a testable ORACLE env
> t/65_Oracle.t ... skipped: Not a testable ORACLE env
> t/66_autoc.t .... skipped: Not a testable ORACLE env

In an Oracle env

t/60_Oracle.t ... ok
t/61_bulk.t ..... ok
t/62_stream.t ... ok
t/63_persist.t .. ok
t/65_Oracle.t ... ok
t/66_autoc.t .... ok

> t/70_Unify.t .... skipped: Not a testable Unify env
> t/71_bulk.t ..... skipped: Not a testable Unify env
> t/72_stream.t ... skipped: Not a testable Unify env
> t/73_persist.t .. skipped: Not a testable Unify env
> t/75_Unify.t .... skipped: Not a testable Unify env
> All tests successful.
> Files=37, Tests=560, 44 wallclock secs ( 0.21 usr  0.05 sys +  6.74 cusr  0.84 csys =  7.84 CPU)
> Result: PASS
> 
> So, DBI-Test-git …
> 
> $ git pull --all
> $ git remote prune origin
> $ git clean -dfx
> $ perl Makefile.PL
> Checking if your kit is complete...
> Looks good
> Writing Makefile for DBI::Test
> Writing MYMETA.yml and MYMETA.json
> $ make test
> :
> t/basic/dvc_connect.t ......... ok
> t/basic/dvc_disconnect.t ...... ok
> t/basic/dvd_connect.t ......... ok
> t/basic/dvd_disconnect.t ...... ok
> t/basic/dve_connect.t ......... ok
> t/basic/dve_disconnect.t ...... ok
> t/basic/dvf_connect.t ......... ok
> t/basic/dvf_disconnect.t ...... ok
> t/basic/dvm_connect.t ......... install_driver(mysql) failed: Attempt to reload DBD/mysql.pm aborted.
> Compilation failed in require at (eval 158) line 3.

With DBI->trace (4) in front of that connect:

t/basic/dvm_connect.t .........     DBI 1.628 (PurePerl) dispatch trace level set to 4
install_driver(mysql) failed: Attempt to reload DBD/mysql.pm aborted.
Compilation failed in require at (eval 158) line 3.

 at /pro/3gl/CPAN/DBI-Test-git/blib/lib/DBI/Test.pm line 31.

Why pure-perl? And /if/ pure-perl, there is probably no use in testing
XS DBD's

With this change:

diff --git a/lib/DBI/Mock.pm b/lib/DBI/Mock.pm
index 510ce36..bcfcde4 100644
--- a/lib/DBI/Mock.pm
+++ b/lib/DBI/Mock.pm
@@ -483,7 +483,7 @@ sub _miss_dbi
     defined $_have_dbi and return !$_have_dbi;
     $_have_dbi = 0;
     eval qq{
-       \$ENV{DBI_PUREPERL} = 2; # we only want to know if it's there ...
+       #\$ENV{DBI_PUREPERL} = 2; # we only want to know if it's there ...
        require DBI;
        \$_have_dbi = 1;
     };

I get much further:

t/basic/dvc_connect.t ......... ok
t/basic/dvc_disconnect.t ...... ok
t/basic/dvd_connect.t ......... ok
t/basic/dvd_disconnect.t ...... ok
t/basic/dve_connect.t ......... ok
t/basic/dve_disconnect.t ...... ok
t/basic/dvf_connect.t ......... ok
t/basic/dvf_disconnect.t ...... ok
t/basic/dvm_connect.t ......... ok
t/basic/dvm_disconnect.t ...... ok
t/basic/dvn_connect.t ......... ok
t/basic/dvn_disconnect.t ...... ok
t/basic/dvo_connect.t ......... install_driver(Oracle) failed: Attempt to reload DBD/Oracle.pm aborted.
Compilation failed in require at (eval 71) line 3.

 at /pro/3gl/CPAN/DBI-Test-git/blib/lib/DBI/Test.pm line 31.
t/basic/dvo_connect.t ......... Dubious, test returned 2 (wstat 512, 0x200)
No subtests run
t/basic/dvo_disconnect.t ...... install_driver(Oracle) failed: Attempt to reload DBD/Oracle.pm aborted.
Compilation failed in require at (eval 71) line 3.

 at /pro/3gl/CPAN/DBI-Test-git/blib/lib/DBI/Test.pm line 31.
t/basic/dvo_disconnect.t ...... Dubious, test returned 2 (wstat 512, 0x200)
No subtests run
t/basic/dvp_connect.t ......... ok
t/basic/dvp_disconnect.t ...... ok
t/basic/dvs_connect.t ......... ok
t/basic/dvs_disconnect.t ...... ok
t/basic/mvb_dvn_connect.t ..... ok
t/basic/mvb_dvn_disconnect.t .. ok
xt/00_pod.t ................... ok
xt/01_pod.t ................... ok
xt/10_perlversion.t ........... ok

in a valid Oracle env

t/basic/dvo_connect.t ......... DBI connect('','',...) failed: ORA-01017: invalid username/password; logon denied (DBD ERROR: OCISessionBegin) at /pro/3gl/CPAN/DBI-Test-git/blib/lib/DBI/Test.pm line 31.
t/basic/dvo_connect.t ......... 1/?
#   Failed test 'basic connect'
#   at /pro/3gl/CPAN/DBI-Test-git/blib/lib/DBI/Test/Case/basic/connect.pm line 16.

#   Failed test 'dbh is active'
#   at /pro/3gl/CPAN/DBI-Test-git/blib/lib/DBI/Test/Case/basic/connect.pm line 20.
DBI connect('','',...) failed: ORA-01017: invalid username/password; logon denied (DBD ERROR: OCISessionBegin) at /pro/3gl/CPAN/DBI-Test-git/blib/lib/DBI/Test.pm line 31.
t/basic/dvo_connect.t ......... 3/?
#   Failed test 'basic connect'
#   at /pro/3gl/CPAN/DBI-Test-git/blib/lib/DBI/Test/Case/basic/connect.pm line 29.
DBI connect('','',...) failed: ORA-01017: invalid username/password; logon denied (DBD ERROR: OCISessionBegin) at /pro/3gl/CPAN/DBI-Test-git/blib/lib/DBI/Test.pm line 31.

#   Failed test 'connect without attr'
#   at /pro/3gl/CPAN/DBI-Test-git/blib/lib/DBI/Test/Case/basic/connect.pm line 46.
Use of uninitialized value $got in numeric eq (==) at (eval in cmp_ok) /pro/3gl/CPAN/DBI-Test-git/blib/lib/DBI/Test/Case/basic/connect.pm line 50.

#   Failed test 'AutoCommit == 1'
#   at /pro/3gl/CPAN/DBI-Test-git/blib/lib/DBI/Test/Case/basic/connect.pm line 50.
Use of uninitialized value $val in addition (+) at /pro/lib/perl5/5.18.0/Test/Builder.pm line 917.
#          got: undef
#     expected: 1
Can't call method "FETCH" on unblessed reference at /pro/3gl/CPAN/DBI-Test-git/blib/lib/DBI/Test/Case/basic/connect.pm line 51.
# Tests were run but no plan was declared and done_testing() was not seen.
t/basic/dvo_connect.t ......... Dubious, test returned 255 (wstat 65280, 0xff00)
Failed 5/5 subtests
t/basic/dvo_disconnect.t ...... DBI connect('','',...) failed: [unixODBC][Driver Manager]Data source name not found, and no default driver specified (SQL-IM002) at /pro/3gl/CPAN/DBI-Test-git/blib/lib/DBI/Test.pm line 31.
t/basic/dvo_disconnect.t ...... 1/?
#   Failed test 'basic connect'
#   at /pro/3gl/CPAN/DBI-Test-git/blib/lib/DBI/Test/Case/basic/disconnect.pm line 20.
Can't call method "disconnect" on an undefined value at /pro/3gl/CPAN/DBI-Test-git/blib/lib/DBI/Test/Case/basic/disconnect.pm line 22.
# Tests were run but no plan was declared and done_testing() was not seen.
t/basic/dvo_disconnect.t ...... Dubious, test returned 255 (wstat 65280, 0xff00)
Failed 1/1 subtests

The credentials do not look at ORACLE_USERID

>  at /pro/3gl/CPAN/DBI-Test-git/blib/lib/DBI/Test.pm line 31.
> t/basic/dvm_connect.t ......... Dubious, test returned 2 (wstat 512, 0x200)
> No subtests run
> t/basic/dvm_disconnect.t ...... install_driver(mysql) failed: Attempt to reload DBD/mysql.pm aborted.
> Compilation failed in require at (eval 158) line 3.
> 
>  at /pro/3gl/CPAN/DBI-Test-git/blib/lib/DBI/Test.pm line 31.
> t/basic/dvm_disconnect.t ...... Dubious, test returned 2 (wstat 512, 0x200)
> No subtests run
> t/basic/dvn_connect.t ......... ok
> t/basic/dvn_disconnect.t ...... ok
> t/basic/dvo_connect.t ......... install_driver(Oracle) failed: Attempt to reload DBD/Oracle.pm aborted.
> Compilation failed in require at (eval 158) line 3.
> 
>  at /pro/3gl/CPAN/DBI-Test-git/blib/lib/DBI/Test.pm line 31.
> t/basic/dvo_connect.t ......... Dubious, test returned 2 (wstat 512, 0x200)
> No subtests run
> t/basic/dvo_disconnect.t ...... install_driver(Oracle) failed: Attempt to reload DBD/Oracle.pm aborted.
> Compilation failed in require at (eval 158) line 3.
> 
>  at /pro/3gl/CPAN/DBI-Test-git/blib/lib/DBI/Test.pm line 31.
> t/basic/dvo_disconnect.t ...... Dubious, test returned 2 (wstat 512, 0x200)
> No subtests run
> t/basic/dvp_connect.t ......... install_driver(Pg) failed: Attempt to reload DBD/Pg.pm aborted.
> Compilation failed in require at (eval 159) line 3.
> 
>  at /pro/3gl/CPAN/DBI-Test-git/blib/lib/DBI/Test.pm line 31.
> t/basic/dvp_connect.t ......... Dubious, test returned 2 (wstat 512, 0x200)
> No subtests run
> t/basic/dvp_disconnect.t ...... install_driver(Pg) failed: Attempt to reload DBD/Pg.pm aborted.
> Compilation failed in require at (eval 159) line 3.
> 
>  at /pro/3gl/CPAN/DBI-Test-git/blib/lib/DBI/Test.pm line 31.
> t/basic/dvp_disconnect.t ...... Dubious, test returned 2 (wstat 512, 0x200)
> No subtests run
> t/basic/dvs_connect.t ......... install_driver(SQLite) failed: Attempt to reload DBD/SQLite.pm aborted.
> Compilation failed in require at (eval 158) line 3.
> 
>  at /pro/3gl/CPAN/DBI-Test-git/blib/lib/DBI/Test.pm line 31.
> t/basic/dvs_connect.t ......... Dubious, test returned 2 (wstat 512, 0x200)
> No subtests run
> t/basic/dvs_disconnect.t ...... install_driver(SQLite) failed: Attempt to reload DBD/SQLite.pm aborted.
> Compilation failed in require at (eval 158) line 3.
> 
>  at /pro/3gl/CPAN/DBI-Test-git/blib/lib/DBI/Test.pm line 31.
> t/basic/dvs_disconnect.t ...... Dubious, test returned 2 (wstat 512, 0x200)
> No subtests run
> t/basic/mvb_dvn_connect.t ..... ok
> t/basic/mvb_dvn_disconnect.t .. ok
> xt/00_pod.t ................... ok
> xt/01_pod.t ................... ok
> xt/10_perlversion.t ........... ok
> 
> Test Summary Report
> -------------------
> t/basic/dvc_connect.t       (Wstat: 0 Tests: 18 Failed: 0)
>   TODO passed:   14
> t/basic/dvc_disconnect.t    (Wstat: 0 Tests: 19 Failed: 0)
>   TODO passed:   8-9, 14-15, 18
> t/basic/dvd_connect.t       (Wstat: 0 Tests: 18 Failed: 0)
>   TODO passed:   14
> t/basic/dvd_disconnect.t    (Wstat: 0 Tests: 19 Failed: 0)
>   TODO passed:   8-9, 14-15, 18
> t/basic/dve_connect.t       (Wstat: 0 Tests: 16 Failed: 0)
>   TODO passed:   12
> t/basic/dve_disconnect.t    (Wstat: 0 Tests: 19 Failed: 0)
>   TODO passed:   8-9, 14-15, 18
> t/basic/dvf_connect.t       (Wstat: 0 Tests: 18 Failed: 0)
>   TODO passed:   14
> t/basic/dvf_disconnect.t    (Wstat: 0 Tests: 19 Failed: 0)
>   TODO passed:   8-9, 14-15, 18
> t/basic/dvm_connect.t       (Wstat: 512 Tests: 0 Failed: 0)
>   Non-zero exit status: 2
>   Parse errors: No plan found in TAP output
> t/basic/dvm_disconnect.t    (Wstat: 512 Tests: 0 Failed: 0)
>   Non-zero exit status: 2
>   Parse errors: No plan found in TAP output
> t/basic/dvn_connect.t       (Wstat: 0 Tests: 16 Failed: 0)
>   TODO passed:   12
> t/basic/dvn_disconnect.t    (Wstat: 0 Tests: 19 Failed: 0)
>   TODO passed:   8-9, 14-15, 18
> t/basic/dvo_connect.t       (Wstat: 512 Tests: 0 Failed: 0)
>   Non-zero exit status: 2
>   Parse errors: No plan found in TAP output
> t/basic/dvo_disconnect.t    (Wstat: 512 Tests: 0 Failed: 0)
>   Non-zero exit status: 2
>   Parse errors: No plan found in TAP output
> t/basic/dvp_connect.t       (Wstat: 512 Tests: 0 Failed: 0)
>   Non-zero exit status: 2
>   Parse errors: No plan found in TAP output
> t/basic/dvp_disconnect.t    (Wstat: 512 Tests: 0 Failed: 0)
>   Non-zero exit status: 2
>   Parse errors: No plan found in TAP output
> t/basic/dvs_connect.t       (Wstat: 512 Tests: 0 Failed: 0)
>   Non-zero exit status: 2
>   Parse errors: No plan found in TAP output
> t/basic/dvs_disconnect.t    (Wstat: 512 Tests: 0 Failed: 0)
>   Non-zero exit status: 2
>   Parse errors: No plan found in TAP output
> t/basic/mvb_dvn_connect.t   (Wstat: 0 Tests: 16 Failed: 0)
>   TODO passed:   12
> t/basic/mvb_dvn_disconnect.t (Wstat: 0 Tests: 19 Failed: 0)
>   TODO passed:   8-9, 14-15, 18
> Files=23, Tests=276,  6 wallclock secs ( 0.14 usr  0.04 sys +  6.24 cusr  0.23 csys =  6.65 CPU)
> Result: FAIL
> Failed 8/23 test programs. 0/276 subtests failed.
> make: *** [test_dynamic] Error 255
> 
> 
> 


-- 
H.Merijn Brand  http://tux.nl   Perl Monger  http://amsterdam.pm.org/
using perl5.00307 .. 5.19   porting perl5 on HP-UX, AIX, and openSUSE
http://mirrors.develooper.com/hpux/        http://www.test-smoke.org/
http://qa.perl.org   http://www.goldmark.org/jeff/stupid-disclaimers/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.