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

Issue 4740 - JPA integration tests should run on every build #5027

Merged
merged 2 commits into from
Oct 4, 2022

Conversation

Tomas-Kraus
Copy link
Member

@Tomas-Kraus Tomas-Kraus commented Sep 30, 2022

Added profiles to automatically trigger test setup with in memory H2 database.
JPA tests module added to integration tests.

@romain-grecourt This is an attpempt to run JPA integradion tests with default profile triggered as <activeByDefault>true</activeByDefault> when no other DB profile is selected.
This is done in JPA integration tests parent POM.

  1. This h2 profile sets DB properties and stores them in file.
  2. Existence of this file triggers h2 profile in appl module so default test setup is started just from helidon's root 'mvn clean install -Ptests'. It requires no docker.

@Tomas-Kraus Tomas-Kraus added jpa/jta 3.x Issues for 3.x version branch testing integration labels Sep 30, 2022
@Tomas-Kraus Tomas-Kraus self-assigned this Sep 30, 2022
@Tomas-Kraus Tomas-Kraus linked an issue Sep 30, 2022 that may be closed by this pull request
@romain-grecourt
Copy link
Contributor

Looks like none of the updated tests are running:

jakarta.ws.rs.ProcessingException: java.net.ConnectException: Connection refused
	at io.helidon.tests.integration.jpa.appl.test.InsertIT.testInsertTownWithStadium(InsertIT.java:53)
Caused by: java.net.ConnectException: Connection refused
	at io.helidon.tests.integration.jpa.appl.test.InsertIT.testInsertTownWithStadium(InsertIT.java:53)

@Tomas-Kraus
Copy link
Member Author

It was running well on my local environment. Anyway, this must be fixed.

@Tomas-Kraus
Copy link
Member Author

Tomas-Kraus commented Oct 4, 2022

@romain-grecourt This is funny. I tested it on my machine with maven 3.8.6 again and it works!. Looks like maven devs chganged profiles initialization in latest version somehow.
Anyway, this means that we can't rely on this pattern. I changed it to the most stupid simple selection:

        <profile>
            <id>h2</id>
            <activation>
                <property>
                    <name>!db</name>
                </property>
            </activation>
...
        <profile>
            <id>mysql</id>
            <activation>
                <property>
                    <name>db</name>
                    <value>mysql</value>
                </property>
            </activation>
...
        <profile>
            <id>pgsql</id>
            <activation>
                <property>
                    <name>db</name>
                    <value>pgsql</value>
                </property>
            </activation>

Property db allows to switch databases.

I'll modify DbClient tests to follow the same patrtern and will add it to tests run too after this is merged.

Signed-off-by: Tomáš Kraus <tomas.kraus@oracle.com>
Signed-off-by: Tomáš Kraus <tomas.kraus@oracle.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.x Issues for 3.x version branch integration jpa/jta testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JPA integration tests should run on every build
2 participants