Skip to content

SOLR-18645: Remove the BATS suites, replaced by CATS - #5369

Open
janhoy wants to merge 2 commits into
apache:mainfrom
janhoy:SOLR-18645-remove-bats
Open

janhoy wants to merge 2 commits into
apache:mainfrom
janhoy:SOLR-18645-remove-bats

Conversation

@janhoy

@janhoy janhoy commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Now that CATS is in, it's time to remove the cometing BATS suite. Every .bats file has a CATS port under solr/packaging/src/test

  • Delete solr/packaging/test, the BatsTask, integrationTestsPicocli, downloadBats and the bats-* versions
  • Keep integrationTests as an alias for catsTests, for the Jenkins Solr-TestIntegration jobs
  • Move analysis_extras_config into src/test-files for ModulesTest
  • Drop the deprecated BATS workflow, its labeler rule and the BATS docs

These are the open PRs that add or modify BATS tests:

Current, .bats changes need porting to CATS

Likely candidates for closing now that BATS is gone

Every .bats file has a CATS port under solr/packaging/src/test, and the
rolling upgrade test lives on as solr/docker's RollingUpgradeTest.

- Delete solr/packaging/test, the BatsTask, integrationTestsPicocli,
  downloadBats and the bats-* versions
- Keep integrationTests as an alias for catsTests, for the Jenkins
  Solr-TestIntegration jobs
- Move analysis_extras_config into src/test-files for ModulesTest
- Drop the deprecated BATS workflow, its labeler rule and the BATS docs
@github-actions

Copy link
Copy Markdown

Automated PR readiness judgements (LLM-generated; may be wrong; not updated on later pushes).

  • ✅ Jira issue in title: already present
  • ⚠️ Changelog — differs from the entry (suggest type: removed; PR has type: other): The PR removes the BATS test suites, the `BatsTask` class, and the `integrationTestsPicocli` and `downloadBats` Gradle tasks, which are user-visible build/​test components being removed in favor of CATS.​
  • ✅ Reference Guide update: not needed
  • ✅ Upgrade notes: not needed
  • ⚠️ Tests — probably not needed: The PR removes test suites and build logic; it does not change production logic in a way that requires new tests, and the removed tests are replaced by existing CATS suites.​

Note in cats.adoc and the packaging README that the BATS suites were
replaced and removed, and keep the "no new .bats files" rule in
AGENTS.md for agents trained on the old layout.
@epugh

epugh commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

I think, if this is supposed to be a worklog, it might be better in JIRA if you don't expect this work to actually happen IN this PR. I supposed we can edit and draw lines through each item as we make progress and do the accounting work in the description? For example, I want to update the status on the SOLR-16957....

@janhoy

janhoy commented Nov 20, 2026

Copy link
Copy Markdown
Contributor Author

I think, if this is supposed to be a worklog, it might be better in JIRA if you don't expect this work to actually happen IN this PR

Not a worklog, just for reference. I haver posted a review comment on each of the above listed open PRs, so each PR owner will have some context as to how to proceed. Nothing more to do in the context of this PR.

I'm investigating the CI check failures...

@janhoy
janhoy requested review from dsmiley and epugh and a balanced review from Copilot November 23, 2026 15:48
@janhoy janhoy added this to the 10.x milestone Nov 23, 2026

This comment was marked as outdated.

Comment thread dev-docs/cats.adoc

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.

I guess with AI especially, we are going to see our dev-docs start expanding quickly... (I only make this comment because the "scalar openapi explorer" pr also adds this).. We may in the future need some stort of plan around this!

@epugh epugh 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.

I think the one big question for me is the package name of .shell. versus .cats.? This is looking great...

Comment thread solr/bin/solr
fi

# This helps with debugging when running bats tests however the whole script is not compliant yet
# This helps with debugging when running shell tests however the whole script is not compliant yet

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.

interesting that "the whole script is not compliant yet", that seems like a great place to spend some tokens to get to done..

* <p>Focused on verifying how DocumentCategorizerUpdateProcessorFactory is set up to run.
*
* <p>See test_opennlp.bats for a complete system test of DocumentCategorizerUpdateProcessorFactory.
* <p>See {@code org.apache.solr.shell.OpenNlpTest} in solr/packaging for a complete system test of

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.

I wonder if the package should have been org.apache.solr.cats.OpenNlpTest? I was a bit surprised and then figured it out... I know it's a "shell", but really, in my head it's a "CATS" test... not a "shell" test....

env("SOLR_INCLUDE", solrIncludeFile.toString());
run("solr start");
run("solr create -c COLL_NAME -d \"" + analysisExtrasConf() + "\"")
copyResource(

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.

I wonder if we could have a method called copyResourceForCATS and just pass in one variable? If we see the same path duplicated, that seems odd... copyResourceForCATS("analysis_extras_config/conf/solrconfig.xml");

// each variant's SOLR_HOMEs, port-block counter and failure snapshots apart; picocli selects the
// CLI implementation, or null to take whatever bin/solr defaults to.
// Shared configuration for the CATS suites. outputName keeps each variant's SOLR_HOMEs, port-block
// counter and failure snapshots apart; picocli selects the CLI implementation, or null to take

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.

small tweak, but "picocli selects the CLI"? Maybe "Defaults to picocli as the CLI implementation"?

Comment thread AGENTS.md
- For BATS shell integration tests in `solr/packaging/test/`:
- Always use `run <command>` followed by `assert_output --partial "..."` or `refute_output --partial "..."` instead of capturing output into local variables and using `[[ ]]` comparisons
- Avoid patterns like `local var=$(cmd | grep ...); [[ "$var" == *"..."* ]]` — use `run cmd` + `assert_output`/`refute_output` instead
- Shell tests for `bin/solr`/`bin\solr.cmd` are CATS suites (`SolrCatsTestCase`); BATS was removed, don't add `.bats` files.

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.

Do we need the BATS were removed text? I guess for now, and maybe in a year we remove it...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants