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

DeGraph should not be run as part of test task #481

Closed
oehme opened this issue Aug 27, 2016 · 8 comments
Closed

DeGraph should not be run as part of test task #481

oehme opened this issue Aug 27, 2016 · 8 comments

Comments

@oehme
Copy link
Contributor

oehme commented Aug 27, 2016

The Junit 5 build is currently running DeGraph as a Junit test in DependencyTests. This means that someone just running ./gradlew test will also run this very expensive check, even though they probably just were interested in running "real" unit tests.

Ignoring this single test cuts test execution time from 25s to 10s on my machine.

I'd suggest writing a dedicated task for DeGraph.

@oehme
Copy link
Contributor Author

oehme commented Aug 27, 2016

I'm working on a fix, which is blocked on a DeGraph issue. Feel free to up-vote it :)

@oehme oehme changed the title JCheck should not be run as part of test task DeGraph should not be run as part of test task Aug 27, 2016
@sbrannen sbrannen added this to the 5.0 M3 milestone Aug 27, 2016
@sbrannen
Copy link
Member

Thanks for raising the issue and working on a fix!

I've slated this for M3 with the hope that we can get it in by then. Otherwise, we'll just push it back to M4.

@sbrannen
Copy link
Member

By the way, we are very aware of how long that "test" takes.

That's why we moved it to a dedicated project in the first place.

And that's why I practically always execute gradlew clean test -x :test. 😉

@oehme
Copy link
Contributor Author

oehme commented Aug 27, 2016

And that's why I practically always execute gradlew clean test -x :test

Yes, but such "secret knowledge" should not be necessary to get a good dev experience :)

In this case a dedicated task is the right solution. More generally though, if you have expensive tests (let's say integration tests), you should create a custom sourceSet for those. The default test task is really only meant for unit tests and users generally expect it to be fast.

@marcphilipp
Copy link
Member

I really would like to have a Gradle plugin for degraph. I've talked to @schauder (the author of degraph) about it and he would welcome it but does not have time to do it.

@oehme
Copy link
Contributor Author

oehme commented Aug 27, 2016

I'll make sure that the fix I'm currently working on will be simple to wrap in a published plugin. So anyone can then pick it up.

sbrannen added a commit that referenced this issue Aug 27, 2016
Prior to this commit, the slow DeGraph dependency tests were always
executed via the standard Gradle `test` task. The only way to execute
all tests without DeGraph was to execute `gradlew test -x :test` which
is not very intuitive for most developers.

This commit addresses this issue by introducing a new (empty) `degraph`
task in the root project which acts as an "alias" for the
`junitPlatformTest` task.

In addition, the dependency from the standard `test` task to the
`junitPlatformTest` task has been removed for the root project, and a
dependency from the `check` task to the `degraph` task has been added
for the root project.

Consequently, executing `gradlew test` will no longer run the DeGraph
tests, but executing `gradlew degraph` or `gradlew check` will.

Issue: #481
@sbrannen sbrannen self-assigned this Aug 27, 2016
@sbrannen
Copy link
Member

Via some Gradle wizardry, I have already addressed the major concerns of this issue in d268d9f. 😉

Of course, a real plugin for DeGraph would be great.

@sbrannen
Copy link
Member

Closing this issue due to the work performed in d268d9f.

An actual migration to a dedicated plugin will be addressed in #483.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants