Expose PostgreSQL on default port in PostgreSqlQueryRunner.main#14037
Expose PostgreSQL on default port in PostgreSqlQueryRunner.main#14037hashhar merged 3 commits intotrinodb:masterfrom
Conversation
|
Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to cla@trino.io. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla |
hashhar
left a comment
There was a problem hiding this comment.
Useful change for local development. Thanks.
Some nits about comments.
testing/trino-testing-containers/src/main/java/io/trino/testing/containers/TestContainers.java
Outdated
Show resolved
Hide resolved
testing/trino-testing-containers/src/main/java/io/trino/testing/containers/TestContainers.java
Outdated
Show resolved
Hide resolved
testing/trino-testing-containers/src/main/java/io/trino/testing/containers/TestContainers.java
Outdated
Show resolved
Hide resolved
testing/trino-testing-containers/src/main/java/io/trino/testing/containers/TestContainers.java
Outdated
Show resolved
Hide resolved
|
cc: @ebyhr you might find this useful when running query runners locally. @vlad-lyutenko Please update the PR description to also mention if you plan to make similar change to other query runners as well? I assume this PR is to gather feedback? |
testing/trino-testing-containers/src/main/java/io/trino/testing/containers/TestContainers.java
Outdated
Show resolved
Hide resolved
|
@vlad-lyutenko i am not super fond of the change. It would make more sense to limit the change to Or not do it at all. For local development purpose I leverage the cheat sheet https://gist.github.com/findepi/04c96f0f60dcc95329f569bb0c44a0cd : |
findepi
left a comment
There was a problem hiding this comment.
per
it will make it impossible to run multiple instances of integration tests concurrently
|
Limiting to main makes sense. Good point about concurrent tests (which can also happen if you run tests for entire module from CLI since by default we run tests in parallel). |
ebyhr
left a comment
There was a problem hiding this comment.
+1 to limit the usage to query runner main class.
plugin/trino-postgresql/src/test/java/io/trino/plugin/postgresql/TestingPostgreSqlServer.java
Outdated
Show resolved
Hide resolved
|
The whole point of this change is to make it easier to work with QueryRunners and connect to a containerized database on the default port. Limiting usage to main fulfill this need. |
testing/trino-testing-containers/src/main/java/io/trino/testing/containers/TestContainers.java
Outdated
Show resolved
Hide resolved
plugin/trino-postgresql/src/test/java/io/trino/plugin/postgresql/TestingPostgreSqlServer.java
Outdated
Show resolved
Hide resolved
|
Adding a new argument to (Please ignore this comment if it's already considered) |
testing/trino-testing-containers/src/main/java/io/trino/testing/containers/TestContainers.java
Outdated
Show resolved
Hide resolved
testing/trino-testing-containers/src/main/java/io/trino/testing/containers/TestContainers.java
Outdated
Show resolved
Hide resolved
testing/trino-testing-containers/src/main/java/io/trino/testing/containers/TestContainers.java
Outdated
Show resolved
Hide resolved
testing/trino-testing-containers/src/main/java/io/trino/testing/containers/TestContainers.java
Outdated
Show resolved
Hide resolved
testing/trino-testing-containers/src/main/java/io/trino/testing/containers/TestContainers.java
Outdated
Show resolved
Hide resolved
plugin/trino-postgresql/src/test/java/io/trino/plugin/postgresql/TestingPostgreSqlServer.java
Outdated
Show resolved
Hide resolved
testing/trino-testing-containers/src/main/java/io/trino/testing/containers/TestContainers.java
Outdated
Show resolved
Hide resolved
testing/trino-testing-containers/src/main/java/io/trino/testing/containers/TestContainers.java
Outdated
Show resolved
Hide resolved
ssheikin
left a comment
There was a problem hiding this comment.
LGTM, please squash corresponding commits.
testing/trino-testing-containers/src/main/java/io/trino/testing/containers/TestContainers.java
Outdated
Show resolved
Hide resolved
testing/trino-testing-containers/src/main/java/io/trino/testing/containers/TestContainers.java
Outdated
Show resolved
Hide resolved
testing/trino-testing-containers/src/main/java/io/trino/testing/containers/TestContainers.java
Outdated
Show resolved
Hide resolved
0d7a9b0 to
fa0ede5
Compare
testing/trino-testing-containers/src/main/java/io/trino/testing/containers/TestContainers.java
Outdated
Show resolved
Hide resolved
d277e4f to
eadf4c2
Compare
hashhar
left a comment
There was a problem hiding this comment.
Adding a new argument to
TestingPostgreSqlServerlooked fine, butTestingMySqlServeralready has two arguments in the constructor. If we will apply this change to other connectors too, we may want to consider different approach. e.g. Introduce a new environment variable likesTESTCONTAINERS_USE_FIXED_PORT.(Please ignore this comment if it's already considered)
@ebyhr Do you mean checking for the env var directly in the query runner instead?
I do like the simplicity of setting a well-named self-explanatory env var like USE_FIXED_PORT.
We can revisit this when implementing this for other query runners.
I'm fine with current approach for now.
bb7ba42 to
65288c5
Compare
Yes, setting environment variables in Intellij's Run/Debug Configurations' looks enough to me.
👍 |
Previously ports were randomly bound, which made it harder to work on local environment. Now when running outside of the CI default ports will be used.
65288c5 to
10a8161
Compare
I have another usecase which I poorly described here: #14037 (comment) and for me such environment variable would perfectly match to NOT however
because it's much concise and straight-forward as it is now. |
Description
Previously ports were randomly bound, which made it harder to work on local environment. Now when running outside of the CI default ports will be used.
For now its initial change for Postgressql only, but it could be extended to others (like Mysql, Sqlserver e.t.c.)
Non-technical explanation
Release notes
(x) This is not user-visible and no release notes are required.
( ) Release notes are required, please propose a release note for me.
( ) Release notes are required, with the following suggested text: