mvn test

99.0% Savings
4 Commands
200.0K Tokens saved
2 Tests

Install

tokf install b273d1837ae9471e3b31a22f98d7bcd7c4ce1a8d1313e76885d948076dfdb9ff
Safety checks passed

Filter definition

# filters/mvn/test.toml — Maven test (surefire)
# Handles: mvn test, ./mvnw test
# Raw output: 200+ lines with compile noise, test execution, surefire reports
# Filtered (success): per-module test summary + totals
# Filtered (failure): per-module results + deduplicated error details + summary

command = ["mvn test", "mvn clean test", "./mvnw test", "./mvnw clean test"]

strip_ansi = true
dedup = true

skip = [
  "^WARNING: A restricted method",
  "^WARNING: java\\.lang",
  "^WARNING: Use --enable-native-access",
  "^WARNING: Restricted methods will be blocked",
  "^WARNING: A terminally deprecated method",
  "^WARNING: sun\\.misc\\.Unsafe",
  "^WARNING: Please consider reporting this",
  "^WARNING: sun\\.misc\\.Unsafe",
  "^\\[WARNING\\]",
  "^\\[INFO\\] Scanning for projects",
  "^\\[INFO\\]\\s*$",
  "^\\[INFO\\] ---",
  "^\\[INFO\\]\\s+from\\s",
  "^\\[INFO\\] Artifact .+ is present in the local repository",
  "^\\[INFO\\] Sorting file",
  "^\\[INFO\\] Pom file is already sorted",
  "^\\[INFO\\] Spotless\\.",
  "^\\[INFO\\] argLine set to",
  "^\\[INFO\\] Executing tasks",
  "^\\[INFO\\] Executed tasks",
  "^\\[INFO\\] Nothing to compile",
  "^\\[INFO\\] No sources to compile",
  "^\\[INFO\\] skip non existing",
  "^\\[INFO\\] Reactor Build Order",
  "^\\[INFO\\] No tests to run",
  "^\\[INFO\\] Tests are skipped",
  "^\\[INFO\\] File stored in the index",
  "^\\[INFO\\] Index file does not exist",
  "^\\[INFO\\] Results:",
  "^\\[ERROR\\] To see the full stack trace",
  "^\\[ERROR\\] Re-run Maven",
  "^\\[ERROR\\] For more information",
  "^\\[ERROR\\] \\[Help",
  "^\\[ERROR\\] -> \\[Help",
  "^\\[ERROR\\] Please refer to",
  "^\\[ERROR\\] See /",
  "^\\[ERROR\\] See dump files",
  "^\\[ERROR\\] After correcting",
  "^\\[ERROR\\]\\s+mvn ",
  "^\\[INFO\\] Tests run: \\d.+-- in ",
  "^\\[INFO\\] BUILD",
  "^\\[INFO\\] Finished at",
  "^\\t",
  "^Downloading from",
  "^Downloaded from",
  "^\\s*$",
]

# Per-module chunks — split on "Building <module>" reactor lines
[[chunk]]
split_on = "^\\[INFO\\] Building\\s"
include_split_line = true
collect_as = "modules"

[chunk.extract]
pattern = 'Building\s+(\S+)\s'
as = "module_name"

[[chunk.aggregate]]
pattern = 'Tests run: (\d+)'
sum = "tests_run"

[[chunk.aggregate]]
pattern = 'Failures: (\d+)'
sum = "failures"

[[chunk.aggregate]]
pattern = 'Errors: (\d+)'
sum = "errors"

[[chunk.aggregate]]
pattern = 'Skipped: (\d+)'
sum = "skipped"

# Collect the "Errors:" summary section (test name + error type, one per line)
# Ends at the total "Tests run:" line which starts with [ERROR]
[[section]]
name = "errors_section"
enter = "^\\[ERROR\\] Errors:"
exit = "^\\[ERROR\\] Tests run:"
collect_as = "error_details"

# Collect the "Failures:" summary section
[[section]]
name = "failures_section"
enter = "^\\[ERROR\\] Failures:"
exit = "^\\[ERROR\\] Tests run:"
collect_as = "failure_details"

# Collect per-class FAILURE lines (inline with test results)
[[section]]
name = "class_failures"
match = "<<< FAILURE!"
collect_as = "failed_classes"

