Skip to content

Conversation

@SoryRawyer
Copy link
Member

@SoryRawyer SoryRawyer commented Aug 27, 2025

This pull request adds a section at the end of "writing extensions" to add some references to unit and integration tests. It's a small section of notes I kept while exploring this part of the codebase.

@netlify
Copy link

netlify bot commented Aug 27, 2025

Deploy Preview for openrefine-website ready!

Name Link
🔨 Latest commit a925b30
🔍 Latest deploy log https://app.netlify.com/projects/openrefine-website/deploys/696aae9ff0f8670007f6ae06
😎 Deploy Preview https://deploy-preview-480--openrefine-website.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@SoryRawyer SoryRawyer marked this pull request as ready for review September 15, 2025 21:45
Copy link
Member

@tfmorris tfmorris left a comment

Choose a reason for hiding this comment

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

A couple of small suggestions, but approved with those made.

The improved docs are great, but I suspect we probably also need to add more scaffolding for testing to the sample extension to really nudge developers in the right direction.


## Testing

Like OpenRefine core, extensions can test backend code through Java unit tests and frontend/integration tests can be written using Cypress. In addition to the resources below, extension authors are encouraged to review the documentation related to [functional tests](/docs/technical-reference/functional-tests) in OpenRefine core.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Like OpenRefine core, extensions can test backend code through Java unit tests and frontend/integration tests can be written using Cypress. In addition to the resources below, extension authors are encouraged to review the documentation related to [functional tests](/docs/technical-reference/functional-tests) in OpenRefine core.
We recommend extension authors write backend Java unit tests, like OpenRefine core does, and, if applicable, frontend/integration tests can be written using Cypress. In addition to the resources below, extension authors are encouraged to review the documentation related to [functional tests](/docs/technical-reference/functional-tests) in OpenRefine core.

Please note that Java unit tests can be run from the command line with no additional setup, but integration tests need to have a running instance of OpenRefine to test against.

### Java unit testing
The sample extension template includes a reference unit test suite which leverages [the `RefineTest` base class](https://github.com/OpenRefine/OpenRefine/blob/master/modules/core/src/test/java/com/google/refine/RefineTest.java) provided by OpenRefine core. Tests are not required to extend `RefineTest`, but that class provides many utilities that may help you test your extension.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
The sample extension template includes a reference unit test suite which leverages [the `RefineTest` base class](https://github.com/OpenRefine/OpenRefine/blob/master/modules/core/src/test/java/com/google/refine/RefineTest.java) provided by OpenRefine core. Tests are not required to extend `RefineTest`, but that class provides many utilities that may help you test your extension.
The sample extension template includes a reference [unit test suite](https://github.com/OpenRefine/sample-extension/blob/master/src/test/java/com/google/refine/sampleExtension/SampleUtilTest.java) which leverages [the `RefineTest` base class](https://github.com/OpenRefine/OpenRefine/blob/master/modules/core/src/test/java/com/google/refine/RefineTest.java) provided by OpenRefine core. Tests are not required to extend `RefineTest`, but that class provides many utilities that may help you test your extension.

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.

3 participants