-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add full-stack test for MySQL #69
Comments
I'll give this one a shot |
Looking at how PostgresqlModule is done, it appears would be duplicate logic (particularly utilities like TestContainer). Would it make sense to move TestContainer to a more common location? Would jdbc be the appropriate module? |
I've been unable to figure out the scala/zio syntax to perform a "select 1" call. I think I'm missing something simple. The (still unworking) syntax I thought made sense was In my branch I have test container setup for mysql and enough code in place to get a table selection test working so if anyone can offer some guidance (here or on discord) I'd love to get this example put together and merged. |
created: https://gist.github.com/andrewhj/84ed6c26afdcac56a690f0377a7fff79 for reference |
@andrewhj I am not sure what problem you're running into here, but we will investigate and fix! |
I managed to get a table select test working (just not the simple "select 1" case). I will clean up & submit PR for that case. |
@andrewhj at the moment we need to select from a table, which is probably not ideal, but is the way that the syntax is currently implemented ( from memory |
makes sense. 1 thing to consider (at least on postgres and mysql), is that you'll get a set back equal in size to the table you select. If customer has 5 rows, you'll get back 5 rows of 1. However, if customer is empty, you will get back an empty set (instead of 1). |
Right, I didn't think of that! In that case it should probably be a higher priority. In the meantime you can follow the other tests and just take the first returned value (or you can have a shot at fixing the issue - happy to provide assistance if needed) |
Actually this is correct as per SQL specification. SELECT 1 FROM table must
return as many results as are in the table. Now some databases just support
SELECT 1, i.e. a glorified calculator. But such queries are not realistic
so I don't think it's a priority to support them.
(Sorry I missed the fact the table was missing; we should have a better
error message here, anyway.)
…On Wed, Nov 25, 2020 at 2:23 AM Unclebob ***@***.***> wrote:
Right, I didn't think of that! In that case it should probably be a higher
priority. In the meantime you can follow the other tests and just take the
first returned value (or you can have a shot at fixing the issue - happy to
provide assistance if needed)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#69 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABGISMPFUR32SEMUEGFXTDSRSWFZANCNFSM4Q73YIJQ>
.
|
I meant higher priority only in that it'd mean simpler/faster tests for all the glorified calculator style tests we have to run. Once all the PRs are merged I think I'll go through and tidy them up, break into suites etc; I can take care of it then. |
Depends on #149
We need a full-stack test for MySQL.
We need an automated ZIO Test that, when run, will execute a simple query, such as
select 1
, against a live-running MySQL, and verify the result set returned from the query.This full-stack test will be the foundation for adding other more complicated tests.
This can follow the established pattern from
PostgresModuleTest
.The text was updated successfully, but these errors were encountered: