I've been trying to make progress on testing whether extensions interfere with the basic functionality of OpenRefine. As a part of that, I wanted to share how I've been testing.
To ensure a test failure, I copied the sample extension template and created an extension that removes a chunk of the dropdown menu in the project grid view (the whole repository is here but the only significant line is in this client-side script).
Once I have that extension unzipped into a separate directory, I'll start OpenRefine with that extension installed and enabled. I can then run some of the affected Cypress tests from the root of my local OpenRefine development environment.
Ultimately, these are the two commands I'll run to verify that an extension can cause a Cypress test to fail:
# start OpenRefine with the malicious extension installed
# you will need to change this value to a real path
REFINE_DATA_DIR=/path/to/failing-test-extensions ./refine
# run the Cypress tests for facets
yarn --cwd ./main/tests/cypress run cypress run --spec "cypress/e2e/project/grid/column/facet/facets.cy.js" --browser chrome --headless --quiet --reporter list --env DISABLE_PROJECT_CLEANUP=1,OPENREFINE_URL=http://127.0.0.1:3333
This gives me a bit more confidence that we'll be able to proactively check whether an extension interferes with OpenRefine functionality (though this doesn't let extension developers off the hook for testing that their own functionality isn't compromised by OpenRefine). I've run this with a few extensions and have gotten a few flaky test failures. I'll share a more complete analysis once it's ready.