micronaut-projects / micronaut-control-panel

Apache License 2.0
4 stars 1 forks source link

Implement test resources control panel #15

Open melix opened 1 year ago

melix commented 1 year ago

Feature description

It would be good to have a panel which allows listing the properties that test resources can resolve, and also their value. This can typically be useful if a user wants to connect to a test resources database from the IDE: they would need to know about the URL/username/password.

alvarosanchez commented 4 months ago

This was implemented in Test Resources itself: https://github.com/micronaut-projects/micronaut-test-resources/pull/432

What I wonder is: would it make sense to integrate both? @melix is there a way to know the TR control panel URL? to at least provide a link?

melix commented 4 months ago

is there a way to know the TR control panel URL? to at least provide a link?

A link to the control panel is displayed when the test resources service starts. Are you thinking of something different?

alvarosanchez commented 4 months ago

Yes, what I was thinking is to provide a link in the application control panel to the TR control panel. Is there a way for this module to know the panel URL? Perhaps I could query a property and TR can resolve it?

melix commented 4 months ago

Ah I see. I'm not sure there's an easy way to do this. The test resources control panel basically displays the list of resolvers. So if you add a control panel resolver, then it will be indeed added as a card that users can click on to get the URL. However this would mean that the control panel asks for a property to the test resources service. But what if the control panel module is not loaded in test resources? Another possible problem is that the URL will only be known once the app is started (because of the random port strategy for example).