Skip to content

Conversation

@epugh
Copy link
Contributor

@epugh epugh commented Dec 14, 2025

This is a bit of an experiment. I wanted to see if I could reduce the amount of effort to get our tests updated. Over time we've been accumulating tech debt in our tests, and addressing that manually appears pretty difficult!

In this PR I've checked in my prompt prompt_to_use.md that I used in VS Code. My thought is that the most important aspect of this PR is crafting a really great prompt. Instead of reviewing and commenting on the changes made per individual test file, what I really want is review of the overall change, and feed that review BACK into my prompt. Then I will re-run the improved prompt and that hopefully will output the final set of changes. Maybe in this PR, maybe in another fresh PR with improved prompt.

As an example of feeding back input, after running everything I noticed in one test it hardcoded a 127.0.0.1 url, and so I added Please do not create hard coded urls like 127.0.0.1 in the tests. to prevent that in the future.

There are three files that start with MIGRATION_*.md and they are somewhat messy AI generated status files. I wanted it to maintain tests_not_migrated.md as the but it kind of forgot that file....

…rTestCaseJ4

I used the prompt that I previously checked in, and pretty much just let it go to town.  I had to help it a bit on the BasicHttpSolrClientTest.   tests_not_migrated.md represents the ones that didn't go on the first pass.
…ious batch

They all look pretty straightforward however.
@epugh
Copy link
Contributor Author

epugh commented Dec 15, 2025

Some lessons learned:

  • Be more prescriptive on the process. After migrating the first ten or so, Chat wanted to migrate three or five classes at a time, instead of grinding them out one by one.
  • It's hard not to just engage with Chat to steer him to fix things. Which then made me feel more committed to getting this specific PR done... Versus my original plan of coming up with one "perfect" prompt and then just re run it multiple times till everything worked.
  • Chat really understands how multiple Java components talk to each and the flow in a way that takes me hours of stepping through code....

@dsmiley
Copy link
Contributor

dsmiley commented Dec 19, 2025

Big changes like this should be a multi-step journey. Anticipate that and ask the AI where to start and just stay focused there. For example look at SolrJettyTestBase and focus on removing that. Perhaps even that might be too much for one PR, so narrow further on RestTestBae, for example.

@dsmiley dsmiley marked this pull request as draft December 19, 2025 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants