Skip to content

Conversation

jacek-prisma
Copy link
Contributor

@jacek-prisma jacek-prisma commented Oct 10, 2025

TML-1464

Makes the vast majority of our tests no longer rely on the datasource url attribute and replaces the URLs with a dummy dummy-url.

Some 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

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).

Copy link

codspeed-hq bot commented Oct 10, 2025

CodSpeed Performance Report

Merging #5643 will not alter performance

Comparing test/do-not-rely-on-url-attributes (f2f70ee) with main (9a5a35d)

Summary

✅ 11 untouched

Copy link
Contributor

WASM Query Engine File Size

Engine This PR Base branch Diff
Postgres 2.191MiB 2.191MiB 0.000B
Postgres (gzip) 867.878KiB 867.881KiB -3.000B
Mysql 2.159MiB 2.159MiB 0.000B
Mysql (gzip) 854.660KiB 854.664KiB -4.000B
Sqlite 2.071MiB 2.071MiB 0.000B
Sqlite (gzip) 820.100KiB 820.102KiB -2.000B
SQL Server 2.130MiB 2.130MiB 0.000B
SQL Server (gzip) 845.639KiB 845.641KiB -2.000B
CockroachDB 2.213MiB 2.213MiB 0.000B
CockroachDB (gzip) 876.962KiB 876.964KiB -2.000B

WASM Query Compiler File Size

Engine This PR Base branch Diff
Postgres 1.859MiB 1.859MiB 0.000B
Postgres (gzip) 733.869KiB 733.869KiB 0.000B
Mysql 1.825MiB 1.825MiB 0.000B
Mysql (gzip) 722.148KiB 722.148KiB 0.000B
Sqlite 1.783MiB 1.783MiB 0.000B
Sqlite (gzip) 704.437KiB 704.437KiB 0.000B
SQL Server 1.856MiB 1.856MiB 0.000B
SQL Server (gzip) 735.097KiB 735.097KiB 0.000B
CockroachDB 1.884MiB 1.884MiB 0.000B
CockroachDB (gzip) 743.478KiB 743.478KiB 0.000B

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant