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

Make test discovery for test_testprojects.py IT more precise #8395

Merged
merged 8 commits into from
Oct 9, 2019

Conversation

Eric-Arellano
Copy link
Contributor

@Eric-Arellano Eric-Arellano commented Oct 4, 2019

Problem

Currently, test_testproject.py runs test against everything in testprojects:: and examples::, including the files() targets we've been adding while porting to V2. We don't want those new files() targets to be run here.

Solution

We blacklist certain target types that don't make sense to test.

We also now run ./pants compile lint test on every target. This does not make any difference now but prepares us for V2 where ./pants test doesn't trigger prerequisite goals as it does in V1.

Result

We no longer test targets that don't make sense, like files(). This prepares us for chrooting this test by allowing us to ignore targets we don't care about.

@Eric-Arellano Eric-Arellano changed the title Make test discovery for testprojects IT more precise Make test discovery for test_testprojects.py IT more precise Oct 4, 2019
@Eric-Arellano Eric-Arellano force-pushed the precise-testprojects branch 2 times, most recently from 91af7a4 to 67c85ca Compare October 4, 2019 22:14
# `test` to trigger side effects via the goal graph, such as compiling JVM code or generating
# antlr code. Instead, we should run the specific command we are testing for that target type.
# For example, `python_antlr_library` would only need `./pants gen`.
for bfa in [
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm.

So, as discussed in Slack, I think that it would be better to do something like ./pants compile test lint here (or whichever other goals) and wait for #8368 to land.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm okay. I redesigned this PR around this feedback. Abandonded the goal of mapping target types -> commands; instead, everything now uses ./pants compile lint test.

Also now blacklist certain target types, rather than this whitelist approach. IMO there is still value in skipping python_requirement_library and files() etc.

1) Blacklist certain target types, rather than whitelisting
2) Abandon idea of specific commands based on the target type. Everyone uses `./pants compile lint test` now
@Eric-Arellano Eric-Arellano requested a review from stuhood October 5, 2019 15:53
1) managed_jar_libraries is not recognized
2) target means that _everything_ will be skipped
@Eric-Arellano
Copy link
Contributor Author

Bump on this. I redesigned the approach and I think it's an improvement from before.

Copy link
Member

@stuhood stuhood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@Eric-Arellano Eric-Arellano merged commit 66446d6 into pantsbuild:master Oct 9, 2019
@Eric-Arellano Eric-Arellano deleted the precise-testprojects branch October 9, 2019 04:01
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.

2 participants