Skip to content

test: avoid duplicating functionality from base test classes#652

Merged
andrew-coleman merged 5 commits intomainfrom
vbarua/improve-base-test-class-reuse
Jan 2, 2026
Merged

test: avoid duplicating functionality from base test classes#652
andrew-coleman merged 5 commits intomainfrom
vbarua/improve-base-test-class-reuse

Conversation

@vbarua
Copy link
Copy Markdown
Member

@vbarua vbarua commented Dec 23, 2025

  • Reuse base R and N type creators
  • Standardize on sb from SubstraitBuilder util
  • Remove defaultExtensionCollection from tests
  • Introduce reusable substraitToCalcite in PlanTestBase

@vbarua
Copy link
Copy Markdown
Member Author

vbarua commented Dec 23, 2025

In the process of doing some other work, I found myself touching a lot of tests. Instead of complicating that PR, I've opted to improve the reuse of the base test classes.

This PR doesn't modify any tests. It primarily removes redundant fields from test classes in favour of reusing fields in the base test classes.

protected ProtoRelConverter protoRelConverter =
new ProtoRelConverter(functionCollector, defaultExtensionCollection);

protected SubstraitBuilder sb;
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I opted to use sb for SubstraitBuilder, which felt slightly more descriptive than b. A short-name is useful because when it's used, it's called frequently to build a plan component. A descriptive name like substraitBuilder ends up being noisy.

@andrew-coleman andrew-coleman merged commit aebd1bc into main Jan 2, 2026
13 checks passed
@andrew-coleman andrew-coleman deleted the vbarua/improve-base-test-class-reuse branch January 2, 2026 09:01
mbwhite pushed a commit to mbwhite/substrait-java that referenced this pull request Jan 9, 2026
…it-io#652)

* test: define and reuse substraitToCalcite in PlanTestBase

* test: use SubstraitBuilders from base testing classes

* test: make TestBase more reusable

* test: remove defaultExtensionCollection from TestBase

Prefer the extensions field. For access to the default extensions, use
DefaultExtensionCatalog.DEFAULT_COLLECTION directly.

* test: reuse base N and R TypeCreator when possible
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