ecotoneframework / ecotone-dev

Ecotone Framework Development - This is Monorepo which contains all official public modules
https://docs.ecotone.tech
Other
37 stars 16 forks source link

EcotoneLite::bootstrapFlowTesting not updating attributes from filesystem #395

Closed jlabedo closed 8 hours ago

jlabedo commented 8 hours ago

Ecotone version(s) affected: 1.231.4

Description
When using EcotoneLite::bootstrapFlowTesting, the cache is always used when using ServiceConfiguration::withNamespaces(), making tests very hard to debug :)

How to reproduce
In this test, the namespace attributes will be automatically cached:

EcotoneLite::bootstrapFlowTesting(
            configuration: ServiceConfiguration::createWithDefaults()
                ->withNamespaces(["App\MyDomain"])
)

When using "classes to resolve" parameter, attributes are correctly updated:

EcotoneLite::bootstrapFlowTesting(['App\MyDomain\ClassA', 'App\MyDomain\ClassB'])

Possible Solution
This seems to come from this piece of code: https://github.com/ecotoneframework/ecotone-dev/blob/13ec84e586a1a606358af47e5b80cb49eb7ec570/packages/Ecotone/src/Lite/EcotoneLite.php#L378-L383

lifinsky commented 8 hours ago

We even always clear the runtime cache before running integration tests

jlabedo commented 8 hours ago

Yeah, I might have missed the last part of the documentation https://docs.ecotone.tech/modelling/testing-support/testing-messaging#caching-configuration

But It does not seems very DX friendly, especially when you write your tests first