test: do not rely on the datasource url in tests #5644
Merged
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.
TML-1464
Makes sure that the vast majority of our tests no longer rely on the datasource url attribute and replaces the URLs with a dummy
dummy-url
.The exceptions:
schema-engine/cli/tests/cli_tests.rs
execute_postgres
introspect_single_postgres_force
introspect_multi_postgres_force
get_database_version_multi_file
introspect_sqlite_empty_database
introspect_sqlite_invalid_empty_database
basic_jsonrpc_roundtrip_works_with_no_params
basic_jsonrpc_roundtrip_works_with_params
schema-engine/sql-migration-tests/tests/migrations/postgres.rs
connecting_to_a_postgres_database_with_the_cockroach_connector_fails
query-engine/black-box-tests
prisma-engines/query-engine/connector-test-kit-rs/query-tests-setup/src/datamodel_rendering/mod.rs
Line 53 in 69604b5
In the case of all these tests, they still rely on the URL attribute, they could be modified to pass the URL through RPC pretty easily though since they directly use RPC commands (which would require us to actually implement something like that in the RPC and I think we will need something like that in Prisma 7, it's currently not possible).
The main changes are split into two commits, the first adjusts the test code and the second replaces all TEST_DATABASE_URL with a dummy value (to verify they're not used).