Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Access to DevService properties in QuarkusIntegrationTest #18854

Closed
bdevreugd-vialis opened this issue Jul 20, 2021 · 8 comments · Fixed by #18862
Closed

Access to DevService properties in QuarkusIntegrationTest #18854

bdevreugd-vialis opened this issue Jul 20, 2021 · 8 comments · Fixed by #18862
Labels
area/testing kind/enhancement New feature or request
Milestone

Comments

@bdevreugd-vialis
Copy link
Contributor

I have a quarkus integration test, which uses the devservices of Mongodb and Kafka. I can see the properties being passed to my docker image, so that gets started with the correct details.

However, I would also like to access those services from my test (to add 'input' messages to kafka and to verify data written to the DB), but it is currently impossible to determine the correct connection details.

Could the properties from the following line, somehow, also made available in the context of the integration test. For example using ConfigProvider.getConfig().getValue or simply using @ConfigProperty, or anything else.

@quarkus-bot
Copy link

quarkus-bot bot commented Jul 20, 2021

/cc @geoand

@geoand geoand added the kind/enhancement New feature or request label Jul 20, 2021
@geoand
Copy link
Contributor

geoand commented Jul 20, 2021

This is very interesting.

We can certainly inject some kind of dev-services configuration lookup service into the test that users could query.

@gsmet @stuartwdouglas WDYT?

@geoand
Copy link
Contributor

geoand commented Jul 20, 2021

#18862 is what I have in mind

geoand added a commit that referenced this issue Jul 21, 2021
Introduce the ability to inject context into @QuarkusIntegrationTest tests
@quarkus-bot quarkus-bot bot added this to the 2.2 - main milestone Jul 21, 2021
@languitar
Copy link
Contributor

Is there a quick workaround to access these properties in the current release version?

@geoand
Copy link
Contributor

geoand commented Jul 27, 2021

Unfortunately, no

@stuartwdouglas
Copy link
Member

Maybe we should provide a way to inject these clients into QuarkusIntegrationTest.

@geoand
Copy link
Contributor

geoand commented Jul 28, 2021

So injecting a data source for example?
That sounds neat, but I am wondering what we would inject in the case of Keycloak or Apicurio

@languitar
Copy link
Contributor

Having easy access to the database and messaging systems etc. would be really good. Providing fixtures in terms of data inside integration tests is currently not exactly easy, especially with DevServices. Giving clients back to the test would really help. Being able to programmatically use entities to prefill the database would also be very nice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/testing kind/enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants