running tests locally

I'm fine with "the build" (the one we check often and build consensus around) being shared GitHub Actions, but we really should be able to reproduce what's done there locally or wherever we want/need to (e.g. some other cloud service). This comes up during releases, and IMHO is good practice.

Assuming others agree and we do in fact want/need to be able to run Fineract tests locally, I'm hoping the way I'm running tests locally (below) is reasonable. And I'm ready to be wrong and learn. Feedback very welcome!


   local integration test failures

I'm getting 5 integration test failures locally that are passing in GitHub Actions:

1. LoanCOBAccountLockCatchupInlineCOBTest.
   testCatchUpInLockedInstanceLastCOBDateIsNull()
2. SavingsAccrualIntegrationTest.
   testAccrualsAreReversedImmediatelyAfterBackdatedTransaction()
3. SavingsInterestPostingTest.
   testOverdraftAndInterestPosting_WithOverdraftProduct_WhitBalanceGreaterZero()
4. SavingsInterestPostingTest. testPostInterestWithOverdraftProduct()
5. SchedulerJobsTestResults. testInterestTransferForSavings()

Commit: 56d410d4f5 <https://github.com/apache/fineract/commit/56d410d4f55777bb3422be8c600fdfddd1487eef>

Aggregate test result: https://adammonsen.com/tmp/2025-09-09-001-test-result/

I ran tests like so:

1. set up a 1gb ramdisk for postgres db
2. started postgres and mock oauth2 server
3. made sure I'm using Zulu 21 JDK
4. gradle --quiet createPGDB -PdbName=fineract_tenants
5. gradle --quiet createPGDB -PdbName=fineract_default
6. |gradle --no-continue cucumber -x
   :fineract-e2e-tests-runner:cucumber $CEX|
7. |gradle --no-continue test -PdbType=postgresql ||-x
   :twofactor-tests:test -x :oauth2-test:test -x
   :fineract-e2e-tests-runner:test ||$CEX|
8. |gradle --no-continue :twofactor-tests:test -PdbType=postgresql ||$CEX|
9. |gradle --no-continue :oauth2-tests:test -PdbType=postgresql ||$CEX|
10. stopped postgres and mock oauth2 server
11. destroyed ramdisk
12. |gradle --quiet testAggregateTestReport -x test|

|$CEX| is short for |-x checkstyleJmh -x checkstyleMain -x checkstyleTest -x spotlessCheck -x spotlessApply -x spotbugsMain -x spotbugsTest -x javadoc -x javadocJar -x modernizer|, for readability. It stands for "common exclusions" (I just made that up). You'll find that same string in .github/workflows/build-postgresql.yml, credit to Ádám S and others way better at this than me.

There's no official testAggregateTestReport task--I use this patch <https://github.com/apache/fineract/compare/develop...meonkeys:apache-fineract:aggregate-test-results2> to create it so I can aggregate the test results. I believe there is no significant difference from develop@56d410d4f5 (mentioned above), but I'm happy to re-test directly against 56d410d4f5 (although I'd still need to aggregate results somehow).

I'm running the above on 64-bit Ubuntu 24.04 LTS desktop with Gradle 8.10.2. I'm not seeing any resource exhaustion: Plenty of disk and RAM to spare. It does peg all CPUs for a short time during the tests (during compilation/etc).


   db disk usage

Note the 1gb ramdisk... during the tests I monitored db storage usage and it went above 0.5gb and that appeared to cause tests to hang? I thought so, anyway, but I'm sometimes still seeing tests hang, even after increasing the ramdisk size from 0.5gb. Be it 0.5gb or 1gb, either way it seems excessive for tests, although I can't say if it's a problem worth attention. Probably a non-issue with GitHub Actions because of sharding/matrix tests (run on short-lived VMs, so auto-cleaned, if you will).

I should also note that using a ramdisk at all introduces an unknown variable, but I've tried with and without the ramdisk and it doesn't seem to make much difference. I think. Other than the obvious speed increase (~15% faster), and that kinda scary sometimes-hangs issue.

Just to be sure, I also ran the same commands above without a ramdisk. Here's that result: https://adammonsen.com/tmp/2025-09-09-002-test-result/ . So, yeah, slightly different: 6 failures instead of 5. Unclear if that's because I didn't use a ramdisk though.

--
Adam Monsen
Software Engineer ~ Mifos Initiative
Apache Fineract Release Manager
PGP key id 0xA9A14F22F57DA182

Reply via email to