MySql support.#15
Conversation
|
MySQL support. I would like to reuse the test containers because it is really slow to restart them all the time. But the tests are not fully ready yet, but as preparation I created more random test data. |
|
Is it possible to add a benchmark too ? |
…workCore.BulkInsert into mysql # Conflicts: # src/PhenX.EntityFrameworkCore.BulkInsert/Options/BulkInsertOptions.cs
|
That's embarassing, it looks like the pipeline does not detect any test so it always tells that it's OK while it's not, with this pull request |
|
Benchmark added :) |
|
I hope I have fixed all tests. There are few things worth to mention:
|
|
Mhm, I have this locking issues, that I can not reproduce locally. Would be great if you could also have a look. |
|
Sure! I'll take a look asap |
|
@SebastianStehle that's OK now : test are not ran in parallel anymore but containers are started only once per test class per target framework |
|
I actually prefer the current solution with fixtures because it is super fast to run locally, but I think it is not related to the actual problem with the locking. |
|
They are now actually IClassFixtures, it's still super fast to run locally, it seems to solve the locking issue two : too many containers where started at the same time |
…workCore.BulkInsert into mysql # Conflicts: # tests/PhenX.EntityFrameworkCore.BulkInsert.Tests/DbContainer/TestDbContainer.cs # tests/PhenX.EntityFrameworkCore.BulkInsert.Tests/DbContainer/TestDbContainerSqlServer.cs # tests/PhenX.EntityFrameworkCore.BulkInsert.Tests/Tests/Basic/BasicTestsBase.cs # tests/PhenX.EntityFrameworkCore.BulkInsert.Tests/Tests/Basic/BasicTestsPostgreSql.cs # tests/PhenX.EntityFrameworkCore.BulkInsert.Tests/Tests/Basic/BasicTestsSqlServer.cs # tests/PhenX.EntityFrameworkCore.BulkInsert.Tests/Tests/Basic/BasicTestsSqlite.cs
|
The locking issue only happened with mysql and I think the problem was that the transaction was not disposed. At least it is working fine now. Everything is green and waiting for review. |
| protected override IDatabaseContainer? GetDbContainer() | ||
| { | ||
| return new MySqlBuilder() | ||
| .WithReuse(true) |
There was a problem hiding this comment.
I'm not sure reuse works now, because of .WithName(GetRandomContainerName())
There was a problem hiding this comment.
Yeah, does not work fine together. I think the reuse is really worth it as it is even faster. I have a large test suite similar to with way more tests and it was such a good improvement.
| } | ||
|
|
||
| public async Task DisposeAsync() | ||
| public async Task<TDbContext> CreateContextAsync() |
There was a problem hiding this comment.
Are all your changes required for mysql provider to work ?
There was a problem hiding this comment.
Not really, I added a few more tests, but most of the stuff is needed because of the "reuse" to isolate the tests logically from each other. It could be also solved by creating a new database with each run, but I like this, because it is easier to debug. You can just restart the container and connect with pgadmin or other tools.
|
Nice, thank you very much for merging the branch and for your good work :) |
|
@SebastianStehle and thank you for your contribution :) |
Closes #6