(test) Remove tests from fast suite

Adding a new @Tag("flaky") for tests that do not reliably return successes.  These may still be valuable during development, but should not run in CI.

Also tagging a few of the slower tests with the old @Tag("slow"), to speed up the run-time.
This commit is contained in:
Viktor Lofgren 2024-11-17 19:45:59 +01:00
parent af40fa327b
commit 9eb16cb667
6 changed files with 11 additions and 3 deletions

View File

@ -1,9 +1,8 @@
package nu.marginalia.functions.searchquery.query_parser.model; package nu.marginalia.functions.searchquery.query_parser.model;
import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import java.util.Comparator;
import java.util.Set; import java.util.Set;
import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
@ -101,7 +100,7 @@ class QWordGraphTest {
assertEquals("q b ( c | d )", graph.compileToQuery()); assertEquals("q b ( c | d )", graph.compileToQuery());
} }
@Disabled // flaky, the order of the variants is not guaranteed @Tag("flaky") // flaky, the order of the variants is not guaranteed
@Test @Test
void testCompile5() { void testCompile5() {
// Construct a graph like // Construct a graph like

View File

@ -15,6 +15,7 @@ import nu.marginalia.model.crawldata.CrawledDomain;
import nu.marginalia.model.crawldata.SerializableCrawlData; import nu.marginalia.model.crawldata.SerializableCrawlData;
import nu.marginalia.model.html.HtmlStandard; import nu.marginalia.model.html.HtmlStandard;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import java.io.IOException; import java.io.IOException;
@ -24,6 +25,7 @@ import java.util.*;
import static org.junit.jupiter.api.Assertions.*; import static org.junit.jupiter.api.Assertions.*;
@Tag("slow")
public class ConvertingIntegrationTest { public class ConvertingIntegrationTest {
private DomainProcessor domainProcessor; private DomainProcessor domainProcessor;

View File

@ -10,6 +10,7 @@ import org.jsoup.Jsoup;
import org.jsoup.nodes.Document; import org.jsoup.nodes.Document;
import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import java.io.IOException; import java.io.IOException;
@ -17,6 +18,7 @@ import java.net.URISyntaxException;
import java.nio.file.Path; import java.nio.file.Path;
import java.util.*; import java.util.*;
@Tag("slow")
class SummaryExtractorTest { class SummaryExtractorTest {
private SummaryExtractor summaryExtractor; private SummaryExtractor summaryExtractor;
private DocumentKeywordExtractor keywordExtractor; private DocumentKeywordExtractor keywordExtractor;

View File

@ -7,6 +7,7 @@ import nu.marginalia.converting.ConverterModule;
import nu.marginalia.converting.processor.ConverterDomainTypes; import nu.marginalia.converting.processor.ConverterDomainTypes;
import nu.marginalia.converting.sideload.SideloadSourceFactory; import nu.marginalia.converting.sideload.SideloadSourceFactory;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.mockito.Mockito; import org.mockito.Mockito;
@ -17,6 +18,7 @@ import java.util.UUID;
import static org.mockito.Mockito.when; import static org.mockito.Mockito.when;
@Tag("slow")
class RedditSideloaderTest extends AbstractModule { class RedditSideloaderTest extends AbstractModule {
/* This test case exists for debugging, to get deep into the Reddit sideloader and see if it can read the files. /* This test case exists for debugging, to get deep into the Reddit sideloader and see if it can read the files.
* Update the path to the Reddit database in the dbPath variable. * Update the path to the Reddit database in the dbPath variable.

View File

@ -3,10 +3,12 @@ package nu.marginalia.api.svc;
import nu.marginalia.api.model.ApiLicense; import nu.marginalia.api.model.ApiLicense;
import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*; import static org.junit.jupiter.api.Assertions.*;
@Tag("flaky")
class RateLimiterServiceTest { class RateLimiterServiceTest {
RateLimiterService rateLimiterService; RateLimiterService rateLimiterService;

View File

@ -15,6 +15,7 @@ tasks.register('fastTests', Test) {
maxHeapSize = "8G" maxHeapSize = "8G"
useJUnitPlatform { useJUnitPlatform {
excludeTags "slow" excludeTags "slow"
excludeTags "flaky"
} }
} }