From d4bf74f45f56914abd8f59abd3ed26bddf97b766 Mon Sep 17 00:00:00 2001 From: Marvin Froeder Date: Wed, 4 Dec 2024 19:08:35 -0300 Subject: [PATCH] Grouping test logs on github actions Signed-off-by: Marvin Froeder --- pom.xml | 18 ++++++++-------- sqrl-calcite/pom.xml | 6 ++++++ .../GroupingTestExecutionListener.java | 21 +++++++++++++++++++ sqrl-planner/pom.xml | 17 +++++++++++++++ sqrl-testing/sqrl-integration-tests/pom.xml | 17 +++++++++++++++ sqrl-tools/sqrl-cli/pom.xml | 12 +++++++++++ sqrl-tools/sqrl-discovery/pom.xml | 17 +++++++++++++++ sqrl-tools/sqrl-packager/pom.xml | 17 +++++++++++++++ 8 files changed, 116 insertions(+), 9 deletions(-) create mode 100644 sqrl-calcite/src/test/java/com/datasqrl/GroupingTestExecutionListener.java diff --git a/pom.xml b/pom.xml index 51a033e33..bf5c0ae2f 100755 --- a/pom.xml +++ b/pom.xml @@ -97,6 +97,11 @@ + + org.junit.platform + junit-platform-launcher + test + org.junit.jupiter junit-jupiter-engine @@ -761,16 +766,11 @@ test - org.junit.jupiter - junit-jupiter-engine - ${junit.jupiter.version} - test - - - org.junit.jupiter - junit-jupiter-params + org.junit + junit-bom ${junit.jupiter.version} - test + import + pom diff --git a/sqrl-calcite/pom.xml b/sqrl-calcite/pom.xml index 2dd70f687..0bea04a6e 100644 --- a/sqrl-calcite/pom.xml +++ b/sqrl-calcite/pom.xml @@ -121,6 +121,12 @@ **/*IT*.java + + + junit.jupiter.execution.listeners.default + com.datasqrl.GroupingTestExecutionListener + + diff --git a/sqrl-calcite/src/test/java/com/datasqrl/GroupingTestExecutionListener.java b/sqrl-calcite/src/test/java/com/datasqrl/GroupingTestExecutionListener.java new file mode 100644 index 000000000..4f39e7f3a --- /dev/null +++ b/sqrl-calcite/src/test/java/com/datasqrl/GroupingTestExecutionListener.java @@ -0,0 +1,21 @@ +package com.datasqrl; + +import org.junit.platform.launcher.TestIdentifier; +import org.junit.platform.launcher.listeners.SummaryGeneratingListener; + +public class GroupingTestExecutionListener extends SummaryGeneratingListener { + + @Override + public void executionStarted(TestIdentifier testIdentifier) { + if (testIdentifier.isTest()) { + System.out.println("::group::" + testIdentifier.getDisplayName()); + } + } + + @Override + public void executionFinished(TestIdentifier testIdentifier, org.junit.platform.engine.TestExecutionResult testExecutionResult) { + if (testIdentifier.isTest()) { + System.out.println("::endgroup::"); + } + } +} diff --git a/sqrl-planner/pom.xml b/sqrl-planner/pom.xml index 05c80be85..5b237d6ac 100644 --- a/sqrl-planner/pom.xml +++ b/sqrl-planner/pom.xml @@ -8,6 +8,23 @@ sqrl-planner + + + + org.apache.maven.plugins + maven-surefire-plugin + + + + junit.jupiter.execution.listeners.default + com.datasqrl.GroupingTestExecutionListener + + + + + + + 11 11 diff --git a/sqrl-testing/sqrl-integration-tests/pom.xml b/sqrl-testing/sqrl-integration-tests/pom.xml index 5ff52664b..2d65d6ec6 100644 --- a/sqrl-testing/sqrl-integration-tests/pom.xml +++ b/sqrl-testing/sqrl-integration-tests/pom.xml @@ -8,6 +8,23 @@ sqrl-integration-tests + + + + org.apache.maven.plugins + maven-surefire-plugin + + + + junit.jupiter.execution.listeners.default + com.datasqrl.GroupingTestExecutionListener + + + + + + + 11 11 diff --git a/sqrl-tools/sqrl-cli/pom.xml b/sqrl-tools/sqrl-cli/pom.xml index d815e1e30..f255e6346 100644 --- a/sqrl-tools/sqrl-cli/pom.xml +++ b/sqrl-tools/sqrl-cli/pom.xml @@ -84,6 +84,18 @@ + + org.apache.maven.plugins + maven-surefire-plugin + + + + junit.jupiter.execution.listeners.default + com.datasqrl.GroupingTestExecutionListener + + + + org.apache.maven.plugins maven-shade-plugin diff --git a/sqrl-tools/sqrl-discovery/pom.xml b/sqrl-tools/sqrl-discovery/pom.xml index e424ede09..a22b15b5e 100644 --- a/sqrl-tools/sqrl-discovery/pom.xml +++ b/sqrl-tools/sqrl-discovery/pom.xml @@ -8,6 +8,23 @@ sqrl-discovery + + + + org.apache.maven.plugins + maven-surefire-plugin + + + + junit.jupiter.execution.listeners.default + com.datasqrl.GroupingTestExecutionListener + + + + + + + 11 11 diff --git a/sqrl-tools/sqrl-packager/pom.xml b/sqrl-tools/sqrl-packager/pom.xml index 0f960c83f..11662622e 100644 --- a/sqrl-tools/sqrl-packager/pom.xml +++ b/sqrl-tools/sqrl-packager/pom.xml @@ -8,6 +8,23 @@ sqrl-packager + + + + org.apache.maven.plugins + maven-surefire-plugin + + + + junit.jupiter.execution.listeners.default + com.datasqrl.GroupingTestExecutionListener + + + + + + + 1.18.24 4.3.5