echoing-manchester-70122
06/09/2020, 7:22 PM[test.pytest]
coverage=autohundreds-father-404
06/09/2020, 7:30 PMechoing-manchester-70122
06/09/2020, 7:30 PM# <https://jira.pinadmin.com/browse/SRE-4755> - all pytest config can probably be set back to defaults once we remove py2.7 support
[pytest]
version: pytest>=4.6.6,<4.7
pytest_plugins: +["setuptools<45; python_version < '3'","configparser==4.0.2; python_version < '3'","zipp<2; python_version < '3'","importlib-metadata<1.6; python_version < '3'"]
[test.pytest]
coverage=autoechoing-manchester-70122
06/09/2020, 7:30 PMechoing-manchester-70122
06/09/2020, 7:31 PMechoing-manchester-70122
06/09/2020, 7:31 PM[pytest]
timeout_requirements: pytest-timeout==1.2.0
cov_requirements: pytest-cov==2.4.0
[test.pytest]
coverage=autohundreds-father-404
06/09/2020, 7:32 PM./pants options | grep pytestechoing-manchester-70122
06/09/2020, 7:33 PM$  ./pants options |grep pytest
Scrubbed PYTHONPATH=/Users/amckenna/code/python-commons/src/main/python from the environment.
pytest.cov_requirements = pytest-cov>=2.8.1,<3 (from HARDCODED)
pytest.pytest_plugins = ['pytest-timeout>=1.3.3,<1.4', 'pytest-cov>=2.8.1,<3', "unittest2>=1.1.0 ; python_version<'3'", "more-itertools<6.0.0 ; python_version<'3'", "setuptools<45; python_version < '3'", "configparser==4.0.2; python_version < '3'", "zipp<2; python_version < '3'", "importlib-metadata<1.6; python_version < '3'"] (from CONFIG in pants.ini)
pytest.requirements = pytest>=4.6.6,<4.7 (from HARDCODED)
pytest.timeout_requirements = pytest-timeout>=1.3.3,<1.4 (from HARDCODED)
pytest.unittest2_requirements = unittest2>=1.1.0 ; python_version<'3' (from HARDCODED)
pytest.version = pytest>=4.6.6,<4.7 (from HARDCODED)
test.pytest.chroot = False (from HARDCODED)
test.pytest.coverage = auto (from CONFIG in pants.ini)
test.pytest.coverage_include_test_sources = False (from HARDCODED)
test.pytest.coverage_output_dir = None (from NONE)
test.pytest.coverage_reports = ['xml', 'html'] (from HARDCODED)
test.pytest.extra_pythonpath = [] (from NONE)
test.pytest.fast = True (from HARDCODED)
test.pytest.junit_xml_dir = None (from NONE)
test.pytest.passthrough_args = [] (from NONE)
test.pytest.profile = None (from NONE)
test.pytest.skip = False (from HARDCODED)
test.pytest.test_shard = None (from NONE)
test.pytest.timeout_default = None (from NONE)
test.pytest.timeout_maximum = None (from NONE)
test.pytest.timeout_terminate_wait = 10 (from HARDCODED)
test.pytest.timeouts = True (from HARDCODED)hundreds-father-404
06/09/2020, 7:36 PMpytest-covhundreds-father-404
06/09/2020, 7:36 PMechoing-manchester-70122
06/09/2020, 7:36 PMechoing-manchester-70122
06/09/2020, 7:36 PMechoing-manchester-70122
06/09/2020, 7:36 PM===== 17 passed, 5 warnings in 2.78 seconds ======
12:34:26 00:40       [coverage-html]
12:34:28 00:42       [coverage-xml]
                   src/test/python/.../devapp_tool                                           .....   SUCCESS
               Waiting for background workers to finish.
12:34:29 00:43   [complete]
               SUCCESShundreds-father-404
06/09/2020, 7:40 PMcoverage_output_dir[test.pytest]'dist/coverage'echoing-manchester-70122
06/09/2020, 7:43 PMechoing-manchester-70122
06/09/2020, 7:43 PMhundreds-father-404
06/09/2020, 8:59 PMpants.inipython_testscoverageechoing-manchester-70122
06/09/2020, 8:59 PMechoing-manchester-70122
06/09/2020, 9:00 PM$ grep -i coverage pants pants.ini
pants.ini:coverage=auto
pants.ini:coverage_output_dir=dist/coveragehundreds-father-404
06/09/2020, 9:00 PM./pants test./pants test path/to:test_targetechoing-manchester-70122
06/09/2020, 9:00 PMhundreds-father-404
06/09/2020, 9:01 PMpython_testssrccoverageechoing-manchester-70122
06/09/2020, 9:06 PMimportant-librarian-62877
06/09/2020, 10:57 PMhundreds-father-404
06/09/2020, 11:05 PMNo .coverage file was found! Skipping coverage reporting.hundreds-father-404
06/09/2020, 11:19 PMimportant-librarian-62877
06/09/2020, 11:24 PM[coverage-<type>]hundreds-father-404
06/09/2020, 11:36 PMautocoverage=['helloworld.util.demo']python_testsautohundreds-father-404
06/09/2020, 11:55 PMautoautosrcsrc/pythontests/pythoncoveragepython_testsimportant-librarian-62877
06/10/2020, 12:01 AMcoverageechoing-manchester-70122
06/10/2020, 12:02 AMechoing-manchester-70122
06/10/2020, 12:02 AMechoing-manchester-70122
06/10/2020, 12:03 AMenough-analyst-54434
06/10/2020, 12:04 AM./pants rootsechoing-manchester-70122
06/10/2020, 12:05 AM$ ./pants roots
Scrubbed PYTHONPATH=/Users/amckenna/code/python-commons/src/main/python from the environment.
3rdparty/python: python
src/__pycache__: __pycache__
src/main: *
src/main/attic: attic
src/main/config: config
src/main/python: python
src/main/thrift: thrift
src/test: *
src/test/__pycache__: __pycache__
src/test/attic: attic
src/test/python: pythonenough-analyst-54434
06/10/2020, 12:08 AMcoverage-html and coverage-xml are just blankDo you mean the generated index.html and coverage.xml under dist/coverage/... are blank? Or they just don't even exist?
echoing-manchester-70122
06/10/2020, 12:09 AMechoing-manchester-70122
06/10/2020, 12:09 AMenough-analyst-54434
06/10/2020, 12:09 AMenough-analyst-54434
06/10/2020, 12:09 AMenough-analyst-54434
06/10/2020, 12:10 AMenough-analyst-54434
06/10/2020, 12:11 AM17:10:35 00:06       [coverage-report]
                     Name                                                                                                                                      Stmts   Miss Branch BrPart  Cover
                     ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
                     /home/jsirois/dev/Eric-Arellano/jsirois-coverage-debug/.pants.d/pyprep/sources/7f6099ca983f89070bc723af80d653cdf20ba5d3/pkg/__init__.py       1      0      0      0   100%
                     src/python/pkg/demo.py                                                                                                                        2      0      0      0   100%
                     src/python/pkg/demo_test.py                                                                                                                   3      0      0      0   100%
                     ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
                     TOTAL                                                                                                                                         6      0      0      0   100%
                     
