FINERACT-2326: Fix split-tests.sh script

This commit is contained in:
Adam Saghy
2025-09-23 09:34:44 +02:00
committed by Arnold Gálovics
parent 7f07c0afce
commit 84c90d6016
6 changed files with 16 additions and 45 deletions
+1 -13
View File
@@ -13,7 +13,7 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
task: [test-core-1, test-core-2, test-core-3, test-core-4, test-core-5, test-twofactor, test-oauth2] task: [test-core-1, test-core-2, test-core-3, test-core-4, test-core-5]
services: services:
mariadb: mariadb:
@@ -100,18 +100,6 @@ jobs:
FAILED=0 FAILED=0
case "${{ matrix.task }}" in case "${{ matrix.task }}" in
test-twofactor)
if ! ./gradlew --no-daemon :twofactor-tests:test -x checkstyleJmh -x checkstyleMain -x checkstyleTest -x spotlessCheck -x spotlessApply -x spotbugsMain -x spotbugsTest -x javadoc -x javadocJar -x modernizer; then
echo "::error::Two-factor tests failed"
FAILED=1
fi
;;
test-oauth2)
if ! ./gradlew --no-daemon :oauth2-tests:test -x checkstyleJmh -x checkstyleMain -x checkstyleTest -x spotlessCheck -x spotlessApply -x spotbugsMain -x spotbugsTest -x javadoc -x javadocJar -x modernizer; then
echo "::error::OAuth2 tests failed"
FAILED=1
fi
;;
test-core-*) test-core-*)
echo "Grouping test classes by module..." echo "Grouping test classes by module..."
declare -A module_tests declare -A module_tests
+1 -13
View File
@@ -13,7 +13,7 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
task: [test-core-1, test-core-2, test-core-3, test-core-4, test-core-5, test-twofactor, test-oauth2] task: [test-core-1, test-core-2, test-core-3, test-core-4, test-core-5]
services: services:
mysql: mysql:
@@ -100,18 +100,6 @@ jobs:
FAILED=0 FAILED=0
case "${{ matrix.task }}" in case "${{ matrix.task }}" in
test-twofactor)
if ! ./gradlew --no-daemon :twofactor-tests:test -PdbType=mysql -x checkstyleJmh -x checkstyleMain -x checkstyleTest -x spotlessCheck -x spotlessApply -x spotbugsMain -x spotbugsTest -x javadoc -x javadocJar -x modernizer; then
echo "::error::Two-factor tests failed"
FAILED=1
fi
;;
test-oauth2)
if ! ./gradlew --no-daemon :oauth2-tests:test -PdbType=mysql -x checkstyleJmh -x checkstyleMain -x checkstyleTest -x spotlessCheck -x spotlessApply -x spotbugsMain -x spotbugsTest -x javadoc -x javadocJar -x modernizer; then
echo "::error::OAuth2 tests failed"
FAILED=1
fi
;;
test-core-*) test-core-*)
echo "Grouping test classes by module..." echo "Grouping test classes by module..."
declare -A module_tests declare -A module_tests
+1 -13
View File
@@ -13,7 +13,7 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
task: [test-core-1, test-core-2, test-core-3, test-core-4, test-core-5, test-twofactor, test-oauth2] task: [test-core-1, test-core-2, test-core-3, test-core-4, test-core-5]
services: services:
postgresql: postgresql:
@@ -101,18 +101,6 @@ jobs:
FAILED=0 FAILED=0
case "${{ matrix.task }}" in case "${{ matrix.task }}" in
test-twofactor)
if ! ./gradlew --no-daemon :twofactor-tests:test -PdbType=postgresql -x checkstyleJmh -x checkstyleMain -x checkstyleTest -x spotlessCheck -x spotlessApply -x spotbugsMain -x spotbugsTest -x javadoc -x javadocJar -x modernizer; then
echo "::error::Two-factor tests failed"
FAILED=1
fi
;;
test-oauth2)
if ! ./gradlew --no-daemon :oauth2-tests:test -PdbType=postgresql -x checkstyleJmh -x checkstyleMain -x checkstyleTest -x spotlessCheck -x spotlessApply -x spotbugsMain -x spotbugsTest -x javadoc -x javadocJar -x modernizer; then
echo "::error::OAuth2 tests failed"
FAILED=1
fi
;;
test-core-*) test-core-*)
echo "Grouping test classes by module..." echo "Grouping test classes by module..."
declare -A module_tests declare -A module_tests
@@ -52,10 +52,12 @@ import org.apache.fineract.integrationtests.common.savings.SavingsProductHelper;
import org.apache.fineract.portfolio.savings.SavingsAccountTransactionType; import org.apache.fineract.portfolio.savings.SavingsAccountTransactionType;
import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@Disabled("Disabled till FINERACT-2378 fixed")
public class SavingsInterestPostingTest { public class SavingsInterestPostingTest {
private static final Logger LOG = LoggerFactory.getLogger(SavingsInterestPostingTest.class); private static final Logger LOG = LoggerFactory.getLogger(SavingsInterestPostingTest.class);
@@ -88,6 +90,11 @@ public class SavingsInterestPostingTest {
@Test @Test
public void testPostInterestWithOverdraftProduct() { public void testPostInterestWithOverdraftProduct() {
try { try {
final LocalDate startDate = LocalDate.of(LocalDate.now(Utils.getZoneIdOfTenant()).getYear(), 2, 1);
// Simulate time passing - update business date to February
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
new PutGlobalConfigurationsRequest().enabled(true));
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, startDate);
final String amount = "10000"; final String amount = "10000";
final Account assetAccount = accountHelper.createAssetAccount(); final Account assetAccount = accountHelper.createAssetAccount();
@@ -103,7 +110,7 @@ public class SavingsInterestPostingTest {
interestReceivableAccount.getAccountID().toString(), assetAccount, incomeAccount, expenseAccount, liabilityAccount); interestReceivableAccount.getAccountID().toString(), assetAccount, incomeAccount, expenseAccount, liabilityAccount);
final Integer clientId = ClientHelper.createClient(requestSpec, responseSpec, "01 January 2025"); final Integer clientId = ClientHelper.createClient(requestSpec, responseSpec, "01 January 2025");
final LocalDate startDate = LocalDate.of(LocalDate.now(Utils.getZoneIdOfTenant()).getYear(), 2, 1);
final String startDateString = DateTimeFormatter.ofPattern("dd MMMM yyyy", Locale.US).format(startDate); final String startDateString = DateTimeFormatter.ofPattern("dd MMMM yyyy", Locale.US).format(startDate);
final Integer accountId = savingsAccountHelper.applyForSavingsApplicationOnDate(clientId, productId, final Integer accountId = savingsAccountHelper.applyForSavingsApplicationOnDate(clientId, productId,
@@ -113,8 +120,6 @@ public class SavingsInterestPostingTest {
savingsAccountHelper.depositToSavingsAccount(accountId, amount, startDateString, CommonConstants.RESPONSE_RESOURCE_ID); savingsAccountHelper.depositToSavingsAccount(accountId, amount, startDateString, CommonConstants.RESPONSE_RESOURCE_ID);
// Simulate time passing - update business date to March // Simulate time passing - update business date to March
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
new PutGlobalConfigurationsRequest().enabled(true));
LocalDate marchDate = LocalDate.of(startDate.getYear(), 3, 1); LocalDate marchDate = LocalDate.of(startDate.getYear(), 3, 1);
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, marchDate); BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, marchDate);
@@ -91,6 +91,7 @@ import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.MethodOrderer.MethodName; import org.junit.jupiter.api.MethodOrderer.MethodName;
import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
@@ -1265,6 +1266,7 @@ public class SchedulerJobsTestResults extends IntegrationTest {
} }
@Test @Test
@Disabled("Disabled due to FINERACT-2378")
public void testInterestTransferForSavings() throws InterruptedException { public void testInterestTransferForSavings() throws InterruptedException {
this.savingsAccountHelper = new SavingsAccountHelper(requestSpec, responseSpec); this.savingsAccountHelper = new SavingsAccountHelper(requestSpec, responseSpec);
FixedDepositAccountHelper fixedDepositAccountHelper = new FixedDepositAccountHelper(requestSpec, responseSpec); FixedDepositAccountHelper fixedDepositAccountHelper = new FixedDepositAccountHelper(requestSpec, responseSpec);
+3 -3
View File
@@ -12,7 +12,7 @@ fi
echo "🔍 Searching for eligible JUnit test classes..." echo "🔍 Searching for eligible JUnit test classes..."
ALL_TESTS=$(find . -type f -path "*/src/test/java/*Test.java" \ ALL_TESTS=$(find . -type f -path "*/src/test/java/*.java" \
| while read filepath; do | while read filepath; do
filename=$(basename "$filepath") filename=$(basename "$filepath")
@@ -22,8 +22,8 @@ ALL_TESTS=$(find . -type f -path "*/src/test/java/*Test.java" \
continue continue
fi fi
# Skip if file doesn't contain valid JUnit annotations # Check for valid JUnit test annotations (exact word match)
if ! grep -qE "@Test|@Nested|@ParameterizedTest" "$filepath"; then if ! grep -q -w "@Test\|@Nested\|@ParameterizedTest" "$filepath"; then
continue continue
fi fi