-
Notifications
You must be signed in to change notification settings - Fork 17
Excavator: Migrate Groovy nebula test SlsPackagingCompatibilityIntegrationSpec to the new Java Junit framework
#1506
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
Open
svc-excavator-bot
wants to merge
10
commits into
develop
Choose a base branch
from
roomba/migrate-gradle-testing-junit-framework-36debc64a3cf516f
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+3,151
−133
Open
Changes from 5 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
7849d8e
Excavator: Migrate Groovy nebula test `SlsPackagingCompatibilityInte…
svc-excavator-bot bdd629d
Resolve nit
svc-nit 3c0a0c1
fixup for gradle 9
FinlayRJW 768b421
merge
FinlayRJW 4a5187c
why all done this?
FinlayRJW d596185
tidy
FinlayRJW 85f54cd
Merge branch 'develop' into roomba/migrate-gradle-testing-junit-frame…
FinlayRJW 239d592
Resolve nit
svc-nit b3aefd9
Resolve nit
svc-nit 740d339
merge
FinlayRJW File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
124 changes: 0 additions & 124 deletions
124
src/test/groovy/com/palantir/gradle/versions/SlsPackagingCompatibilityIntegrationSpec.groovy
This file was deleted.
Oops, something went wrong.
125 changes: 125 additions & 0 deletions
125
src/test/java/com/palantir/gradle/versions/SlsPackagingCompatibilityIntegrationTest.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,125 @@ | ||
| /* | ||
| * (c) Copyright 2019 Palantir Technologies Inc. All rights reserved. | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| package com.palantir.gradle.versions; | ||
|
|
||
| import static com.palantir.gradle.testing.assertion.GradlePluginTestAssertions.assertThat; | ||
|
|
||
| import com.palantir.gradle.testing.execution.GradleInvoker; | ||
| import com.palantir.gradle.testing.execution.InvocationResult; | ||
| import com.palantir.gradle.testing.junit.DisabledConfigurationCache; | ||
| import com.palantir.gradle.testing.junit.GradlePluginTests; | ||
| import com.palantir.gradle.testing.maven.MavenArtifact; | ||
| import com.palantir.gradle.testing.maven.MavenRepo; | ||
| import com.palantir.gradle.testing.project.RootProject; | ||
| import com.palantir.gradle.testing.project.SubProject; | ||
| import java.util.List; | ||
| import org.junit.jupiter.api.BeforeEach; | ||
| import org.junit.jupiter.api.Test; | ||
|
|
||
| /** | ||
| * https://github.com/palantir/sls-packaging does some funky stuff when resolving inter-project dependencies for the | ||
| * purposes of detecting published recommended product dependencies, so we want to make double sure that GCV doesn't | ||
| * accidentally break it. | ||
| */ | ||
| @GradlePluginTests | ||
| @DisabledConfigurationCache | ||
| class SlsPackagingCompatibilityIntegrationTest { | ||
|
|
||
| private static final String PLUGIN_NAME = "com.palantir.consistent-versions"; | ||
|
|
||
| @BeforeEach | ||
| void setup(MavenRepo repo, RootProject rootProject) { | ||
| repo.publish(MavenArtifact.of("org.slf4j:slf4j-api:1.7.24")); | ||
|
|
||
| rootProject | ||
| .buildGradle() | ||
| .plugins() | ||
| .add(PLUGIN_NAME) | ||
| .addWithoutApply("com.palantir.sls-java-service-distribution"); | ||
|
|
||
| rootProject.buildGradle().append(""" | ||
| buildscript { | ||
| repositories { | ||
| mavenCentral() | ||
| } | ||
| } | ||
| allprojects { | ||
| repositories { | ||
| maven { url = uri('%s') } | ||
| } | ||
| } | ||
| """, repo.path()); | ||
| } | ||
|
|
||
| @Test | ||
| void can_consume_recommended_product_dependencies_project( | ||
| GradleInvoker gradle, RootProject rootProject, SubProject api, SubProject service) { | ||
| rootProject.propertiesFile("versions.props").appendProperty("org.slf4j:*", "1.7.24"); | ||
|
|
||
| rootProject.buildGradle().append(""" | ||
| allprojects { | ||
| version = '1.0.0' | ||
| } | ||
| """); | ||
|
|
||
| api.buildGradle().plugins().add("java").add("com.palantir.sls-recommended-dependencies"); | ||
|
|
||
| api.buildGradle().append(""" | ||
| dependencies { | ||
| implementation 'org.slf4j:slf4j-api' | ||
| } | ||
|
|
||
| recommendedProductDependencies { | ||
| productDependency { | ||
| productGroup = 'org' | ||
| productName = 'product' | ||
| minimumVersion = '1.1.0' | ||
| maximumVersion = '1.x.x' | ||
| } | ||
| } | ||
| """); | ||
|
|
||
| service.buildGradle().plugins().add("java").add("com.palantir.sls-java-service-distribution"); | ||
|
|
||
| service.buildGradle().append(""" | ||
| dependencies { | ||
| // Gets picked up by the productDependenciesConfig which is runtimeClasspath | ||
| implementation project(':api') | ||
| } | ||
| """); | ||
|
|
||
| InvocationResult wroteLocks = gradle.withArgs("--write-locks").buildsSuccessfully(); | ||
|
|
||
| // Maybe this is a bit too much but for a fixed version of sls-packaging, we expect this to not change | ||
| List<String> expectedTasks = List.of( | ||
| ":api:compileRecommendedProductDependencies", | ||
| ":api:processResources", | ||
| ":service:mergeDiagnosticsJson", | ||
| ":service:resolveProductDependencies", | ||
| ":service:createManifest", | ||
| ":api:classes", | ||
| ":api:configureProductDependencies", | ||
| ":api:jar", | ||
| ":service:jar"); | ||
|
|
||
| for (String taskPath : expectedTasks) { | ||
| assertThat(wroteLocks).task(taskPath).succeeded(); | ||
| } | ||
|
|
||
| gradle.withArgs("createManifest", "verifyLocks").buildsSuccessfully(); | ||
| } | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.