Skip to content

JUnit runner page improvements - #8040

Draft
labkey-tchad wants to merge 8 commits into
developfrom
fb_junitRunnerImprovements
Draft

JUnit runner page improvements#8040
labkey-tchad wants to merge 8 commits into
developfrom
fb_junitRunnerImprovements

Conversation

@labkey-tchad

@labkey-tchad labkey-tchad commented Sep 10, 2026

Copy link
Copy Markdown
Member

Rationale

For the most part, one is able to run individual server-side JUnit tests from junit-begin.view. This is not the case for parameterized test classes.
image

A minor change to how the page iterates through tests makes it function correctly for these tests.
image

Separately, the actions that actually run tests accepted GET requests, so a test run (some of which are expensive or have side effects) could be triggered by simply visiting a link.

Related Pull Requests

  • N/A

Changes

  • Fix the JUnit runner page to list every test method of a parameterized test class, instead of one opaque, unclickable entry per parameter set.
  • Require POST for the actions that execute tests (RunAction, Run2Action, Run3Action); GoAction already required it.

RunAction, Run2Action, and Run3Action accepted GET despite running tests, which can be expensive or side-effecting; add @MethodsAllowed(POST) and switch runner.jsp's buttons/links to POST accordingly. GoAction already required POST via MutatingApiAction.
@labkey-tchad labkey-tchad changed the title Fix JUnit runner page's handling of parameterized tests JUnit runner page improvements Sep 10, 2026

@labkey-adam labkey-adam left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

With this, we can probably adjust the mutating SQL detection, which currently ignores junit actions.

@labkey-tchad

Copy link
Copy Markdown
Member Author

With this, we can probably adjust the mutating SQL detection, which currently ignores junit actions.

This was a bit trickier that expected. The mock ViewContexts used by some tests were tripping up the mutating SQL check. I had to tweak ViewContext.getMockViewContext to inherit the current view context.

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