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

Appveyor tests aren't using Python 3 #213

Closed
latk opened this Issue Feb 13, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@latk
Member

latk commented Feb 13, 2018

I am currently working on modularization. But the tests fail on Windows! It seems when the test Makefiles invoke the gcovr script, it is using this sys.path for our Python 3 tests:

./subdir/B/testcase
../../../scripts/gcovr -r subdir -d -x -o coverage.xml
Could not find gcovr modules in:
C:\projects\gcovr\scripts
C:\windows\SYSTEM32\python27.zip
C:\Python27\DLLs
C:\Python27\lib
C:\Python27\lib\plat-win
C:\Python27\lib\lib-tk
C:\Python27
C:\Python27\lib\site-packages
Traceback (most recent call last):
  File "../../../scripts/gcovr", line 44, in <module>
    from gcovr.app import parse_arguments
ImportError: No module named gcovr.app
make: *** [Makefile:16: xml] Error 1

So gcovr was installed using Python 3, but we try to run it under Python 2 :/

And indeed, the appveyor.yml selects the Python version through an env variable:

environment:
  matrix:
    - PYTHON: C:\Python27\python.exe
    - PYTHON: C:\Python36-x64\python.exe

In the Makefile, the script is invoked like this, without using that env variable:

../../../scripts/gcovr -d -x -o coverage.xml

I assume the tests should be updated to explicitly run the selected Python, e.g.

PYTHON ?= python

xml:
	$(PYTHON) ../../../scripts/gcovr -d -x -o coverage.xml

My questions:

  • does this analysis seem sensible?
  • can someone with a Windows machine verify?
  • would someone like to contribute a fix?
@mayeut

This comment has been minimized.

Contributor

mayeut commented Feb 13, 2018

I wanted to get some coverage information for gcovr itself and for that, starting moving things around a bit. I just ran into an issue with python 3.6 on Windows which has no reason to be a result of my work and is probably a pre-existing issue, thus confirming your analysis.
I think before modularization is done, it might be a good thing to know what's the current gcovr status (and therefore, what's likely to break without anyone knowing).
I will open a PR for this work which will most probably open some discussions (and which might give you ideas on the issue you're seeing).

@latk

This comment has been minimized.

Member

latk commented Feb 14, 2018

Seems to be fixed by #214. Thank you @mayeut !

@latk latk closed this Feb 14, 2018

@latk latk removed the help wanted label Feb 14, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment