Skip to content

Commit

Permalink
- Use plugin 2.0.0
Browse files Browse the repository at this point in the history
- Update flaky test
  • Loading branch information
arhont375 committed Jul 31, 2024
1 parent 9166653 commit 7332c9e
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 22 deletions.
18 changes: 10 additions & 8 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,22 @@ import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent

plugins {
id("org.jetbrains.intellij.platform") version "2.0.0-rc2" apply false
id("java")
id("idea")
}

idea {
module {
isDownloadSources = true
isDownloadJavadoc = true
}
}

subprojects {
apply(plugin = "java")
apply(plugin = "idea")

idea {
module {
if (System.getenv("CI").toBoolean()) {
isDownloadSources = true
isDownloadJavadoc = true
}
}
}

java {
toolchain {
Expand Down
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ ideaVersion=IC-242.20224.159
ideaSinceVersion=242

junitVersion=5.9.2

ideaPlatformPluginVersion=2.0.0
2 changes: 1 addition & 1 deletion jps-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id("org.jetbrains.intellij.platform")
id("org.jetbrains.intellij.platform.base")
id("java")
}

Expand Down
16 changes: 7 additions & 9 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
/*
* This file was generated by the Gradle 'init' task.
*
* The settings file is used to specify which projects to include in your build.
*
* Detailed information about configuring a multi-project build in Gradle can be found
* in the user manual at https://docs.gradle.org/6.0/userguide/multi_project_builds.html
*/

pluginManagement {
val ideaPlatformPluginVersion: String by settings

plugins {
id("org.jetbrains.intellij.platform") version ideaPlatformPluginVersion
id("org.jetbrains.intellij.platform.base") version ideaPlatformPluginVersion
}

repositories {
maven("https://oss.sonatype.org/content/repositories/snapshots/")
gradlePluginPortal()
Expand Down
2 changes: 2 additions & 0 deletions thrift/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ dependencies {
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
testRuntimeOnly("org.junit.vintage:junit-vintage-engine")

implementation("org.awaitility:awaitility:4.2.1")

intellijPlatform {
create(project.property("ideaVersion") as String)
bundledPlugins("com.intellij.java")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
public class NameDuplicatesTest extends ThriftInspectionTestBase {
public NameDuplicatesTest() {
super("inspections/duplicates/name", ThriftNameDuplicatesInspection.class);

}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
import com.intellij.plugins.thrift.ThriftCodeInsightFixtureTestCase;
import com.intellij.plugins.thrift.ThriftFileType;
import com.intellij.usages.Usage;
import org.awaitility.Awaitility;
import org.jetbrains.annotations.NotNull;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

import java.time.Duration;
import java.util.Collection;

import static org.junit.jupiter.api.Assertions.assertEquals;
Expand All @@ -25,9 +27,14 @@ void setUp() {
}

protected void doTest(int size) throws Throwable {
final Collection<Usage> elements = getFixture().testFindUsagesUsingAction();
assertNotNull(elements);
assertEquals(size, elements.size());
Awaitility
.await()
.atMost(Duration.ofSeconds(10))
.untilAsserted(() -> {
final Collection<Usage> elements = getFixture().testFindUsagesUsingAction();
assertNotNull(elements);
assertEquals(size, elements.size());
});
}

@Test
Expand Down

0 comments on commit 7332c9e

Please sign in to comment.