Page MenuHomeFreeBSD

devel/py-codecov: Add test support
ClosedPublic

Authored by cpm on May 23 2017, 4:01 PM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 20 2023, 5:59 AM
Unknown Object (File)
Nov 13 2023, 11:49 PM
Unknown Object (File)
Nov 8 2023, 9:08 PM
Unknown Object (File)
Nov 6 2023, 4:22 AM
Unknown Object (File)
Oct 17 2023, 11:32 AM
Unknown Object (File)
Oct 17 2023, 11:32 AM
Unknown Object (File)
Oct 17 2023, 11:31 AM
Unknown Object (File)
Oct 17 2023, 11:31 AM
Subscribers
None

Details

Summary
devel/py-codecov: Add test support

- Switch to USE_GITHUB
- Add TEST_DEPENDS
- Allow concurrent installation (USE_PYTHON=concurrent)
- Add do-test target

Reviewed_by: koobs
Approved by:
Differential_Revision: D10873
Test Plan
  • portlint -ac output looks fine.
  • poudriere testport builds fine on 103i386, 103amd64, 110i386, 110amd64, 120i386 and 120amd64.
  • make test has passed all tests fine.

Diff Detail

Repository
rP FreeBSD ports repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

koobs requested changes to this revision.May 28 2017, 6:10 AM
koobs added inline comments.
devel/py-codecov/Makefile
22 ↗(On Diff #28714)

Does this actually change functionality or are you merely squashing a QA warning?

30 ↗(On Diff #28714)

Does ${PYTHON_CMD) ${PYDISTUTILS_SETUP} test not work here?

Ideally that command can be made to work (pytest Good Integration Practices) and sent upstream

Failing that, does pythonxy -m pytest not just work (without specifying the test dir or test files) ?

Goal: The most minimal, most standard method to run (all) tests should be used.

devel/py-codecov/files/patch-tests_test.py
122 ↗(On Diff #28714)

No comments in patchfile describing why this was necessary, or referencing upstream issues/pull-requests. At a minimum, if this is to not run broken tests, include the failures in the comment, and skip the tests explicitly when invoking the test suite, with a comment in the makefile about those test failures.

This revision now requires changes to proceed.May 28 2017, 6:10 AM
cpm marked 2 inline comments as done.May 28 2017, 9:41 PM
cpm added inline comments.
devel/py-codecov/Makefile
22 ↗(On Diff #28714)

Although portlint doesn't complain here

#!/usr/bin/python

should be changed to

#!/usr/local/bin/python2.7
30 ↗(On Diff #28714)

I agree, but it doesn't work. If you can think of another way to run tests, let me know it.

devel/py-codecov/files/patch-tests_test.py
122 ↗(On Diff #28714)

Ok, I'll report this issue upstream.

Please also add comments to the patch outlining the test failures that require patching them out

devel/py-codecov/Makefile
22 ↗(On Diff #28714)

This shouldn't be necessary for the vast majority of files.

In particular any scripts put in LOCALBASE/bin that are installed using setup.py:console_scripts as setuptools rewrites shebangs on installation or any files not called by users on the command line directly (like __init__.py's).

That basically leaves software that doesn't use standard Python distutils/setuptools packaging practices, and installs stuff into the PATH (like LOCALBASE/bin) that users invoke directly.

cpm edited edge metadata.
cpm marked 2 inline comments as done.
cpm edited the summary of this revision. (Show Details)

Remove USES=shebangfix

cpm marked 3 inline comments as done.May 29 2017, 9:27 AM
cpm added inline comments.
devel/py-codecov/files/patch-tests_test.py
122 ↗(On Diff #28714)
cpm marked an inline comment as done.May 29 2017, 9:30 AM

Please also add comments to the patch outlining the test failures that require patching them out

If the .git directory is present or included in the distfile. All test cases run successfully.

% python2.7 -m pytest -v tests/test.py
============================= test session starts ==============================
platform freebsd12 -- Python 2.7.13, pytest-3.1.0, py-1.4.33, pluggy-0.4.0 -- /usr/local/bin/python2.7
cachedir: .cache
rootdir: /usr/home/cpm/work/gh/codecov-python, inifile:
collected 68 items 

tests/test.py::TestUploader::test_bowerrc PASSED
tests/test.py::TestUploader::test_bowerrc_none PASSED
tests/test.py::TestUploader::test_ci_appveyor PASSED
tests/test.py::TestUploader::test_ci_buildkite PASSED
tests/test.py::TestUploader::test_ci_circleci PASSED
tests/test.py::TestUploader::test_ci_codeship PASSED
tests/test.py::TestUploader::test_ci_drone PASSED
tests/test.py::TestUploader::test_ci_gitlab PASSED
tests/test.py::TestUploader::test_ci_jenkins PASSED
tests/test.py::TestUploader::test_ci_jenkins_blue_ocean PASSED
tests/test.py::TestUploader::test_ci_jenkins_env PASSED
tests/test.py::TestUploader::test_ci_magnum PASSED
tests/test.py::TestUploader::test_ci_none PASSED
tests/test.py::TestUploader::test_ci_semaphore PASSED
tests/test.py::TestUploader::test_ci_shippable PASSED
tests/test.py::TestUploader::test_ci_snap PASSED
tests/test.py::TestUploader::test_ci_travis PASSED
tests/test.py::TestUploader::test_ci_wercker PASSED
tests/test.py::TestUploader::test_command PASSED
tests/test.py::TestUploader::test_disable_detect PASSED
tests/test.py::TestUploader::test_disable_gcov SKIPPED
tests/test.py::TestUploader::test_disable_search PASSED
tests/test.py::TestUploader::test_discovers PASSED
tests/test.py::TestUploader::test_exits_0 PASSED
tests/test.py::TestUploader::test_exits_1 PASSED
tests/test.py::TestUploader::test_gcov SKIPPED
tests/test.py::TestUploader::test_ignore_report_1__coverage_worker10 PASSED
tests/test.py::TestUploader::test_ignore_report_2_coverage_jade PASSED
tests/test.py::TestUploader::test_ignore_report_3_include_lst PASSED
tests/test.py::TestUploader::test_ignore_report_4_inputFiles_lst PASSED
tests/test.py::TestUploader::test_ignore_report_5_createdFiles_lst PASSED
tests/test.py::TestUploader::test_ignore_report_6_scoverage_measurements_blackandwhite_xml PASSED
tests/test.py::TestUploader::test_ignore_report_7_test_hello_coverage_txt PASSED
tests/test.py::TestUploader::test_ignore_report_8_conftest_blackwhite_c_gcov PASSED
tests/test.py::TestUploader::test_ignored_path_10__tox PASSED
tests/test.py::TestUploader::test_ignored_path_11_venv PASSED
tests/test.py::TestUploader::test_ignored_path_12__venv_python_2_7 PASSED
tests/test.py::TestUploader::test_ignored_path_1_vendor PASSED
tests/test.py::TestUploader::test_ignored_path_2_node_modules PASSED
tests/test.py::TestUploader::test_ignored_path_3_js_generated_coverage PASSED
tests/test.py::TestUploader::test_ignored_path_4___pycache__ PASSED
tests/test.py::TestUploader::test_ignored_path_5_coverage_instrumented PASSED
tests/test.py::TestUploader::test_ignored_path_6_build_lib PASSED
tests/test.py::TestUploader::test_ignored_path_7_htmlcov PASSED
tests/test.py::TestUploader::test_ignored_path_8__egg_info PASSED
tests/test.py::TestUploader::test_ignored_path_9__git PASSED
tests/test.py::TestUploader::test_include_env PASSED
tests/test.py::TestUploader::test_is_report_10_luacov_report_out PASSED
tests/test.py::TestUploader::test_is_report_11_gcov_info PASSED
tests/test.py::TestUploader::test_is_report_12_nosetests_xml PASSED
tests/test.py::TestUploader::test_is_report_1_coverage_xml PASSED
tests/test.py::TestUploader::test_is_report_2_jacoco_xml PASSED
tests/test.py::TestUploader::test_is_report_3_jacocoTestResults_xml PASSED
tests/test.py::TestUploader::test_is_report_4_coverage_txt PASSED
tests/test.py::TestUploader::test_is_report_5_gcov_lst PASSED
tests/test.py::TestUploader::test_is_report_6_cov_gcov PASSED
tests/test.py::TestUploader::test_is_report_7_info_lcov PASSED
tests/test.py::TestUploader::test_is_report_8_clover_xml PASSED
tests/test.py::TestUploader::test_is_report_9_cobertura_xml PASSED
tests/test.py::TestUploader::test_none_found PASSED
tests/test.py::TestUploader::test_not_jacoco PASSED
tests/test.py::TestUploader::test_read_token_file PASSED
tests/test.py::TestUploader::test_require_branch_1 PASSED
tests/test.py::TestUploader::test_returns_none PASSED
tests/test.py::TestUploader::test_run_coverage SKIPPED
tests/test.py::TestUploader::test_run_coverage_fails PASSED
tests/test.py::TestUploader::test_send PASSED
tests/test.py::TestUploader::test_send_error PASSED

===================== 65 passed, 3 skipped in 2.20 seconds =====================

Add comment to explain why some test cases has been removed in patch-tests_test.py

cpm marked an inline comment as done.May 29 2017, 10:09 AM
  • Can you just mkdir .git in the test target to make it work?
  • Can this port be made concurrent safe (enabled)?
  • Add missing dependencies to TEST_DEPENDS
  • Allow concurrent installation (USE_PYTHON=concurrent)
  • Can you just mkdir .git in the test target to make it work?

No, in order to work, it needs .git directory of the original GH repository. E.g. it would work if it were included in the package.

  • Can this port be made concurrent safe (enabled)?

Done!

  • Remove depending on devel/py-unittest2, import unittest module from Python 2.7
koobs edited the summary of this revision. (Show Details)
koobs retitled this revision from devel/py-codecov: add do-test target to devel/py-codecov: Add test support.
koobs edited the summary of this revision. (Show Details)
This revision is now accepted and ready to land.May 31 2017, 11:40 AM
This revision was automatically updated to reflect the committed changes.