mongodb / mongo-jdbc-driver

JDBC Driver for MongoDB Atlas SQL interface
Apache License 2.0
37 stars 33 forks source link

SQL-563: Add DatabaseMetaData integration tests #64

Closed mattChiaravalloti closed 2 years ago

mattChiaravalloti commented 2 years ago

This PR adds integration tests for the DatabaseMetaData methods. ~The tests are effectively just stubs right now, though they do cover interesting cases. Once #62 is merged, the test-generating code should bump these stubs out into full-fledged tests.~ I was hesitant to add more data to the testdata set for 2 reasons: 1. SQL-561 is still WIP so I figured I should wait for that to be settled, and 2. I'm not convinced we need many tests for very large datasets -- especially not for these methods. Specifically, these database metadata methods should behave the same regardless of scale, and any changes that come with scale (such as reading from a large cursor), should be completely blackboxed for us by the java driver and therefore are not interesting to test from the jdbc perspective. Let me know if you disagree.

This is updated with mostly generated tests and skip reasons where appropriate (I think we're actually skipping most tests 😅 but that's ok! we'll get to the bugs soon enough)

mattChiaravalloti commented 2 years ago

The test harness is limited to testing the functions that return a ResultSet. There are a few methods in MongoSQLDatabaseMetaData that return a String such as getSQLKeywords(), getNumericFunctions(), getStringFunctions(), getSystemFunctions(), getTimeDateFunctions(). It would be nice to write a separate test case that checks the returns of these for completeness.

Yea I ran into this since I had written stub yml tests for all methods. I removed these and then forgot to add unit tests for them. I'l add unit tests for them now 👍