# Collect the final [ERROR] Tests run: totals line (without <<< FAILURE — that's the summary)
[[section]]
name = "test_totals"
match = "^\\[ERROR\\] Tests run: \\d+, Failures: \\d+, Errors: \\d+, Skipped: \\d+$"
collect_as = "test_totals"

# Collect reactor summary
[[section]]
name = "reactor_summary"
enter = "^\\[INFO\\] Reactor Summary"
exit = "^\\[INFO\\] -{20}"
collect_as = "reactor_lines"

[[section]]
name = "timing"
match = "^\\[INFO\\] Total time:"
collect_as = "total_time"

# Collect the "Failed to execute" error line
[[section]]
name = "maven_error"
match = "^\\[ERROR\\] Failed to execute"
collect_as = "maven_error"

[on_success]
output = "BUILD SUCCESS\n\n{modules | each: \"  {module_name}: {tests_run} run, {failures} failures, {errors} errors, {skipped} skipped\" | join: \"\\n\"}\n\n{reactor_lines | lines | join: \"\\n\"}\n{total_time}"

[on_failure]
output = "BUILD FAILURE\n\n{modules | each: \"  {module_name}: {tests_run} run, {failures} failures, {errors} errors, {skipped} skipped\" | join: \"\\n\"}\n\nFailed test classes:\n{failed_classes | lines | join: \"\\n\"}\n\n{failure_details | lines | join: \"\\n\"}\n\n{test_totals}\n{maven_error}\n\n{reactor_lines | lines | join: \"\\n\"}\n{total_time}"

collapse_empty_lines = true

[fallback]
tail = 20

Examples

test failure shows per-module results and failure details ~1839 tokens → ~417 tokens (77% saved)
Raw output
WARNING: A restricted method in java.lang.System has been called
WARNING: java.lang.System::load has been called by org.fusesource.jansi.internal.JansiLoader in an unnamed module (file:/Users/dev/.m2/wrapper/dists/apache-maven-3.9.5-bin/32db9c34/apache-maven-3.9.5/lib/jansi-2.4.0.jar)
WARNING: Use --enable-native-access=ALL-UNNAMED to avoid a warning for callers in this module
WARNING: Restricted methods will be blocked in a future release unless native access is enabled

WARNING: A terminally deprecated method in sun.misc.Unsafe has been called
WARNING: sun.misc.Unsafe::objectFieldOffset has been called by com.google.common.util.concurrent.AbstractFuture$UnsafeAtomicHelper (file:/Users/dev/.m2/wrapper/dists/apache-maven-3.9.5-bin/32db9c34/apache-maven-3.9.5/lib/guava-32.0.1-jre.jar)
WARNING: Please consider reporting this to the maintainers of class com.google.common.util.concurrent.AbstractFuture$UnsafeAtomicHelper
WARNING: sun.misc.Unsafe::objectFieldOffset will be removed in a future release
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.example:core:jar:2.1.0-SNAPSHOT
[WARNING] 'dependencyManagement.dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.testcontainers:testcontainers-bom:pom
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] my-service                                                         [pom]
[INFO] core                                                               [jar]
[INFO] algorithm                                                          [jar]
[INFO] api                                                                [jar]
[INFO] consumer                                                           [jar]
[INFO] migrator                                                           [jar]
[INFO]
[INFO] -----------------------< com.example:my-service >-----------------------
[INFO] Building my-service 2.1.0-SNAPSHOT                                [1/6]
[INFO]   from pom.xml
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- surefire:3.5.3:test (default-test) @ my-service ---
[INFO] No tests to run.
[INFO]
[INFO] -------------------------< com.example:core >--------------------------
[INFO] Building core 2.1.0-SNAPSHOT                                      [2/6]
[INFO]   from core/pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- surefire:3.5.3:test (default-test) @ core ---
[INFO] Tests run: 87, Failures: 0, Errors: 0, Skipped: 3, Time elapsed: 4.321 s -- in com.example.core
[INFO]
[INFO] -----------------------< com.example:algorithm >-----------------------
[INFO] Building algorithm 2.1.0-SNAPSHOT                                 [3/6]
[INFO]   from algorithm/pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- surefire:3.5.3:test (default-test) @ algorithm ---
[ERROR] Tests run: 214, Failures: 2, Errors: 0, Skipped: 0, Time elapsed: 12.876 s <<< FAILURE! -- in com.example.algorithm.SlotCalculatorTest
[ERROR] com.example.algorithm.SlotCalculatorTest.shouldComputeAvailableSlots -- Time elapsed: 0.234 s <<< FAILURE!
org.opentest4j.AssertionFailedError: expected: <5> but was: <3>
	at org.junit.jupiter.api.AssertionUtils.fail(AssertionUtils.java:55)
	at org.junit.jupiter.api.AssertEquals.failNotEqual(AssertEquals.java:195)
	at com.example.algorithm.SlotCalculatorTest.shouldComputeAvailableSlots(SlotCalculatorTest.kt:42)
