-
-
Notifications
You must be signed in to change notification settings - Fork 649
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
PytestRun --fast multi-source-chroots do not account for namespace packages #5426
Comments
OK - the current state of the world, in layers from low to high:
Off the top - the PEX mechanism generating ns packages in 1 should not be relied on - this is TODO'd dead code. Implementing a proactive 2 that injected ns packages in all PEXs generated by An approach here then might be to:
The assumption here is coverage data is never desired for the code contained in test targets. |
A few considerations that fall out of the above:
Perhaps 1 & 2 can be addressed by learning This still falls down though, since the logic would take |
The whole other tack to take here would be to modify |
A I'll give this a spin when I next pick this work back up. The main thrust being we could return to a single source pex and just have the coverage plugin wire up the correct report mappings back to the source root original sources. |
This seems reasonable to me... we're happy to clean up code if the result is something that follows python conventions anyway.
I feel like this impact (specifically the impact on coverage) would be fine as long as it results in a stable winning target and a warning that only one target is being considered for coverage (with a little bit of intelligence as to how the target is selected)? When I think of the usecases in pantsbuild/pants for overlapping packages, the primary usecase is with nesting: so the contrib modules all collide, but only for nested/empty preceding packages. So the choice of which target to consider for coverage of a module could be stable as "has the most sources in that module", or something. |
OK - checking back in to note that the coverage plugin approach appears to work. A good bit more polish is needed as well as unit tests, but the mechanism looks good. |
OK, implementing a clean plugin is currently not possible due to https://bitbucket.org/ned/coveragepy/issues/646/modifying-coverage-reporting-for-python but the workaround demonstrated there suffices for Pants for now. |
Use a coverage plugin instead of `coverage combine` to open the door to using a single PEX test source chroot even when testing against multiple repo source roots at once. Groundwork for pantsbuild#5426.
Use a coverage plugin instead of `coverage combine` to open the door to using a single PEX test source chroot even when testing against multiple repo source roots at once. Needed for pantsbuild#5426 Depends on pantsbuild#5420
This change reverts the majority of pantsbuild#5400 (GatherSources) and adjusts the new coverage plugin path mapping system to handle mapping a single source chroot back to potentially multiple source roots. The existing tests of this capability introduced in pantsbuild#5400 still pass and as a result the previously conflicting use cases represented by pantsbuild#5314 (multiple library/binary source roots with interdependencies under test) and pantsbuild#5426 (parallel test packages in a test source root) are now both satisfied. Fixes pantsbuild#5314 Fixes pantsbuild#5426 Depends on pantsbuild#5534
This change reverts the majority of #5400 (GatherSources) and adjusts the new coverage plugin path mapping system to handle mapping a single source chroot back to potentially multiple source roots. The existing tests of this capability introduced in #5400 still pass and as a result the previously conflicting use cases represented by #5314 (multiple library/binary source roots with interdependencies under test) and #5426 (parallel test packages in a test source root) are now both satisfied. Fixes #5314 Fixes #5426 Depends on #5534
Use a coverage plugin instead of `coverage combine` to open the door to using a single PEX test source chroot even when testing against multiple repo source roots at once. Needed for pantsbuild#5426 Depends on pantsbuild#5420
This change reverts the majority of pantsbuild#5400 (GatherSources) and adjusts the new coverage plugin path mapping system to handle mapping a single source chroot back to potentially multiple source roots. The existing tests of this capability introduced in pantsbuild#5400 still pass and as a result the previously conflicting use cases represented by pantsbuild#5314 (multiple library/binary source roots with interdependencies under test) and pantsbuild#5426 (parallel test packages in a test source root) are now both satisfied. Fixes pantsbuild#5314 Fixes pantsbuild#5426 Depends on pantsbuild#5534
This change reverts the majority of #5400 (GatherSources) and adjusts the new coverage plugin path mapping system to handle mapping a single source chroot back to potentially multiple source roots. The existing tests of this capability introduced in #5400 still pass and as a result the previously conflicting use cases represented by #5314 (multiple library/binary source roots with interdependencies under test) and #5426 (parallel test packages in a test source root) are now both satisfied. Fixes #5314 Fixes #5426 Depends on #5534
A classic case here is a repo layout of:
Here we have tests with a parallel package structure to the code under test, but separated into two source roots. Under the covers, we construct an execution pex by PEX_PATH combining two independent source pexes, neither of which is declaring namespace packages for
lib
in this example - and this leads to an inability to find code.The text was updated successfully, but these errors were encountered: