Fineract Updates
Hello, we need to consult with you.
We are working on our future strategy for e2e, integration, and unit tests. Let me first describe how we handle them now and how we envision them in the future.
Lets add custom dir as git submodule
In this case, if I make some changes in the custom/banank directory, the BASE git repo will only show modifications inside custom/banank. I can easily ignore those when preparing a pull request to the community if we made some updates in the vanilla Fineract. Since the submodule has its own git history, the base repository will only track the submodule commit hash.
Also, we did some changes in the upstream, let me share how our typical change looks like
We generally open interfaces, classes or properties to be able to override them, we aim to keep the main project as the point of truth and do not want to make changes to the working logic
1.11.0 -> custom changes -> 1.12.1
Alexander Voroshilov successfully merged 1.12.1 into our updated codebase, which evolved from 1.11.0.
We tried to maximize the capabilities of custom modules and achieved some success. This became a viable way to make changes without affecting the main codebase. We prepared the changes we needed to make to be able to modify the implementation of existing code as a pull request. I also submitted an issue to https://issues.apache.org to create an issue and describe the motivation for the changes.
One of the issues was testing.
We had two main options:
Copy the core test files and override them in cases where we add new fields to entities.
Add tests to the existing project in a separate folder to semantically indicate that these tests are not part of the main codebase.
As a result, we are currently using both approaches, but we don’t like the fact that, in order to maintain tests in the custom module, we have to duplicate the test execution logic, the core test code, and dependencies.
New tests in vanilla code base
e2e tests structure | integration tests structure |
|---|---|
New tests in the custom module
Also, we added this lines to be abble use extra dependencies to the fineract-e2e-tests-core/build.gradle
implementation "org.apache.camel.springboot:camel-spring-boot-starter:4.13.0"
implementation "org.apache.camel:camel-core:4.13.0"
implementation "org.apache.camel:camel-nats:4.13.0"What we would like to achieve regarding testing
In my ideal world, all the test loading logic remains in the vanilla Fineract, but it should be able to load new tests from the custom module as well.
To load custom modules, the following script is used in build.gradle:
file("${rootDir}/custom").eachDir { companyDir ->
if('build' != companyDir.name && 'docker' != companyDir.name) {
file("${rootDir}/custom/${companyDir.name}").eachDir { categoryDir ->
if('build' != categoryDir.name) {
file("${rootDir}/custom/${companyDir.name}/${categoryDir.name}").eachDir { moduleDir ->
if('build' != moduleDir.name) {
project.fineractJavaProjects.add(project(":custom:${companyDir.name}:${categoryDir.name}:${moduleDir.name}"))
project.fineractCustomProjects.add(project(":custom:${companyDir.name}:${categoryDir.name}:${moduleDir.name}"))
}
}
}
}
}
}We would like to have a similar test loading mechanism from the custom module for e2e, unit, and integration tests.
We are ready to try implementing this functionality ourselves, but we would like to make sure that the Fineract community will accept this approach.