Comments (11)
ok then, we've found the culprit: we actually have a problem with dama + reset_mode=migrate + global story
@kbond I think we actually must add a full CI permutation with this case
from foundry.
Hi!
global state + dama + ResetDatabase
trait is quite a complex problem sometimes.
I'm wondering if this is not the same problem than here: #534 (I'm running postgres, so it could be kinda the same problem, but with different errors)
I need to work on this error.
Do you have the problem without using migrate
as a reset_mode
?
from foundry.
We need to update the CI to allow/test with DAMA 8.
Did you see this note? https://github.com/dmaicher/doctrine-test-bundle?tab=readme-ov-file#troubleshooting
from foundry.
Hi!
global state + dama +
ResetDatabase
trait is quite a complex problem sometimes.I'm wondering if this is not the same problem than here: #534 (I'm running postgres, so it could be kinda the same problem, but with different errors) I need to work on this error.
Do you have the problem without using
migrate
as areset_mode
?
I have not tried to run tests without migrate
because I don't think it is useful since Foundry uses DAMA if you are in migrate
mode. It may work but I lose the point.
We need to update the CI to allow/test with DAMA 8.
Did you see this note? https://github.com/dmaicher/doctrine-test-bundle?tab=readme-ov-file#troubleshooting
Yeah I've checked all of it. Sadly it didn't help me much and the only viable solution for me was to manually execute stories (which is not a pain at all, it is fine, but could be prevented).
from foundry.
I have not tried to run tests without migrate because I don't think it is useful since Foundry uses DAMA if you are in migrate mode. It may work but I lose the point.
I don't understand this statement 🤔
I'm using foundry + dama without migrate
mode 😅
from foundry.
I have not tried to run tests without migrate because I don't think it is useful since Foundry uses DAMA if you are in migrate mode. It may work but I lose the point.
I don't understand this statement 🤔 I'm using foundry + dama without
migrate
mode 😅
I mean yes you can, but according to this piece of documentation on Symfony's website, the main goal of using DAMA and Foundry together is to speed up the migrate
mode (if I understand it correctly) :
Before the first test using the ResetDatabase trait, it drops (if exists) and creates the test database. Then, by default, before each test, it resets the schema using doctrine:schema:drop/doctrine:schema:create.
Alternatively, you can have it run your migrations instead by modifying the reset_mode option in configuration file. When using this mode, before each test, the database is dropped/created and your migrations run (via doctrine:migrations:migrate). This mode can really make your test suite slow (especially if you have a lot of migrations). It is highly recommended to use DamaDoctrineTestBundle to improve the speed. When this bundle is enabled, the database is dropped/created and migrated only once for the suite.
from foundry.
Maybe this part of the docs needs a reword: dama improves performance in both reset modes, since you only have to reset your db once. But it might improve drastically for migration mode, because migration mode is really slower than schema
mode. Nonetheless, I'd advise to use schema
mode unless you really actually need your migrations to be ran before the tests.
from foundry.
Maybe this part of the docs needs a reword: dama improves performance in both reset modes, since you only have to reset your db once. But it might improve drastically for migration mode, because migration mode is really slower than
schema
mode. Nonetheless, I'd advise to useschema
mode unless you really actually need your migrations to be ran before the tests.
Alright ! Thank you for the advice, just tested using schema
mode, I confirm it is a bit faster ! Also, I confirm the issue is happening only using migrate
mode. I guess this is caused by the fact that migrations do ALTER TABLE
etc.
from foundry.
I can confirm I have the same issue:
An exception occurred while executing a query: SQLSTATE[42000]: Syntax error or access violation: 1305 SAVEPOINT DOCTRINE_2 does not exist
In the migrations of course I have ALTER statements etc. So I kind of expect in the Foundry's database resetter to exists something that will disable DAMA and enable it after migrations take place.
I can provide a reproducer and an example and I want to work on a fix if possible but I dont know where to start.
I think I somehow need to disable the DAMA in the ORMDatabaseResetter
but it seems thats its disabled already.
from foundry.
I found the solution the issue is not in foundry or the database resetter. This is because I forgot to add this to my migrations:
public function isTransactional(): bool
{
return false;
}
I think this makes doctrine migrations to always commit a transaction and that breaks DAMA.
from foundry.
I found the solution the issue is not in foundry or the database resetter. This is because I forgot to add this to my migrations:
Ah, glad you found a solution - I've been burned by this before as well. We should perhaps make a note in the docs.
from foundry.
Related Issues (20)
- Creating linked entities dependent on parent entity HOT 2
- Unrecognized option "make_story" under "zenstruck_foundry" HOT 4
- `make:factory` fails when there is more than one level of embedded classes HOT 2
- Named `FactoryCollection` constructors don't have proper type declarations HOT 4
- Performance Problem with random HOT 3
- Doctrine embeddables with v2 HOT 8
- [Tests] use 2 schemas in the same database
- Migration Guide to version 2 HOT 3
- V2 and phpstan HOT 5
- Upgrade from 1.37 to 1.38 introduce a memory leak HOT 16
- H
- [2.x] ArgumentCountError thrown when passing $attributes array to closure in event HOT 9
- Creation of dynamic property App\Entity\MyEntity::$_autoRefresh is deprecated HOT 6
- Issue with Proxy Entities in Version 2 HOT 14
- Zenstruck\Foundry\Factory::$class must not be accessed before initialization HOT 6
- Find functions do not refresh entity HOT 2
- Attribute wrapped in a Foundry Proxy is not compatible with `Symfony\Component\VarExporter\LazyProxyTrait` HOT 6
- Foundry should not remove symfony-s errorHandlers HOT 6
- Global state relationships and flush_after HOT 13
- How to fix deprecation notices HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from foundry.