From 118c353f2dd3af8a6d4a5681a4707e1124f3675a Mon Sep 17 00:00:00 2001 From: soloturn Date: Thu, 30 Jul 2020 02:55:01 +0200 Subject: [PATCH] tag slow tests, so they can be excluded/included as the runtime of the tests can be long, tag the slow ones so they can be excluded more easy on the command line or configuration. see here for hints: https://mkyong.com/junit5/junit-5-tagging-and-filtering-tag-examples/ https://stackoverflow.com/questions/60474190/how-to-include-exclude-junit5-tags-in-gradle-cmd to run tests with tag slow only, or not run tags with tag slow do, quoting the expression might be necessary depending on the shell: mvn clean install -Dtest=FuraffinityRipperTest -Dgroups=slow mvn clean install -Dtest=FuraffinityRipperTest '-Dgroups=!slow' --- README.md | 5 ++++- pom.xml | 15 ++------------- .../tst/ripper/rippers/FuraffinityRipperTest.java | 3 +++ 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 63299485..5d31bc42 100644 --- a/README.md +++ b/README.md @@ -88,10 +88,13 @@ This will include all dependencies in the JAR. # Running Tests -After building you can run tests by running the following: +Tests can be marked as beeing slow or not. Default is to run all tests. Slow tests can be excluded to run, and slow +tests can be run on its own. After building you can run tests, quoting might be necessary depending on your shell: ```bash mvn test +mvn test -Dgroups=slow +mvn test '-Dgroups=!slow' ``` Please note that some tests may fail as sites change and our rippers become out of date. diff --git a/pom.xml b/pom.xml index 60e08138..7180ff27 100644 --- a/pom.xml +++ b/pom.xml @@ -143,18 +143,7 @@ maven-surefire-plugin - 2.22.2 - - - slow - - - - + 3.0.0-M5 @@ -163,7 +152,7 @@ org.apache.maven.plugins maven-surefire-report-plugin - 3.0.0-M3 + 3.0.0-M5 false diff --git a/src/test/java/com/rarchives/ripme/tst/ripper/rippers/FuraffinityRipperTest.java b/src/test/java/com/rarchives/ripme/tst/ripper/rippers/FuraffinityRipperTest.java index 1efc30f7..8e2e359a 100644 --- a/src/test/java/com/rarchives/ripme/tst/ripper/rippers/FuraffinityRipperTest.java +++ b/src/test/java/com/rarchives/ripme/tst/ripper/rippers/FuraffinityRipperTest.java @@ -5,15 +5,18 @@ import java.net.URL; import com.rarchives.ripme.ripper.rippers.FuraffinityRipper; import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; public class FuraffinityRipperTest extends RippersTest { @Test + @Tag("slow") public void testFuraffinityAlbum() throws IOException { FuraffinityRipper ripper = new FuraffinityRipper(new URL("https://www.furaffinity.net/gallery/spencerdragon/")); testRipper(ripper); } @Test + @Tag("slow") public void testFuraffinityScrap() throws IOException { FuraffinityRipper ripper = new FuraffinityRipper(new URL("http://www.furaffinity.net/scraps/sssonic2/")); testRipper(ripper);