17:10:36 00:07       [coverage-html]
                     
17:10:36 00:07       [coverage-xml]
                     
                   src/python/pkg:tests                                                            .....   SUCCESSenough-analyst-54434
06/10/2020, 12:11 AM[coverage-report]hundreds-father-404
06/10/2020, 12:12 AMIs there documentation for that coverage field?On Pants 1.27+,
./pants target-types --details=python_tests./pants targets --details=python_testsechoing-manchester-70122
06/10/2020, 12:12 AMenough-analyst-54434
06/10/2020, 12:13 AMechoing-manchester-70122
06/10/2020, 12:14 AMenough-analyst-54434
06/10/2020, 12:15 AMechoing-manchester-70122
06/10/2020, 12:15 AMenough-analyst-54434
06/10/2020, 12:15 AMenough-analyst-54434
06/10/2020, 12:16 AMenough-analyst-54434
06/10/2020, 12:17 AMechoing-manchester-70122
06/10/2020, 12:18 AMechoing-manchester-70122
06/10/2020, 12:18 AMenough-analyst-54434
06/10/2020, 12:20 AMechoing-manchester-70122
06/10/2020, 12:20 AMenough-analyst-54434
06/10/2020, 12:20 AMenough-analyst-54434
06/10/2020, 12:20 AMenough-analyst-54434
06/10/2020, 12:21 AMhundreds-father-404
06/10/2020, 12:22 AM./pantsenough-analyst-54434
06/10/2020, 12:24 AMenough-analyst-54434
06/10/2020, 12:24 AMhundreds-father-404
06/10/2020, 12:26 AMenough-analyst-54434
06/10/2020, 12:27 AMechoing-manchester-70122
06/10/2020, 12:27 AMenough-analyst-54434
06/10/2020, 12:40 AM$ git diff src/python/pants/backend/python/tasks/pytest_run.py
diff --git a/src/python/pants/backend/python/tasks/pytest_run.py b/src/python/pants/backend/python/tasks/pytest_run.py
index fa279e1a0..0f9b96408 100644
--- a/src/python/pants/backend/python/tasks/pytest_run.py
+++ b/src/python/pants/backend/python/tasks/pytest_run.py
@@ -137,7 +137,7 @@ class PytestRun(ChrootedTestRunnerTaskMixin, Task):
         register(
             "--coverage-reports",
             fingerprint=True,
-            choices=("xml", "html"),
+            choices=("xml", "html", "console"),
             type=list,
             member_type=str,
             default=("xml", "html"),
@@ -432,6 +432,8 @@ class PytestRun(ChrootedTestRunnerTaskMixin, Task):
                     else:
                         coverage_workdir = workdirs.coverage_path
                         coverage_reports = self.get_options().coverage_reports
+                        if "console" in coverage_reports:
+                            coverage_run('report', ['-i', '--rcfile', coverage_rc])
                         if "html" in coverage_reports:
                             coverage_run(
                                 "html", ["-i", "--rcfile", coverage_rc, "-d", coverage_workdir]enough-analyst-54434
06/10/2020, 12:42 AMimportant-librarian-62877
06/10/2020, 12:46 AMhundreds-father-404
06/10/2020, 12:48 AMsrc/pythontests/pythonsrc/pythonautoenough-analyst-54434
06/10/2020, 12:59 AMimportant-librarian-62877
06/10/2020, 1:10 AMtoplevel/module/module/*.pytoplevel/module/tests_module/*.pytoplevelmodulehundreds-father-404
06/10/2020, 1:21 AMimportant-librarian-62877
06/10/2020, 1:39 AMhundreds-father-404
06/10/2020, 1:41 AMcoverageenough-analyst-54434
06/10/2020, 11:18 PM--test-pytest-coverage-reports=console[test.pytest]
coverage_reports: +["console"]echoing-manchester-70122
06/10/2020, 11:20 PMimportant-librarian-62877
06/11/2020, 12:42 AMlist--test-pytest-coveragehundreds-father-404
06/11/2020, 12:44 AMimportant-librarian-62877
06/11/2020, 1:31 AMhundreds-father-404
06/17/2020, 1:52 AMcoverageproject.util.dirutilproject.utilprojectprojectprojectjolly-midnight-72759
06/25/2020, 9:15 PMhundreds-father-404
06/25/2020, 9:20 PMcoverage