-
-
Notifications
You must be signed in to change notification settings - Fork 632
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
test-changed doesn't appear to respect exclude_target_regexp #3977
Comments
Unit tests pass with the above. I don't think there is any coverage for the feature. |
I think first exclude-target-regexp is a global option, so put it under scope test-changed may cause the normal handling get skipped. And for the issue you mentioned, your hack definitely works, and I think in general it is how we handle exclude-target-regexp currently in changed related tasks, ie, pass this flag to change calculator and use it as a filter right before returning the results. https://github.com/pantsbuild/pants/blob/master/src/python/pants/scm/change_calculator.py#L109-L113 But one thing I noticed when browsing the code is that, changed calculator relies on source mapper which relies on address_mapper for its work. The exclude-target-regexp option is supposed to be used inside address_mapper. Clearly v1 address_mapper does not have correct implementation of this exclude logic. Only scan_specs() uses this flag to filter out excluded targets. V2 address_mapper should not have this problem, as the exclude logic is inside v2 engine. The v2 address_mapper is just a facade. You can verify if running test-changed with --enable-v2-engine gives you correct output. My opinion is we don't need this flag in change calculator at all. We should fix v1 address_mapper to respect this flag in all its methods, and we will get correct results. |
Your comment sounds reasonable to me - I didn't look at this for much more than a few moments in order to A) repro and b) workaround. However, in the Pants repro posted above, passing Will follow up by emailing to the RC thread. |
@mateor I modified a file in core_tasks/, and tried this command:
and it showed
Without --enable-v2-engine, this is what I get:
|
merged. |
I am testing 1.2.0rc1 in our repo and passing
exclude_target_regexp
totest-changed
doesn't appear to be working.I was able to hack it working with:
The rest of the options look to be gathered from the ChangedRequest.from_options(chained_options), it is possible the "correct" thing is to change the excludes to be also attached the ChangedRequest.
Here is a repro from Pants 1.2.0rc1 checkout:
Before the above patch:
After the above patch was applied:
The text was updated successfully, but these errors were encountered: