Skip to content
Merged
Show file tree
Hide file tree
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
15 changes: 1 addition & 14 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
@file:Suppress("UnstableApiUsage")

import java.io.InputStream
import org.gradle.process.CommandLineArgumentProvider
import org.gradle.process.ExecOperations
import org.gradle.kotlin.dsl.support.serviceOf

Expand Down Expand Up @@ -58,16 +57,11 @@ dependencies {
// into the same `~/.npm/_npx` directory, and the resulting overlap leaves the package half-written, so
// the tests fail with "RPC process shut down early". Installing once up front keeps every spawn a
// cache hit.
//
// The marker is present once that install succeeded and the tests can spawn the package, and absent
// when it did not happen, whether for a missing npx or a version npm does not have.
val javaScriptRpcMarker = layout.buildDirectory.file("tmp/warmJavaScriptRpcCache/version.txt")

val warmJavaScriptRpcCache by tasks.registering {
description = "Installs the npm package that the JavaScript RPC tests spawn, so they never race on a cold npx cache."
val rewriteJavaScriptJars = configurations.named("testRuntimeClasspath")
.map { classpath -> classpath.filter { it.name.startsWith("rewrite-javascript-") } }
val marker = javaScriptRpcMarker
val marker = layout.buildDirectory.file("tmp/warmJavaScriptRpcCache/version.txt")
val npx = if (System.getProperty("os.name").lowercase().contains("windows")) "npx.cmd" else "npx"
val execOperations = serviceOf<ExecOperations>()

Expand Down Expand Up @@ -115,13 +109,6 @@ val warmJavaScriptRpcCache by tasks.registering {
tasks.withType<Test> {
jvmArgs("-Xmx1g", "-Xms512m")
dependsOn(warmJavaScriptRpcCache)
// A published rewrite-javascript snapshot pins an exact @openrewrite/rewrite version, and the npm
// release of that version can lag the Maven one, leaving nothing for the RPC process to run. Tests
// annotated with @RequiresJavaScriptRpc skip rather than fail the build over that gap upstream.
val marker = javaScriptRpcMarker
jvmArgumentProviders.add(CommandLineArgumentProvider {
listOf("-DjavaScriptRpcAvailable=${marker.get().asFile.isFile}")
})
}

tasks.withType<JavaCompile> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,6 @@ void test(boolean a) {
}

@Test
@RequiresJavaScriptRpc
void collapseIdenticalBranchesTypeScript() {
rewriteRun(
//language=typescript
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,6 @@ public class Test {
}

@Test
@RequiresJavaScriptRpc
void typescriptCode() {
rewriteRun(
//language=typescript
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,6 @@ void test(boolean a, boolean b) {
}

@Test
@RequiresJavaScriptRpc
void mergeNestedIfsTypeScript() {
rewriteRun(
//language=typescript
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,6 @@ void test (int state) {
}

@Test
@RequiresJavaScriptRpc
void doNotChangeNonJavaLanguages() {
rewriteRun(
typescript(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,6 @@ void test(boolean a, boolean b) {
}

@Test
@RequiresJavaScriptRpc
void mergeIdenticalBranchesTypeScript() {
rewriteRun(
//language=typescript
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,6 @@ void test(int x) {
}

@Test
@RequiresJavaScriptRpc
void removeDuplicateElseIfTypeScript() {
rewriteRun(
//language=typescript
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,6 @@ public J.Identifier visitIdentifier(J.Identifier identifier, Integer p) {
}

@Test
@RequiresJavaScriptRpc
void removeSelfAssignmentTypeScript() {
rewriteRun(
//language=typescript
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,6 @@ void test() {
}

@Test
@RequiresJavaScriptRpc
void removeOverwrittenMapSetTypeScript() {
rewriteRun(
//language=typescript
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1373,7 +1373,6 @@ fun initializerRemoved() : String {
}

@Nested
@RequiresJavaScriptRpc
class Typescript {
@Test
void noChange() {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,6 @@ boolean test(boolean a) {
}

@Test
@RequiresJavaScriptRpc
void simplifyLogicalAndTypeScript() {
rewriteRun(
//language=typescript
Expand Down
Loading