pacparser icon indicating copy to clipboard operation
pacparser copied to clipboard

tests: Fix python path in runtests.py

Open orbea opened this issue 2 years ago • 2 comments

Note: Please review that I am solving this correctly, thanks!

In Gentoo the runtests.py script fails when it fails to determine the pacparser path.

This happens because py_ver expands to 3.9 when the expected directory ends in 39. This can be solved by replacing any periods in the string.

python ../tests/runtests.py
Traceback (most recent call last):
  File "/tmp/pacparser/src/../tests/runtests.py", line 31, in runtests
    pacparser_module_path = glob.glob(os.path.join(
IndexError: list index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/tmp/pacparser/src/../tests/runtests.py", line 81, in <module>
    main()
  File "/tmp/pacparser/src/../tests/runtests.py", line 78, in main
    runtests(pacfile, testdata, tests_dir)
  File "/tmp/pacparser/src/../tests/runtests.py", line 34, in runtests
    raise Exception('Tests failed. Could not determine pacparser path.')
Exception: Tests failed. Could not determine pacparser path.

Full build log: pacparser.pymod.log

Reproduction: make -C src pymod

orbea avatar May 14 '22 09:05 orbea

Seems some of the CI tests aren't happy with this idea...

orbea avatar May 14 '22 09:05 orbea

My second attempt works for CI and local builds at least.

orbea avatar May 14 '22 19:05 orbea

Thanks a lot @orbea for this PR. We don't need this anymore though -- #142 fixes both setup.py and runtests.py.

manugarg avatar Feb 22 '23 04:02 manugarg