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

Move build integration tests out of :buildSrc project #31961

Merged
merged 1 commit into from
Jul 12, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions buildSrc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ if (project == rootProject) {
}
mavenCentral()
}
test {
include "**/*Tests.class"
exclude "**/*IT.class"
}
}

/*****************************************************************************
Expand All @@ -152,6 +156,18 @@ if (project != rootProject) {
jarHell.enabled = false
thirdPartyAudit.enabled = false

// tests can't be run with randomized test runner
// it's fine as we run them as part of :buildSrc
test.enabled = false
task integTest(type: Test) {
exclude "**/*Tests.class"
include "**/*IT.class"
testClassesDirs = sourceSets.test.output.classesDirs
Copy link
Contributor

Choose a reason for hiding this comment

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

why not project.test.testClassesDirs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I might be wrong on this, but I think the source sets are the record of truth on this.
Considering that we add a Gradle Test task and not a randomized one, I think it makes more sense than getting it from the randomzied testing task that we don't even use.

Copy link
Contributor

Choose a reason for hiding this comment

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

ok

classpath = sourceSets.test.runtimeClasspath
Copy link
Contributor

Choose a reason for hiding this comment

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

why not project.test.classpath?

inputs.dir(file("src/testKit"))
Copy link
Contributor

Choose a reason for hiding this comment

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

why is this necessary now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This doesn't really belong here, it got pulled in as I tried to separate this PR out, and forgot to remove it. The integration tests use these sample Gradle projects. What this line does is makes sure tests are not considered up to date if only this directory changes.

Copy link
Contributor

Choose a reason for hiding this comment

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

ok

}
check.dependsOn(integTest)

// TODO: re-enable once randomizedtesting gradle code is published and removed from here
licenseHeaders.enabled = false

Expand Down