Add annotation to prevent test invocation twice
Cause: it helps to fix double inversion of muted non-flaky tests result (KTI-216).
This commit is contained in:
+6
-2
@@ -18,13 +18,17 @@ package org.jetbrains.kotlin.idea.test;
|
||||
|
||||
import com.intellij.codeInsight.CodeInsightTestCase;
|
||||
import com.intellij.openapi.vfs.newvfs.impl.VfsRootAccess;
|
||||
import kotlin.Unit;
|
||||
import org.jetbrains.kotlin.test.KotlinTestUtils;
|
||||
import org.jetbrains.kotlin.test.MuteWithDatabaseKt;
|
||||
import org.jetbrains.kotlin.test.WithMutedInDatabaseRunTest;
|
||||
|
||||
import static org.jetbrains.kotlin.test.MuteWithDatabaseKt.isIgnoredInDatabaseWithLog;
|
||||
|
||||
/**
|
||||
* Please use KotlinLightCodeInsightFixtureTestCase as the base class for all new tests.
|
||||
*/
|
||||
@WithMutedInDatabaseRunTest
|
||||
@Deprecated
|
||||
public abstract class KotlinCodeInsightTestCase extends CodeInsightTestCase {
|
||||
@Override
|
||||
@@ -40,7 +44,7 @@ public abstract class KotlinCodeInsightTestCase extends CodeInsightTestCase {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean shouldRunTest() {
|
||||
return super.shouldRunTest() && !isIgnoredInDatabaseWithLog(this);
|
||||
protected void runTest() throws Throwable {
|
||||
KotlinTestUtils.runTestWithThrowable(this, () -> super.runTest());
|
||||
}
|
||||
}
|
||||
|
||||
+2
-7
@@ -29,6 +29,7 @@ import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.kotlin.test.KotlinTestUtils;
|
||||
import org.jetbrains.kotlin.test.WithMutedInDatabaseRunTest;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
@@ -37,8 +38,7 @@ import java.io.OutputStreamWriter;
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.Collection;
|
||||
|
||||
import static org.jetbrains.kotlin.test.MuteWithDatabaseKt.isIgnoredInDatabaseWithLog;
|
||||
|
||||
@WithMutedInDatabaseRunTest
|
||||
public abstract class KotlinLightCodeInsightFixtureTestCaseBase extends LightCodeInsightFixtureTestCase {
|
||||
@NotNull
|
||||
@Override
|
||||
@@ -60,11 +60,6 @@ public abstract class KotlinLightCodeInsightFixtureTestCaseBase extends LightCod
|
||||
protected final Collection<File> myFilesToDelete = new THashSet<>();
|
||||
private final TempFiles myTempFiles = new TempFiles(myFilesToDelete);
|
||||
|
||||
@Override
|
||||
protected boolean shouldRunTest() {
|
||||
return super.shouldRunTest() && !isIgnoredInDatabaseWithLog(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void tearDown() throws Exception {
|
||||
myTempFiles.deleteAll();
|
||||
|
||||
+2
-7
@@ -30,6 +30,7 @@ import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.kotlin.test.KotlinTestUtils;
|
||||
import org.jetbrains.kotlin.test.WithMutedInDatabaseRunTest;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
@@ -38,8 +39,7 @@ import java.io.OutputStreamWriter;
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.Collection;
|
||||
|
||||
import static org.jetbrains.kotlin.test.MuteWithDatabaseKt.isIgnoredInDatabaseWithLog;
|
||||
|
||||
@WithMutedInDatabaseRunTest
|
||||
public abstract class KotlinLightCodeInsightFixtureTestCaseBase extends LightCodeInsightFixtureTestCase {
|
||||
@NotNull
|
||||
@Override
|
||||
@@ -65,11 +65,6 @@ public abstract class KotlinLightCodeInsightFixtureTestCaseBase extends LightCod
|
||||
protected final Collection<File> myFilesToDelete = new THashSet<>();
|
||||
private final TempFiles myTempFiles = new TempFiles(myFilesToDelete);
|
||||
|
||||
@Override
|
||||
protected boolean shouldRunTest() {
|
||||
return super.shouldRunTest() && !isIgnoredInDatabaseWithLog(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void tearDown() throws Exception {
|
||||
myTempFiles.deleteAll();
|
||||
|
||||
Reference in New Issue
Block a user