Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Biodiverse tests #3

Open
2 of 3 tasks
vmikk opened this issue Feb 7, 2022 · 12 comments
Open
2 of 3 tasks

Biodiverse tests #3

vmikk opened this issue Feb 7, 2022 · 12 comments

Comments

@vmikk
Copy link
Owner

vmikk commented Feb 7, 2022

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

  • t/11 - BaseData-import-feature-data
  • t/28 - Randomisation2
  • t/30 - Progress
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
Copy link
Collaborator

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

@vmikk
Copy link
Owner Author

vmikk commented Feb 8, 2022

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
Copy link
Owner Author

vmikk commented Feb 8, 2022

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
Copy link
Owner Author

vmikk commented Feb 8, 2022

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
Copy link
Collaborator

All the warnings about uninitialised values in Env.pm, split and regexes were fixed a few days ago in shawnlaffan/biodiverse@795717d

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

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.

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 shawnlaffan/biodiverse#746

@shawnlaffan
Copy link
Collaborator

Some of the errors in t/11-BaseData-import-feature-data.t will be fixed by shawnlaffan/biodiverse@87b4b98

@vmikk
Copy link
Owner Author

vmikk commented Feb 8, 2022

split and regexes were fixed a few days ago in shawnlaffan/biodiverse@795717d
t/11-BaseData-import-feature-data.t will be fixed by shawnlaffan/biodiverse@87b4b98

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
Copy link
Owner Author

vmikk commented Feb 8, 2022

I've fixed the Dockerfile (12e847c) a bit and switched to the latest Biodiverse commit (shawnlaffan/biodiverse@87b4b98).

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
Copy link
Collaborator

shawnlaffan commented Feb 8, 2022

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
Copy link
Owner Author

vmikk commented Feb 9, 2022

The output is:

linux
5.13.0-25-generic

@kessya
Copy link
Collaborator

kessya commented Feb 9, 2022

For my version the output is:

linux
5.10.76-linuxkit

@shawnlaffan
Copy link
Collaborator

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

I've modified the test in shawnlaffan/biodiverse@cc1f70a
This might have the desired effect of fixing the underlying problem. Could you try that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants