Repository navigation
Run the Postgres query plan test only if Postgres is available - #1380
Open
555aaditya wants to merge 1 commit into
Open
555aaditya wants to merge 1 commit into
555aaditya wants to merge 1 commit into
Conversation
testPostgresQueryPlan connects to a Postgres server, but unlike the other query plan and QPG tests it was not skipped when POSTGRES_AVAILABLE is not set, so mvn test failed on machines without that server. Skip only this test, because testFormatQueryPlan does not need a server.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TestPostgresQueryPlan.testPostgresQueryPlancreates tables in a Postgres server, but, unlikeTestPostgresQPGand the CockroachDB, TiDB, and Materialize query plan tests, it is not skipped whenPOSTGRES_AVAILABLEis unset. Somvn testfails on a machine without that server. CI avoids this only because themiscjob excludessqlancer.qpg.**.This PR skips
testPostgresQueryPlanunlessPOSTGRES_AVAILABLE=true, usingTestConfig.isEnvironmentTruelike the tests insqlancer.dbms.testFormatQueryPlandoes not need a server, so it keeps running everywhere.Checked on macOS (arm64), OpenJDK 11.0.33, Maven 3.10.1, on a machine with an unrelated local Postgres 14 that has no
sqlancerrole:main,mvn -Djacoco.skip=true -Dtest=TestPostgresQueryPlan test:testPostgresQueryPlanerrors withPSQLException: FATAL: role "sqlancer" does not exist(2 run, 1 error).testPostgresQueryPlan);testFormatQueryPlanruns and passes.POSTGRES_AVAILABLE=true: the test runs again and fails with the same role error on this machine, so the gate does open. I did not run it against a correctly configured Postgres.mvn -B verify -DskipTests=true: BUILD SUCCESS.python3 src/check_names.py: exit 0.CI does not run this test at all (there is no Postgres QPG job), so this does not change CI.
@mrigger