[ERROR] com.example.algorithm.SlotCalculatorTest.shouldHandleOverlappingSlots -- Time elapsed: 0.118 s <<< FAILURE!
org.opentest4j.AssertionFailedError: expected collection to contain: <[Slot(09:00, 09:30)]> but was: <[]>
	at org.junit.jupiter.api.AssertionUtils.fail(AssertionUtils.java:55)
	at com.example.algorithm.SlotCalculatorTest.shouldHandleOverlappingSlots(SlotCalculatorTest.kt:78)
[INFO]
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR]   SlotCalculatorTest.shouldComputeAvailableSlots:42 expected: <5> but was: <3>
[ERROR]   SlotCalculatorTest.shouldHandleOverlappingSlots:78 expected collection to contain: <[Slot(09:00, 09:30)]> but was: <[]>
[INFO]
[ERROR] Tests run: 214, Failures: 2, Errors: 0, Skipped: 0
[INFO]
[INFO] --------------------------< com.example:api >--------------------------
[INFO] Building api 2.1.0-SNAPSHOT                                       [4/6]
[INFO]   from api/pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- surefire:3.5.3:test (default-test) @ api ---
[INFO] Tests run: 156, Failures: 0, Errors: 0, Skipped: 5, Time elapsed: 8.432 s -- in com.example.api
[INFO]
[INFO] -----------------------< com.example:consumer >------------------------
[INFO] Building consumer 2.1.0-SNAPSHOT                                  [5/6]
[INFO]   from consumer/pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- surefire:3.5.3:test (default-test) @ consumer ---
[INFO] Tests run: 42, Failures: 0, Errors: 0, Skipped: 1, Time elapsed: 3.210 s -- in com.example.consumer
[INFO]
[INFO] -----------------------< com.example:migrator >------------------------
[INFO] Building migrator 2.1.0-SNAPSHOT                                  [6/6]
[INFO]   from migrator/pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- surefire:3.5.3:test (default-test) @ migrator ---
[INFO] No tests to run.
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for my-service 2.1.0-SNAPSHOT:
[INFO]
[INFO] my-service ......................................... SUCCESS [  0.532 s]
[INFO] core ............................................... SUCCESS [ 12.543 s]
[INFO] algorithm .......................................... FAILURE [ 14.210 s]
[INFO] api ................................................ SUCCESS [ 14.321 s]
[INFO] consumer ........................................... SUCCESS [  5.432 s]
[INFO] migrator ........................................... SUCCESS [  0.876 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  48.123 s
[INFO] Finished at: 2026-03-02T12:05:22+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.5.3:test (default-test) on project algorithm: There are test failures.
[ERROR]
[ERROR] Please refer to /Users/dev/src/my-service/algorithm/target/surefire-reports for the individual test results.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
Filtered output
BUILD FAILURE

  my-service: 0 run, 0 failures, 0 errors, 0 skipped
  core: 87 run, 0 failures, 0 errors, 3 skipped
  algorithm: 428 run, 4 failures, 0 errors, 0 skipped
  api: 156 run, 0 failures, 0 errors, 5 skipped
  consumer: 42 run, 0 failures, 0 errors, 1 skipped
  migrator: 0 run, 0 failures, 0 errors, 0 skipped

Failed test classes:
[ERROR] Tests run: 214, Failures: 2, Errors: 0, Skipped: 0, Time elapsed: 12.876 s <<< FAILURE! -- in com.example.algorithm.SlotCalculatorTest
[ERROR] com.example.algorithm.SlotCalculatorTest.shouldComputeAvailableSlots -- Time elapsed: 0.234 s <<< FAILURE!
[ERROR] com.example.algorithm.SlotCalculatorTest.shouldHandleOverlappingSlots -- Time elapsed: 0.118 s <<< FAILURE!

[ERROR]   SlotCalculatorTest.shouldComputeAvailableSlots:42 expected: <5> but was: <3>
[ERROR]   SlotCalculatorTest.shouldHandleOverlappingSlots:78 expected collection to contain: <[Slot(09:00, 09:30)]> but was: <[]>
[INFO]

[ERROR] Tests run: 214, Failures: 2, Errors: 0, Skipped: 0
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.5.3:test (default-test) on project algorithm: There are test failures.

[INFO]
[INFO] my-service ......................................... SUCCESS [  0.532 s]
[INFO] core ............................................... SUCCESS [ 12.543 s]
[INFO] algorithm .......................................... FAILURE [ 14.210 s]
[INFO] api ................................................ SUCCESS [ 14.321 s]
[INFO] consumer ........................................... SUCCESS [  5.432 s]
[INFO] migrator ........................................... SUCCESS [  0.876 s]
[INFO] Total time:  48.123 s
successful test run shows per-module test counts ~1755 tokens → ~209 tokens (88% saved)
Raw output
WARNING: A restricted method in java.lang.System has been called
WARNING: java.lang.System::load has been called by org.fusesource.jansi.internal.JansiLoader in an unnamed module (file:/Users/dev/.m2/wrapper/dists/apache-maven-3.9.5-bin/32db9c34/apache-maven-3.9.5/lib/jansi-2.4.0.jar)
WARNING: Use --enable-native-access=ALL-UNNAMED to avoid a warning for callers in this module
WARNING: Restricted methods will be blocked in a future release unless native access is enabled

WARNING: A terminally deprecated method in sun.misc.Unsafe has been called
WARNING: sun.misc.Unsafe::objectFieldOffset has been called by com.google.common.util.concurrent.AbstractFuture$UnsafeAtomicHelper (file:/Users/dev/.m2/wrapper/dists/apache-maven-3.9.5-bin/32db9c34/apache-maven-3.9.5/lib/guava-32.0.1-jre.jar)
WARNING: Please consider reporting this to the maintainers of class com.google.common.util.concurrent.AbstractFuture$UnsafeAtomicHelper
WARNING: sun.misc.Unsafe::objectFieldOffset will be removed in a future release
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.example:core:jar:2.1.0-SNAPSHOT
[WARNING] 'dependencyManagement.dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.testcontainers:testcontainers-bom:pom -> duplicate declaration of version ${testcontainers.version} @ com.example:my-service:2.1.0-SNAPSHOT
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] my-service                                                         [pom]
[INFO] core                                                               [jar]
[INFO] algorithm                                                          [jar]
[INFO] api                                                                [jar]
[INFO] consumer                                                           [jar]
[INFO] migrator                                                           [jar]
[INFO]
[INFO] -----------------------< com.example:my-service >-----------------------
[INFO] Building my-service 2.1.0-SNAPSHOT                                [1/6]
[INFO]   from pom.xml
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- jacoco:0.8.14:prepare-agent (prepare-agent) @ my-service ---
[INFO] argLine set to -javaagent:/Users/dev/.m2/repository/org/jacoco/org.jacoco.agent/0.8.14/org.jacoco.agent-0.8.14-runtime.jar=destfile=/Users/dev/src/my-service/target/jacoco.exec
[INFO]
[INFO] --- antrun:3.1.0:run (install-git-hooks) @ my-service ---
[INFO] Executing tasks
[INFO] Executed tasks
[INFO]
[INFO] --- spotless:3.1.0:apply (default) @ my-service ---
[INFO] Sorting file /var/folders/wr/tmp123/pom4021694899404735419.xml
[INFO] Pom file is already sorted, exiting
[INFO] Spotless.Pom is keeping 1 files clean
[INFO]
[INFO] --- kotlin:2.3.10:compile (compile) @ my-service ---
[INFO] No sources to compile
[INFO]
[INFO] --- surefire:3.5.3:test (default-test) @ my-service ---
[INFO] No tests to run.
[INFO]
[INFO] -------------------------< com.example:core >--------------------------
[INFO] Building core 2.1.0-SNAPSHOT                                      [2/6]
[INFO]   from core/pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- spotless:3.1.0:apply (default) @ core ---
[INFO] Spotless.Kotlin is keeping 181 files clean
[INFO] Sorting file /var/folders/wr/tmp123/pom760564804703012630.xml
[INFO] Pom file is already sorted, exiting
[INFO] Spotless.Pom is keeping 1 files clean
[INFO]
[INFO] --- kotlin:2.3.10:compile (compile) @ core ---
[INFO]
[INFO] --- surefire:3.5.3:test (default-test) @ core ---
[INFO] Tests run: 87, Failures: 0, Errors: 0, Skipped: 3, Time elapsed: 4.321 s -- in com.example.core
[INFO]
[INFO] -----------------------< com.example:algorithm >-----------------------
[INFO] Building algorithm 2.1.0-SNAPSHOT                                 [3/6]
[INFO]   from algorithm/pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- kotlin:2.3.10:compile (compile) @ algorithm ---
[INFO]
[INFO] --- surefire:3.5.3:test (default-test) @ algorithm ---
[INFO] Tests run: 214, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 12.876 s -- in com.example.algorithm
[INFO]
[INFO] --------------------------< com.example:api >--------------------------
[INFO] Building api 2.1.0-SNAPSHOT                                       [4/6]
[INFO]   from api/pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- kotlin:2.3.10:compile (compile) @ api ---
[INFO]
[INFO] --- surefire:3.5.3:test (default-test) @ api ---
[INFO] Tests run: 156, Failures: 0, Errors: 0, Skipped: 5, Time elapsed: 8.432 s -- in com.example.api
[INFO]
[INFO] -----------------------< com.example:consumer >------------------------
[INFO] Building consumer 2.1.0-SNAPSHOT                                  [5/6]
[INFO]   from consumer/pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- kotlin:2.3.10:compile (compile) @ consumer ---
[INFO]
[INFO] --- surefire:3.5.3:test (default-test) @ consumer ---
[INFO] Tests run: 42, Failures: 0, Errors: 0, Skipped: 1, Time elapsed: 3.210 s -- in com.example.consumer
[INFO]
[INFO] -----------------------< com.example:migrator >------------------------
[INFO] Building migrator 2.1.0-SNAPSHOT                                  [6/6]
[INFO]   from migrator/pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- kotlin:2.3.10:compile (compile) @ migrator ---
[INFO]
[INFO] --- surefire:3.5.3:test (default-test) @ migrator ---
[INFO] No tests to run.
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for my-service 2.1.0-SNAPSHOT:
[INFO]
[INFO] my-service ......................................... SUCCESS [  1.200 s]
[INFO] core ............................................... SUCCESS [ 12.543 s]
[INFO] algorithm .......................................... SUCCESS [ 18.765 s]
[INFO] api ................................................ SUCCESS [ 14.321 s]
[INFO] consumer ........................................... SUCCESS [  5.432 s]
[INFO] migrator ........................................... SUCCESS [  0.876 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  53.432 s
[INFO] Finished at: 2026-03-02T12:05:22+01:00
[INFO] ------------------------------------------------------------------------
Filtered output
BUILD SUCCESS

  my-service: 0 run, 0 failures, 0 errors, 0 skipped
  core: 87 run, 0 failures, 0 errors, 3 skipped
  algorithm: 214 run, 0 failures, 0 errors, 0 skipped
  api: 156 run, 0 failures, 0 errors, 5 skipped
  consumer: 42 run, 0 failures, 0 errors, 1 skipped
  migrator: 0 run, 0 failures, 0 errors, 0 skipped

[INFO]
[INFO] my-service ......................................... SUCCESS [  1.200 s]
[INFO] core ............................................... SUCCESS [ 12.543 s]
[INFO] algorithm .......................................... SUCCESS [ 18.765 s]
[INFO] api ................................................ SUCCESS [ 14.321 s]
[INFO] consumer ........................................... SUCCESS [  5.432 s]
[INFO] migrator ........................................... SUCCESS [  0.876 s]
[INFO] Total time:  53.432 s
Warning: Community filters are third-party code. Review the filter definition above before installing it in production environments.
Browse all filters