Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: move common logic into TestBase #193

Merged
merged 1 commit into from
Nov 2, 2023
Merged

Conversation

vbarua
Copy link
Member

@vbarua vbarua commented Nov 2, 2023

No description provided.

@vbarua
Copy link
Member Author

vbarua commented Nov 2, 2023

Reducing test code duplication by moving more common logic into the TestBase abstract class.

@@ -21,8 +21,6 @@
import org.junit.jupiter.api.Test;

public class AggregateRoundtripTest extends TestBase {
static final org.slf4j.Logger logger =
org.slf4j.LoggerFactory.getLogger(AggregateRoundtripTest.class);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These loggers aren't used or needed so removing them to reduce noise.

@@ -25,15 +25,7 @@

public class LocalFilesRoundtripTest extends TestBase {

SimpleExtension.ExtensionCollection extensions = defaultExtensionCollection;

public LocalFilesRoundtripTest() throws IOException {}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This constructor is not needed.

Copy link
Member

@EpsilonPrime EpsilonPrime left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice cleanup!

@vbarua
Copy link
Member Author

vbarua commented Nov 2, 2023

CI is failing due to

/home/runner/work/substrait-java/substrait-java/core/src/test/java/io/substrait/type/proto/LocalFilesRoundtripTest.java:61: error: switch expressions are not supported in -source 8
    return switch (pathTypeCase) {
           ^
  (use -source 14 or higher to enable switch expressions)
/home/runner/work/substrait-java/substrait-java/core/src/test/java/io/substrait/type/proto/LocalFilesRoundtripTest.java:62: error: switch rules are not supported in -source 8
      case URI_PATH -> builder.pathType(FileOrFiles.PathType.URI_PATH).path("path");

which are in code this PR did not touch. Locally, tests run and build fine.

I've seen a number of builds fail with issues like this. In theory Jabel should be converting this code, but it doesn't seem to fire sometimes.

@vbarua
Copy link
Member Author

vbarua commented Nov 2, 2023

Filed #195 for the build issue.

@vbarua vbarua merged commit 618d7ff into main Nov 2, 2023
6 of 7 checks passed
@vbarua vbarua deleted the vbarua/test-base-refactor branch November 2, 2023 22:57
ajegou pushed a commit to ajegou/substrait-java that referenced this pull request Mar 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants