prisma-engines
9bf76dbe - test: do not rely on the datasource url in tests (#5644)

Commit
128 days ago
test: do not rely on the datasource url in tests (#5644) [TML-1464](https://linear.app/prisma-company/issue/TML-1463/rewrite-prisma-engines-tests-to-bypass-envtest-database-url) 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` - 8 tests in this file manually spawn the schema engine binary, currently there is no way to pass the URL to it - `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` - one test programatically instantiates the schema engine, currently there is no way to pass the URL to it - `connecting_to_a_postgres_database_with_the_cockroach_connector_fails` - `query-engine/black-box-tests` - 4 tests in this directory manually spawn the query engine binary, currently there is no way to pass the URL to it - current workaround: https://github.com/prisma/prisma-engines/blob/69604b598fc4df42ba275353886e48ad742a30e3/query-engine/connector-test-kit-rs/query-tests-setup/src/datamodel_rendering/mod.rs#L53 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).
Author
Parents
Loading