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

Reusable java test utilities for extensions #6556

Open
wetneb opened this issue Apr 23, 2024 · 2 comments
Open

Reusable java test utilities for extensions #6556

wetneb opened this issue Apr 23, 2024 · 2 comments
Assignees
Labels
extension Making it easier to extend OpenRefine's UI and backend tests Improving test coverage and speed

Comments

@wetneb
Copy link
Sponsor Member

wetneb commented Apr 23, 2024

As an extension developer, I want to be able to easily write unit tests for the java classes I write.
The RefineTest and TestUtils classes that we use in the main module are test classes that are not designed for public consumption.

We could have a separate Maven module which would offer basic utilities (covering things such as workspace initialization, teardown and project creation) so that extensions can easily depend on such utilities for their tests.

We could also investigate how to do the same for Cypress tests, but I would keep that for a separate issue.

I intend to tackle this as part of the Maven modularization effort.

@wetneb wetneb added tests Improving test coverage and speed extension Making it easier to extend OpenRefine's UI and backend labels Apr 23, 2024
@wetneb wetneb self-assigned this Apr 23, 2024
@steve-kasica
Copy link

Such a module would be really useful for extension developer. About a month ago I was actually looking around MVN Repository for such a module.

@wetneb
Copy link
Sponsor Member Author

wetneb commented May 24, 2024

We actually publish our tests on Maven Central, so it's currently possible to add this to an extension's pom.xml file:

    <dependency>
      <groupId>org.openrefine</groupId>
      <artifactId>main</artifactId>
      <version>${openrefine.version}</version>
      <type>test-jar</type>
      <scope>test</scope>
    </dependency>

And then one can use RefineTest and TestUtils directly.

It's not ideal because the artifact actually contains all of our tests as well, so it's rather big and stability is even less guaranteed than code in the main code base. So I'm hopeful that the Maven modularization will help trim that down to only contain stuff that we can reasonably keep quite stable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extension Making it easier to extend OpenRefine's UI and backend tests Improving test coverage and speed
Projects
None yet
Development

No branches or pull requests

2 participants