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

Several issues in test suite #15

Open
tillea opened this issue Jan 25, 2019 · 5 comments
Open

Several issues in test suite #15

tillea opened this issue Jan 25, 2019 · 5 comments

Comments

@tillea
Copy link

tillea commented Jan 25, 2019

Hi,
I tried to build Filtlong on Debian and was running the test suite:

python3 -m unittest
.......................FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF.FF..
======================================================================
FAIL: test_sort_high_threshold_1 (test.test_sort.TestSort)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/andreas/debian-maintain/salsa/med-team/0_prospective/build-area/filtlong-0.2.0/test/test_sort.py", line 93, in test_sort_high_threshold_1
    self.assertTrue('target: 100,000 bp' in console_out)
AssertionError: False is not true

======================================================================
FAIL: test_sort_high_threshold_1_assembly_ref (test.test_sort.TestSort)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/andreas/debian-maintain/salsa/med-team/0_prospective/build-area/filtlong-0.2.0/test/test_sort.py", line 101, in test_sort_high_threshold_1_assembly_ref
    self.assertTrue('target: 100,000 bp' in console_out)
AssertionError: False is not true

======================================================================
FAIL: test_sort_high_threshold_1_assembly_ref_fasta (test.test_sort.TestSort)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/andreas/debian-maintain/salsa/med-team/0_prospective/build-area/filtlong-0.2.0/test/test_sort.py", line 117, in test_sort_high_threshold_1_assembly_ref_fasta
    self.assertTrue('target: 100,000 bp' in console_out)
AssertionError: False is not true

...
======================================================================
FAIL: test_trim_2 (test.test_trim.TestTrim)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/andreas/debian-maintain/salsa/med-team/0_prospective/build-area/filtlong-0.2.0/test/test_trim.py", line 87, in test_trim_2
    self.assertTrue('4 reads (4,901 bp)' in console_out)
AssertionError: False is not true

----------------------------------------------------------------------
Ran 68 tests in 43.572s

FAILED (failures=42)

Please let me know if you need further information.
Kind regards, Andreas.

@tillea
Copy link
Author

tillea commented Feb 12, 2019

Hi again,
is there any additional information you might need to reproduce the unittest errors?

@kapsakcj
Copy link

I go the same exact errors while running the unit test on ubuntu 16 (in a docker container). This was using the v0.2.0 release. Happy to help debug too.

python3 -m unittest
.......................FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF.FF..
======================================================================
FAIL: test_sort_high_threshold_1 (test.test_sort.TestSort)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Filtlong-0.2.0/test/test_sort.py", line 93, in test_sort_high_threshold_1
    self.assertTrue('target: 100,000 bp' in console_out)
AssertionError: False is not true

======================================================================
FAIL: test_sort_high_threshold_1_assembly_ref (test.test_sort.TestSort)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Filtlong-0.2.0/test/test_sort.py", line 101, in test_sort_high_threshold_1_assembly_ref
    self.assertTrue('target: 100,000 bp' in console_out)
AssertionError: False is not true

...

Ran 68 tests in 41.534s

FAILED (failures=42)

@tillea
Copy link
Author

tillea commented May 12, 2020

Ping? Is there any intend to work on this issue?

@ballaneypranav
Copy link

Hi,
I've noticed that Filtlong prints numbers formatted according to the locale (100,000 or 100000), but the unittest scripts expect them to be formatted as 100,000. For the Debian package, we've solved the issue by patching the test files to ignore commas in numbers.

You can take a look at the patch here: https://salsa.debian.org/med-team/filtlong/-/blob/master/debian/patches/ignore_locales_in_test_output.patch

Regards,
Pranav

@dzolier
Copy link

dzolier commented Feb 21, 2022

Hi, I've noticed that Filtlong prints numbers formatted according to the locale (100,000 or 100000), but the unittest scripts expect them to be formatted as 100,000. For the Debian package, we've solved the issue by patching the test files to ignore commas in numbers.

You can take a look at the patch here: https://salsa.debian.org/med-team/filtlong/-/blob/master/debian/patches/ignore_locales_in_test_output.patch

Regards, Pranav

I wrote a few shell commands to address this issue for the three offending files:

cd filtlong_folder/test
perl -pi -e 's/(?<=\d),(?=\d)//g' test_sort.py
perl -pi -e 's/(?<=\d),(?=\d)//g' test_split.py
perl -pi -e 's/(?<=\d),(?=\d)//g' test_trim.py
sed -i "s/ bp' in console_out/ bp' in console_out.replace(',', '')/g" test_sort.py
sed -i "s/ bp)' in console_out/ bp)' in console_out.replace(',', '')/g" test_split.py
sed -i "s/ bp)' in console_out/ bp)' in console_out.replace(',', '')/g" test_trim.py
cd filtlong_folder

After these, I got a successful run of python3 -m unittest
More specifically, the results were:

....................................................................
----------------------------------------------------------------------
Ran 68 tests in 50.953s

OK

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

4 participants