colvinco commented on PR #3023: URL: https://github.com/apache/solr/pull/3023#issuecomment-2592917253
I'm happy to write them in Java. @epugh on the dev-thread said > Is there some way to programmatically look up each v2 API and then issue a request? Off the top of my head, I guess there's three approaches to that sort of thing (there could well be others or more refined takes on these). 1. Use the `/_introspect` endpoints to drive it 2. Do some code analysis (e.g. use reflection) to drive it 3. Generate tests (or stubs) from the OpenAPI spec - I see OAG is already here https://github.com/apache/solr/blob/6d838cb3de9774e1a17208a78210f8968ce4e959/solr/solrj/build.gradle#L131 I think the problem with 1 and 2 is that something dynamic like that is probably quite hard to unpick if something does go wrong, e.g. if it misses a set of endpoints will it be obvious? Plus if any endpoints have precondition (collection existing) then it would still need extra context to drive it. The problem with 3 is how you manage the generated source and whether you're able to generate something that's ready to use, or if it's just generating stubs that require manual intervention to turn into usable tests. If it's the former then it's great, because changes to the spec can automatically generate updated tests. With the latter it can be a good starting point for writing tests normally. ATM that is what I think I will do - use the spec to generate an initial set of test stubs so that I cover all the existing endpoints, but I'm not planning on putting the generator into the PR (unless it is in state of producing ready to use output anyway). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For additional commands, e-mail: issues-h...@solr.apache.org