vmikk / biodiverse-docker

Docker and Singularity images to run Biodiverse software
MIT License
0 stars 1 forks source link

Biodiverse tests #3

Open vmikk opened 2 years ago

vmikk commented 2 years ago

Currently these tests are failing (v.0.01, 814ef52):

t/11-BaseData-import-feature-data.t                     (Wstat: 512 Tests: 6 Failed: 1)
  Failed test:  6
  Non-zero exit status: 2
  Parse errors: No plan found in TAP output
t/28-Randomisation2.t                                   (Wstat: 256 Tests: 43 Failed: 1)
  Failed test:  2
  Non-zero exit status: 1
t/30-Progress.t                                         (Wstat: 256 Tests: 2 Failed: 1)
  Failed test:  2
  Non-zero exit status: 1
Files=62, Tests=3971
shawnlaffan commented 2 years ago

Can you list the failure diagnostics? It should note which tests fail higher up in the log.

vmikk commented 2 years ago

Test # 11

t/11-BaseData-import-feature-data.t ....................... 1/? 
#   Failed test 'no exceptions importing /biodiverse/tmp/t_11-BaseData-import-feature-data_t/default_2//sh��efile_0'
#   at t/11-BaseData-import-feature-data.t line 157.
# CreateSpatialIndex : unsupported operation on a read-only datasource. at /root/perl5/perlbrew/perls/perl-5.34.0/lib/site_perl/5.34.0/Geo/GDAL/FFI/Driver.pm line 49.
#   Geo::GDAL::FFI::Driver::Create(Geo::GDAL::FFI::Driver=SCALAR(0x557f8b423698), "/vsimem/fishnet__94006286079528_1_591_") called at /biodiverse/t/../lib/Biodiverse/BaseData/Import.pm line 1581
#   Biodiverse::BaseData::Import::get_fishnet_polygon_layer(Biodiverse::BaseData=HASH(0x557f8b49d628), "source_layer", Geo::GDAL::FFI::Layer=SCALAR(0x557f8b3b98d0), "schema", HASH(0x557f8b4232c0), "resolutions", ARRAY(0x557f8b5ab4f0), "origins", ...) called at /biodiverse/t/../lib/Biodiverse/BaseData/Import.pm line 1129
#   Biodiverse::BaseData::Import::import_data_shapefile(Biodiverse::BaseData=HASH(0x557f8b49d628), "input_files", ARRAY(0x557f8b3b99c0), "sample_count_col_names", ARRAY(0x557f8b5ab370), "group_field_names", ARRAY(0x557f8b60bee8), "label_field_names", ...) called at t/11-BaseData-import-feature-data.t line 151
#   eval {...} called at t/11-BaseData-import-feature-data.t line 150
#   main::test_import_roundtrip_shapefile() called at t/11-BaseData-import-feature-data.t line 49
#   main::main() called at t/11-BaseData-import-feature-data.t line 31
# /biodiverse/tmp/t_11-BaseData-import-feature-data_t/default_2//sh��efile_0:
[BASEDATA] /biodiverse/tmp/t_11-BaseData-import-feature-data_t/default_2//shæþefile_0shp DOES NOT EXIST OR CANNOT BE READ
 at t/11-BaseData-import-feature-data.t line 162.
# Tests were run but no plan was declared and done_testing() was not seen.
# Looks like your test exited with 2 just after 6.
t/11-BaseData-import-feature-data.t ....................... Dubious, test returned 2 (wstat 512, 0x200)
Failed 1/6 subtests 
t/11-BaseData-import-spreadsheet.t ........................ Use of uninitialized value in pattern match (m//) at /root/perl5/perlbrew/perls/perl-5.34.0/lib/5.34.0/Env.pm line 136.
Use of uninitialized value in split at /root/perl5/perlbrew/perls/perl-5.34.0/lib/5.34.0/Env.pm line 153.
Use of uninitialized value in split at /root/perl5/perlbrew/perls/perl-5.34.0/lib/5.34.0/Env.pm line 179.
Use of uninitialized value in pattern match (m//) at /root/perl5/perlbrew/perls/perl-5.34.0/lib/5.34.0/Env.pm line 136.
Use of uninitialized value in split at /root/perl5/perlbrew/perls/perl-5.34.0/lib/5.34.0/Env.pm line 153.
Use of uninitialized value in split at /root/perl5/perlbrew/perls/perl-5.34.0/lib/5.34.0/Env.pm line 179.
Name "FFI::Platypus::keep" used only once: possible typo at /root/perl5/perlbrew/perls/perl-5.34.0/lib/5.34.0/XSLoader.pm line 111.
t/11-BaseData-import-spreadsheet.t ........................ ok    
t/11-BaseData-reintegrate-after-rand.t .................... Use of uninitialized value in pattern match (m//) at /root/perl5/perlbrew/perls/perl-5.34.0/lib/5.34.0/Env.pm line 136.
Use of uninitialized value in split at /root/perl5/perlbrew/perls/perl-5.34.0/lib/5.34.0/Env.pm line 153.
Use of uninitialized value in split at /root/perl5/perlbrew/perls/perl-5.34.0/lib/5.34.0/Env.pm line 179.
Use of uninitialized value in pattern match (m//) at /root/perl5/perlbrew/perls/perl-5.34.0/lib/5.34.0/Env.pm line 136.
Use of uninitialized value in split at /root/perl5/perlbrew/perls/perl-5.34.0/lib/5.34.0/Env.pm line 153.
Use of uninitialized value in split at /root/perl5/perlbrew/perls/perl-5.34.0/lib/5.34.0/Env.pm line 179.
Name "FFI::Platypus::keep" used only once: possible typo at /root/perl5/perlbrew/perls/perl-5.34.0/lib/5.34.0/XSLoader.pm line 111.
t/11-BaseData-reintegrate-after-rand.t .................... ok    
t/11-BaseData.t ........................................... ok     
t/11-BaseData_exclusions.t ................................ Use of uninitialized value in pattern match (m//) at /root/perl5/perlbrew/perls/perl-5.34.0/lib/5.34.0/Env.pm line 136.
Use of uninitialized value in split at /root/perl5/perlbrew/perls/perl-5.34.0/lib/5.34.0/Env.pm line 153.
Use of uninitialized value in split at /root/perl5/perlbrew/perls/perl-5.34.0/lib/5.34.0/Env.pm line 179.
Use of uninitialized value in pattern match (m//) at /root/perl5/perlbrew/perls/perl-5.34.0/lib/5.34.0/Env.pm line 136.
Use of uninitialized value in split at /root/perl5/perlbrew/perls/perl-5.34.0/lib/5.34.0/Env.pm line 153.
Use of uninitialized value in split at /root/perl5/perlbrew/perls/perl-5.34.0/lib/5.34.0/Env.pm line 179.
Name "FFI::Platypus::keep" used only once: possible typo at /root/perl5/perlbrew/perls/perl-5.34.0/lib/5.34.0/XSLoader.pm line 111.
t/11-BaseData_exclusions.t ................................ ok   
t/11-BaseData_reorder_axes.t .............................. ok
vmikk commented 2 years ago

Test # 28

t/28-Randomisation.t ...................................... ok     
t/28-Randomisation2.t ..................................... 1/? 
#   Failed test 'should be unable to write checkpoints'
#   at t/28-Randomisation2.t line 422.
# expecting: Regexp ((?^:Unable to save checkpoint files to current working directory))
# found: normal exit
t/28-Randomisation2.t ..................................... 26/? # Looks like you failed 1 test of 43.
t/28-Randomisation2.t ..................................... Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/43 subtests 
vmikk commented 2 years ago

Test # 30

t/30-Progress.t ........................................... 1/2 
#   Failed test 'no warnings'
#   at /root/perl5/perlbrew/perls/perl-5.34.0/lib/5.34.0/Test/Builder.pm line 193.
# There were 6 warning(s)
#     Previous test 0 ''
#     Use of uninitialized value in pattern match (m//) at /root/perl5/perlbrew/perls/perl-5.34.0/lib/5.34.0/Env.pm line 136.
#  at /root/perl5/perlbrew/perls/perl-5.34.0/lib/5.34.0/Env.pm line 136.
#   Env::Array::FETCHSIZE(Env::Array=SCALAR(0x5565a2b314e0)) called at /root/perl5/perlbrew/perls/perl-5.34.0/lib/site_perl/5.34.0/x86_64-linux/Alien/gdal.pm line 65
#   Alien::gdal::BEGIN() called at /root/perl5/perlbrew/perls/perl-5.34.0/lib/site_perl/5.34.0/x86_64-linux/Alien/gdal.pm line 74
#   eval {...} called at /root/perl5/perlbrew/perls/perl-5.34.0/lib/site_perl/5.34.0/x86_64-linux/Alien/gdal.pm line 74
#   require Alien/gdal.pm called at /biodiverse/t/../lib/Biodiverse/Config.pm line 232
#   Biodiverse::Config::BEGIN() called at /root/perl5/perlbrew/perls/perl-5.34.0/lib/site_perl/5.34.0/x86_64-linux/Alien/gdal.pm line 74
#   eval {...} called at /root/perl5/perlbrew/perls/perl-5.34.0/lib/site_perl/5.34.0/x86_64-linux/Alien/gdal.pm line 74
#   require Biodiverse/Config.pm called at /biodiverse/t/../lib/Biodiverse/Progress.pm line 10
#   require Biodiverse/Progress.pm called at t/30-Progress.t line 20
#   main::BEGIN() called at /root/perl5/perlbrew/perls/perl-5.34.0/lib/site_perl/5.34.0/x86_64-linux/Alien/gdal.pm line 74
#   eval {...} called at /root/perl5/perlbrew/perls/perl-5.34.0/lib/site_perl/5.34.0/x86_64-linux/Alien/gdal.pm line 74
# 
# ----------
#     Previous test 0 ''
#     Use of uninitialized value in split at /root/perl5/perlbrew/perls/perl-5.34.0/lib/5.34.0/Env.pm line 153.
#  at /root/perl5/perlbrew/perls/perl-5.34.0/lib/5.34.0/Env.pm line 153.
#   Env::Array::FETCH(Env::Array=SCALAR(0x5565a2b314e0), 0) called at /root/perl5/perlbrew/perls/perl-5.34.0/lib/site_perl/5.34.0/x86_64-linux/Alien/gdal.pm line 65
#   Alien::gdal::BEGIN() called at /root/perl5/perlbrew/perls/perl-5.34.0/lib/site_perl/5.34.0/x86_64-linux/Alien/gdal.pm line 74
#   eval {...} called at /root/perl5/perlbrew/perls/perl-5.34.0/lib/site_perl/5.34.0/x86_64-linux/Alien/gdal.pm line 74
#   require Alien/gdal.pm called at /biodiverse/t/../lib/Biodiverse/Config.pm line 232
#   Biodiverse::Config::BEGIN() called at /root/perl5/perlbrew/perls/perl-5.34.0/lib/site_perl/5.34.0/x86_64-linux/Alien/gdal.pm line 74
#   eval {...} called at /root/perl5/perlbrew/perls/perl-5.34.0/lib/site_perl/5.34.0/x86_64-linux/Alien/gdal.pm line 74
#   require Biodiverse/Config.pm called at /biodiverse/t/../lib/Biodiverse/Progress.pm line 10
#   require Biodiverse/Progress.pm called at t/30-Progress.t line 20
#   main::BEGIN() called at /root/perl5/perlbrew/perls/perl-5.34.0/lib/site_perl/5.34.0/x86_64-linux/Alien/gdal.pm line 74
#   eval {...} called at /root/perl5/perlbrew/perls/perl-5.34.0/lib/site_perl/5.34.0/x86_64-linux/Alien/gdal.pm line 74
# 
# ----------
#     Previous test 0 ''
#     Use of uninitialized value in split at /root/perl5/perlbrew/perls/perl-5.34.0/lib/5.34.0/Env.pm line 179.
#  at /root/perl5/perlbrew/perls/perl-5.34.0/lib/5.34.0/Env.pm line 179.
#   Env::Array::PUSH(Env::Array=SCALAR(0x5565a2b314e0), "/root/perl5/perlbrew/perls/perl-5.34.0/lib/site_perl/5.34.0/x"...) called at /root/perl5/perlbrew/perls/perl-5.34.0/lib/site_perl/5.34.0/x86_64-linux/Alien/gdal.pm line 65
#   Alien::gdal::BEGIN() called at /root/perl5/perlbrew/perls/perl-5.34.0/lib/site_perl/5.34.0/x86_64-linux/Alien/gdal.pm line 74
#   eval {...} called at /root/perl5/perlbrew/perls/perl-5.34.0/lib/site_perl/5.34.0/x86_64-linux/Alien/gdal.pm line 74
#   require Alien/gdal.pm called at /biodiverse/t/../lib/Biodiverse/Config.pm line 232
#   Biodiverse::Config::BEGIN() called at /root/perl5/perlbrew/perls/perl-5.34.0/lib/site_perl/5.34.0/x86_64-linux/Alien/gdal.pm line 74
#   eval {...} called at /root/perl5/perlbrew/perls/perl-5.34.0/lib/site_perl/5.34.0/x86_64-linux/Alien/gdal.pm line 74
#   require Biodiverse/Config.pm called at /biodiverse/t/../lib/Biodiverse/Progress.pm line 10
#   require Biodiverse/Progress.pm called at t/30-Progress.t line 20
#   main::BEGIN() called at /root/perl5/perlbrew/perls/perl-5.34.0/lib/site_perl/5.34.0/x86_64-linux/Alien/gdal.pm line 74
#   eval {...} called at /root/perl5/perlbrew/perls/perl-5.34.0/lib/site_perl/5.34.0/x86_64-linux/Alien/gdal.pm line 74
# 
# ----------
#     Previous test 0 ''
#     Use of uninitialized value in pattern match (m//) at /root/perl5/perlbrew/perls/perl-5.34.0/lib/5.34.0/Env.pm line 136.
#  at /root/perl5/perlbrew/perls/perl-5.34.0/lib/5.34.0/Env.pm line 136.
#   Env::Array::FETCHSIZE(Env::Array=SCALAR(0x5565a2ba5680)) called at /root/perl5/perlbrew/perls/perl-5.34.0/lib/site_perl/5.34.0/x86_64-linux/Alien/gdal.pm line 69
#   Alien::gdal::BEGIN() called at /root/perl5/perlbrew/perls/perl-5.34.0/lib/site_perl/5.34.0/x86_64-linux/Alien/gdal.pm line 74
#   eval {...} called at /root/perl5/perlbrew/perls/perl-5.34.0/lib/site_perl/5.34.0/x86_64-linux/Alien/gdal.pm line 74
#   require Alien/gdal.pm called at /biodiverse/t/../lib/Biodiverse/Config.pm line 232
#   Biodiverse::Config::BEGIN() called at /root/perl5/perlbrew/perls/perl-5.34.0/lib/site_perl/5.34.0/x86_64-linux/Alien/gdal.pm line 74
#   eval {...} called at /root/perl5/perlbrew/perls/perl-5.34.0/lib/site_perl/5.34.0/x86_64-linux/Alien/gdal.pm line 74
#   require Biodiverse/Config.pm called at /biodiverse/t/../lib/Biodiverse/Progress.pm line 10
#   require Biodiverse/Progress.pm called at t/30-Progress.t line 20
#   main::BEGIN() called at /root/perl5/perlbrew/perls/perl-5.34.0/lib/site_perl/5.34.0/x86_64-linux/Alien/gdal.pm line 74
#   eval {...} called at /root/perl5/perlbrew/perls/perl-5.34.0/lib/site_perl/5.34.0/x86_64-linux/Alien/gdal.pm line 74
# 
# ----------
#     Previous test 0 ''
#     Use of uninitialized value in split at /root/perl5/perlbrew/perls/perl-5.34.0/lib/5.34.0/Env.pm line 153.
#  at /root/perl5/perlbrew/perls/perl-5.34.0/lib/5.34.0/Env.pm line 153.
#   Env::Array::FETCH(Env::Array=SCALAR(0x5565a2ba5680), 0) called at /root/perl5/perlbrew/perls/perl-5.34.0/lib/site_perl/5.34.0/x86_64-linux/Alien/gdal.pm line 69
#   Alien::gdal::BEGIN() called at /root/perl5/perlbrew/perls/perl-5.34.0/lib/site_perl/5.34.0/x86_64-linux/Alien/gdal.pm line 74
#   eval {...} called at /root/perl5/perlbrew/perls/perl-5.34.0/lib/site_perl/5.34.0/x86_64-linux/Alien/gdal.pm line 74
#   require Alien/gdal.pm called at /biodiverse/t/../lib/Biodiverse/Config.pm line 232
#   Biodiverse::Config::BEGIN() called at /root/perl5/perlbrew/perls/perl-5.34.0/lib/site_perl/5.34.0/x86_64-linux/Alien/gdal.pm line 74
#   eval {...} called at /root/perl5/perlbrew/perls/perl-5.34.0/lib/site_perl/5.34.0/x86_64-linux/Alien/gdal.pm line 74
#   require Biodiverse/Config.pm called at /biodiverse/t/../lib/Biodiverse/Progress.pm line 10
#   require Biodiverse/Progress.pm called at t/30-Progress.t line 20
#   main::BEGIN() called at /root/perl5/perlbrew/perls/perl-5.34.0/lib/site_perl/5.34.0/x86_64-linux/Alien/gdal.pm line 74
#   eval {...} called at /root/perl5/perlbrew/perls/perl-5.34.0/lib/site_perl/5.34.0/x86_64-linux/Alien/gdal.pm line 74
# 
# ----------
#     Previous test 0 ''
#     Use of uninitialized value in split at /root/perl5/perlbrew/perls/perl-5.34.0/lib/5.34.0/Env.pm line 179.
#  at /root/perl5/perlbrew/perls/perl-5.34.0/lib/5.34.0/Env.pm line 179.
#   Env::Array::PUSH(Env::Array=SCALAR(0x5565a2ba5680), "/root/perl5/perlbrew/perls/perl-5.34.0/lib/site_perl/5.34.0/x"...) called at /root/perl5/perlbrew/perls/perl-5.34.0/lib/site_perl/5.34.0/x86_64-linux/Alien/gdal.pm line 69
#   Alien::gdal::BEGIN() called at /root/perl5/perlbrew/perls/perl-5.34.0/lib/site_perl/5.34.0/x86_64-linux/Alien/gdal.pm line 74
#   eval {...} called at /root/perl5/perlbrew/perls/perl-5.34.0/lib/site_perl/5.34.0/x86_64-linux/Alien/gdal.pm line 74
#   require Alien/gdal.pm called at /biodiverse/t/../lib/Biodiverse/Config.pm line 232
#   Biodiverse::Config::BEGIN() called at /root/perl5/perlbrew/perls/perl-5.34.0/lib/site_perl/5.34.0/x86_64-linux/Alien/gdal.pm line 74
#   eval {...} called at /root/perl5/perlbrew/perls/perl-5.34.0/lib/site_perl/5.34.0/x86_64-linux/Alien/gdal.pm line 74
#   require Biodiverse/Config.pm called at /biodiverse/t/../lib/Biodiverse/Progress.pm line 10
#   require Biodiverse/Progress.pm called at t/30-Progress.t line 20
#   main::BEGIN() called at /root/perl5/perlbrew/perls/perl-5.34.0/lib/site_perl/5.34.0/x86_64-linux/Alien/gdal.pm line 74
#   eval {...} called at /root/perl5/perlbrew/perls/perl-5.34.0/lib/site_perl/5.34.0/x86_64-linux/Alien/gdal.pm line 74
# 
# Looks like you failed 1 test of 2.
t/30-Progress.t ........................................... Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/2 subtests 
shawnlaffan commented 2 years ago

1.

All the warnings about uninitialised values in Env.pm, split and regexes were fixed a few days ago in https://github.com/shawnlaffan/biodiverse/commit/795717dc614af975793aa86f21461eb195560453

Updating to that commit will (should) fix the t/30-Progress.t failures. I can add a new tag if needed.

2.

The failures in t/11-BaseData-import-feature-data.t look to be related to unicode file name tests. They won't affect anything so long as we keep to ascii characters in file names. I need to look into it further, though.

3.

The failing test in t/28-Randomisation.t seems to be difficult to get working properly on some systems. It is skipped under BSD systems and WSL on windows, and looks like it also needs to be be skipped under docker.
https://github.com/shawnlaffan/biodiverse/blob/713cb4b718fa9a98cfd5d1d77ec92d765146af1b/t/28-Randomisation2.t#L417

The test was introduced for https://github.com/shawnlaffan/biodiverse/issues/746

shawnlaffan commented 2 years ago

Some of the errors in t/11-BaseData-import-feature-data.t will be fixed by https://github.com/shawnlaffan/biodiverse/commit/87b4b98d24e14ba79abaccc44ee47e8e7adcd048

vmikk commented 2 years ago

split and regexes were fixed a few days ago in https://github.com/shawnlaffan/biodiverse/commit/795717dc614af975793aa86f21461eb195560453 t/11-BaseData-import-feature-data.t will be fixed by https://github.com/shawnlaffan/biodiverse/commit/87b4b98d24e14ba79abaccc44ee47e8e7adcd048

Great! Thank you!

I can add a new tag if needed.

Probably for now we can use a hash ID of the latest fix (or just the head of the master branch) and we'll specify stable version later.

vmikk commented 2 years ago

I've fixed the Dockerfile (12e847c) a bit and switched to the latest Biodiverse commit (https://github.com/shawnlaffan/biodiverse/commit/87b4b98d24e14ba79abaccc44ee47e8e7adcd048).

Now almost all tests (including t/11 and t/30) are passing! t/28 failed with this error:

t/28-Randomisation.t ...................................... ok     
t/28-Randomisation2.t ..................................... 1/? 
# Failed test 'should be unable to write checkpoints'
# at t/28-Randomisation2.t line 431.
# +---------+----+---------------------------------------------------------+
# | GOT     | OP | CHECK                                                   |
# +---------+----+---------------------------------------------------------+
# | <UNDEF> | =~ | (?^:Unable to save checkpoint files to current working  |
# |         |    | directory)                                              |
# +---------+----+---------------------------------------------------------+
t/28-Randomisation2.t ..................................... 32/? # Seeded srand with seed '20220208' from local date.
t/28-Randomisation2.t ..................................... Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/43 subtests

It is skipped under BSD systems and WSL on windows, and looks like it also needs to be be skipped under docker

I'm not a Windows user, but I thought that WSL2 uses Docker as a backend. And the most common distro is Ubuntu as well. So it's exactly the same problem as we encountered now.

shawnlaffan commented 2 years ago

Now almost all tests (including t/11 and t/30) are passing!

That's good news.

I'm not a Windows user, but I thought that WSL2 uses Docker as a backend. And the most common distro is Ubuntu as well. So it's exactly the same problem as we encountered now.

The tweak to WSL was for version 1. Running it under WSL2 the test passes, despite being marked as todo. I've modified the test to use different permissions as they might have been too stringent before.

Can you run this one-liner in the shell and report the result?

perl -MConfig -E'say $^O; say $Config{osvers}'

vmikk commented 2 years ago

The output is:

linux
5.13.0-25-generic
kessya commented 2 years ago

For my version the output is:

linux 5.10.76-linuxkit

shawnlaffan commented 2 years ago

Thanks for those. I don't think we can differentiate docker linux this way.

I've modified the test in https://github.com/shawnlaffan/biodiverse/commit/cc1f70a5985499988204171d52080f5c71751538 This might have the desired effect of fixing the underlying problem. Could you try that?