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

Simplify container testing #13134

Merged
merged 4 commits into from
Nov 9, 2020
Merged

Conversation

gsmet
Copy link
Member

@gsmet gsmet commented Nov 5, 2020

This is a follow-up from a discussion we had months ago. Names were suggested by @stuartwdouglas and I think they make sense.

It's a bit longer to type but at least you don't have to check in the pom if it should be test-pgsql or test-postgresql/test-mariadb or test-mysql and everything is consistent.

Use:
-Dtest-containers to enable container testing rather than all variants
of -Dtest-postgresql, -Dtest-mariadb and so on
-Dstart-containers to start the containers rather than -Ddocker

I also make the native builds consistently use containers.

Let's see what CI has to say.

/cc @zakkak

gsmet added 3 commits November 5, 2020 12:05
Use:
-Dtest-containers to enable container testing rather than all variants
of -Dtest-postgresql, -Dtest-mariadb and so on
-Dstart-containers to start the containers rather than -Ddocker
This is a leftover from when we used to start services rather than
relying on Docker.

Let's be consistent with the JVM builds and simplify all of this.
Copy link
Member

@stuartwdouglas stuartwdouglas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very much +1 on this, the current state of affairs is a bit of a mess.

@gsmet gsmet force-pushed the simplify-container-testing branch from 8f79c63 to ada0170 Compare November 5, 2020 14:19
@gsmet
Copy link
Member Author

gsmet commented Nov 5, 2020

@loicmathieu I had to keep the logging-gelf extension special cased as it doesn't automatically start the containers.

That means that right now, this extension is not tested at all on CI, which is unfortunate. Any chance we could improve this situation?

@loicmathieu
Copy link
Contributor

@gsmet there is already an issue for that, #6286 and it's assigned ... to you ;)

Someone definilty needs to work on making the logging-gelf IT works in CI.
If wa can use testcontainers in CI (it was not the case when the logging-gelf extension was created due to issue on windows build), it should be doable

@zakkak
Copy link
Contributor

zakkak commented Nov 5, 2020

Thanks for the notification @gsmet !
+1 on this

Could you please also explain why -Dstart-containers does not imply -Dtest-containers?
I can see how one could use -Dtest-containers and manage the containers manually, but it's not clear to me why one would want to use -Dstart-containers without -Dtest-containers.

@gsmet
Copy link
Member Author

gsmet commented Nov 5, 2020

@zakkak unfortunately, it's not easy to do that with standard Maven profiles. At least that's my understanding of it.

@gsmet
Copy link
Member Author

gsmet commented Nov 5, 2020

Hmm, I wonder if just setting the property test-containers in the start-containers would be enough to trigger things. I would have to check that.

I was thinking about the lack of flexibility of <activation> but using properties might work.

I'll go try that and report back.

@gsmet
Copy link
Member Author

gsmet commented Nov 5, 2020

AFAICS, it's not working.

@gsmet gsmet marked this pull request as ready for review November 5, 2020 17:51
@zakkak
Copy link
Contributor

zakkak commented Nov 5, 2020

Hmm, I wonder if just setting the property test-containers in the start-containers would be enough to trigger things. I would have to check that.

I think adding something like:

<profile>
            <id>start-containers</id>
            <activation>
                <property>
                    <name>start-containers</name>
                </property>
            </activation>
            <properties>
                <start-containers>true</start-containers>
                <test-containers>true</test-containers>
            </properties>
</profile>

in integration-tests/pom.xml and extensions/pom.xml or directly in the top level pom.xml would achieve what we want.

My maven-fu is not that good though so I can't be sure without testing.

@gsmet
Copy link
Member Author

gsmet commented Nov 5, 2020

I tried to do something similar but in a specific IT and it didn't work. Not sure if doing it in the parent would change something.

@zakkak
Copy link
Contributor

zakkak commented Nov 5, 2020

I tried to do something similar but in a specific IT and it didn't work. Not sure if doing it in the parent would change something.

The way I understand it it needs to be in a parent pom so that it gets evaluated earlier and thus set the test-containers and pass it to lower pom files. If we do it inside the same pom file the evaluation is not recursive so both test-containers and start-containers will get the provided values and not the ones possibly defined by a profile.

I faced that same issue in #10932 (comment)

@gsmet
Copy link
Member Author

gsmet commented Nov 5, 2020

I tried but it doesn't work.

@zakkak
Copy link
Contributor

zakkak commented Nov 5, 2020

I tried but it doesn't work.

:( Thanks for trying it out @gsmet

@gastaldi gastaldi added this to the 1.10 - master milestone Nov 8, 2020
Copy link
Contributor

@gastaldi gastaldi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fantastic! Looks like I can check the first checkbox in #11622

@gastaldi gastaldi mentioned this pull request Nov 8, 2020
2 tasks
@gsmet gsmet merged commit 15d2c6d into quarkusio:master Nov 9, 2020
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.

5 participants