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

Clean up testing config files. #431

Merged
merged 20 commits into from
May 9, 2017
Merged

Clean up testing config files. #431

merged 20 commits into from
May 9, 2017

Conversation

tsroten
Copy link
Member

@tsroten tsroten commented May 7, 2017

Description

This moves the configuration from .coveragerc, pytest.ini, and conftest.py into the existing setup.cfg so we don't have our configuration scattered across so many files.

conftest.py is useful when you need to ignore files during testing based on dynamic criteria (like Python version or operating system) -- which we don't need to do (as of right now).

Checklist

  • I've added this contribution to the changelog.md. not needed
  • I've added my name to the AUTHORS file (or it's already there).

@codecov-io
Copy link

codecov-io commented May 7, 2017

Codecov Report

Merging #431 into master will decrease coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##           master   #431      +/-   ##
========================================
- Coverage   77.02%    77%   -0.02%     
========================================
  Files          22     20       -2     
  Lines        2472   1879     -593     
========================================
- Hits         1904   1447     -457     
+ Misses        568    432     -136
Impacted Files Coverage Δ
mycli/completion_refresher.py 94.73% <0%> (-5.27%) ⬇️
mycli/__init__.py

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5f9d916...c606deb. Read the comment docs.

@tsroten
Copy link
Member Author

tsroten commented May 7, 2017

Looks like the code coverage isn't quite working, yet.

@tsroten tsroten force-pushed the tsroten/clean_up_config branch from d0fc939 to d06ccd4 Compare May 7, 2017 05:02
@meeuw
Copy link
Contributor

meeuw commented May 7, 2017

This is a nice clean up! I think something goes wrong because the pytest-cov doesn't do the parallel execution or it doesn't combine the output correctly.

@tsroten
Copy link
Member Author

tsroten commented May 7, 2017

@meeuw Thanks! Removing pytest-cov still has the same code coverage problem (see latest test). It looks like the coverage gap is in code that behave would have executed. I wonder if the COVERAGE_PROCESS_START doesn't support setup.cfg. I'll look into it a bit more.

@meeuw
Copy link
Contributor

meeuw commented May 7, 2017

I've pinpointed the problem to test/features/environment.py where you've changed .coveragerc to setup.py. I think coverage doesn't recognize setup.cfg's [coverage:run] for COVERAGE_PROCESS_START.

After running behave you should see a lot of .coverage* files (if it's using parallel = True), now there is only one .coverage (parallel = False).

@tsroten
Copy link
Member Author

tsroten commented May 7, 2017

Switching it to run works. However, I can't get it to work when running behave from the project directory, only the test directory. Very odd.

What I mean is, behave runs fine from both directories, but coverage is logged only when behave is called from the test directory.

@meeuw
Copy link
Contributor

meeuw commented May 8, 2017

That is caused by cwd='..' in

context.cli = pexpect.spawnu(cmd, cwd='..')
😊

@tsroten
Copy link
Member Author

tsroten commented May 8, 2017

Yes! thanks for pointing that out. Now that I looked, I had tons of .coverage* files outside of my mycli folder because it was storing them outside of the project directory. Switching that to an absolute path now works.

@meeuw
Copy link
Contributor

meeuw commented May 8, 2017

👍 do you want pytest-cov back? Maybe it works if we first run the behave tests and then pytest-cov?
I think it's a good idea to sent a bug report for python-coverage (for .coveragerc / setup.cfg), please let me know if you've already done that.

This reverts commit adf6b93.
@tsroten
Copy link
Member Author

tsroten commented May 8, 2017

@meeuw Sure, I added it back. I think this is ready to be merged, what do you think?

@meeuw meeuw merged commit e8e6bb4 into master May 9, 2017
@meeuw meeuw deleted the tsroten/clean_up_config branch May 9, 2017 05:24
@amjith amjith removed the in progress label May 9, 2017
@meeuw
Copy link
Contributor

meeuw commented May 9, 2017

👍 very nice

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

Successfully merging this pull request may close these issues.

4 participants