Skip to content

Commit

Permalink
Fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
malinthar committed Jul 24, 2023
1 parent 8368bc5 commit 946fae5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
20 changes: 12 additions & 8 deletions language-server-simulator/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
description = 'Ballerina Language Server Simulator'

apply from: "$rootDir/gradle/javaProject.gradle"

configurations {
ballerinaDistribution
jBallerinaDistribution
dependency {
transitive true
}
Expand All @@ -10,6 +14,7 @@ ext {
distributionDir = "distribution"
nbalSourceDir = "nBallerinaSrc"
fhirSourceDir = "fhirSrc"
shortVersion = "${version}".split("-")[0]
}

dependencies {
Expand All @@ -28,23 +33,24 @@ dependencies {
}
implementation "org.slf4j:slf4j-jdk14:${slf4jJdk14Version}"
implementation "com.google.code.gson:gson:${gsonVersion}"
}

jBallerinaDistribution project(path: ":ballerina", configuration: "jBallerinaDistribution")
ballerinaDistribution project(path: ":ballerina", configuration: "ballerinaDistribution")
}

task unpackBallerinaDistribution(type: Copy) {
dependsOn configurations.jBallerinaDistribution
dependsOn configurations.ballerinaDistribution
def sourceDir = "${buildDir}/${distributionDir}"
from zipTree { "${rootDir}/ballerina/build/distributions/ballerina-${version}-swan-lake.zip" }
new File("${sourceDir}").mkdirs()
into new File("${sourceDir}")
}

task copyPackages() {
def fileDir = "${buildDir}/${distributionDir}" +
"/ballerina-${version}-swan-lake/distributions/ballerina-version"
File filePath = new File("${fileDir}");
def balVersion = filePath.readLines().get(0)
dependsOn unpackBallerinaDistribution
def sourceDir = "${buildDir}/${distributionDir}" +
"/ballerina-${version}-swan-lake/distributions/${balVersion}/repo"
"/ballerina-${version}-swan-lake/distributions/ballerina-${shortVersion}/repo"
copy {
from "${sourceDir}"
into "${buildDir}/repo"
Expand Down Expand Up @@ -83,7 +89,6 @@ task unpackBalFHIRTestProject(type: Copy) {
}

task runLSSimulatorOnnBallerina(type: JavaExec) {
dependsOn unpackBallerinaDistribution
dependsOn copyPackages
dependsOn unpackBalTestProject

Expand All @@ -106,7 +111,6 @@ task runLSSimulatorOnnBallerina(type: JavaExec) {
}

task runLSSimulatorOnFHIR(type: JavaExec) {
dependsOn unpackBallerinaDistribution
dependsOn copyPackages
dependsOn unpackBalFHIRTestProject

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public void type(String content) {
}

try {
Thread.sleep(100 + random.nextInt(300));
Thread.sleep(100 + (long) random.nextInt(300));
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
logger.error("Interrupted", e);
Expand Down

0 comments on commit 946fae5

Please sign in to comment.