Skip to content

Commit ed3afdd

Browse files
authored
Merge branch 'develop' into savings_changes
2 parents a165720 + 70eb2ad commit ed3afdd

File tree

271 files changed

+5933
-2930
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

271 files changed

+5933
-2930
lines changed
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
name: Fineract Build & Cucumber tests (without E2E tests)
2+
3+
on: [push, pull_request]
4+
5+
permissions:
6+
contents: read
7+
8+
jobs:
9+
verify:
10+
runs-on: ubuntu-24.04
11+
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
include:
16+
- task: build-core
17+
job_type: main
18+
- task: cucumber
19+
job_type: main
20+
- task: build-progressive-loan
21+
job_type: progressive-loan
22+
23+
env:
24+
TZ: Asia/Kolkata
25+
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
26+
27+
steps:
28+
- name: Checkout
29+
uses: actions/checkout@v4
30+
with:
31+
fetch-depth: 0
32+
fetch-tags: true
33+
34+
- name: Set up JDK 21
35+
uses: actions/setup-java@v4
36+
with:
37+
java-version: '21'
38+
distribution: 'zulu'
39+
40+
- name: Cache Gradle dependencies
41+
uses: actions/cache@v4
42+
with:
43+
path: |
44+
~/.gradle/caches
45+
~/.gradle/wrapper
46+
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
47+
48+
- name: Setup Gradle and Validate Wrapper
49+
uses: gradle/actions/setup-gradle@v4.4.1
50+
with:
51+
validate-wrappers: true
52+
53+
- name: Run Gradle Task
54+
if: matrix.job_type == 'main'
55+
run: |
56+
case "${{ matrix.task }}" in
57+
build-core)
58+
./gradlew --no-daemon build -x test -x cucumber -x doc
59+
;;
60+
cucumber)
61+
./gradlew --no-daemon cucumber -x :fineract-e2e-tests-runner:cucumber -x checkstyleJmh -x checkstyleMain -x checkstyleTest -x spotlessCheck -x spotlessApply -x spotbugsMain -x spotbugsTest -x javadoc -x javadocJar -x modernizer
62+
;;
63+
esac
64+
65+
- name: Build and Test Progressive Loan
66+
if: matrix.job_type == 'progressive-loan'
67+
run: |
68+
# Build the JAR
69+
./gradlew --no-daemon --console=plain :fineract-progressive-loan-embeddable-schedule-generator:shadowJar
70+
71+
# Store the JAR filename in an environment variable
72+
EMBEDDABLE_JAR_FILE=$(ls fineract-progressive-loan-embeddable-schedule-generator/build/libs/*-all.jar | head -n 1)
73+
echo "EMBEDDABLE_JAR_FILE=$EMBEDDABLE_JAR_FILE" >> $GITHUB_ENV
74+
echo "JAR file: $EMBEDDABLE_JAR_FILE"
75+
76+
# Run unit tests
77+
./gradlew --no-daemon --console=plain :fineract-progressive-loan-embeddable-schedule-generator:test
78+
79+
# Build and run sample application
80+
mkdir -p sample-app
81+
javac -cp "$EMBEDDABLE_JAR_FILE" -d sample-app fineract-progressive-loan-embeddable-schedule-generator/misc/Main.java
82+
java -cp "$EMBEDDABLE_JAR_FILE:sample-app" Main
83+
java -cp "$EMBEDDABLE_JAR_FILE:sample-app" Main 25
84+
85+
- name: Archive test results
86+
if: always()
87+
uses: actions/upload-artifact@v4
88+
with:
89+
name: test-results-${{ matrix.task }}
90+
path: |
91+
**/build/reports/
92+
**/fineract-progressive-loan-embeddable-schedule-generator/build/reports/
93+
if-no-files-found: ignore
94+
retention-days: 5
95+
96+
- name: Archive Progressive Loan JAR
97+
if: matrix.job_type == 'progressive-loan' && always()
98+
uses: actions/upload-artifact@v4
99+
with:
100+
name: progressive-loan-jar
101+
path: ${{ env.EMBEDDABLE_JAR_FILE }}
102+
retention-days: 5
103+
if-no-files-found: ignore
104+
105+
- name: Archive server logs
106+
if: always()
107+
uses: actions/upload-artifact@v4
108+
with:
109+
name: server-logs-${{ matrix.task }}
110+
path: '**/build/cargo/'
111+
retention-days: 5

.github/workflows/build-docker-postgresql.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.
Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,53 @@
1-
name: Fineract Docker build - MariaDB
1+
name: Fineract Docker Builds
2+
23
on: [push, pull_request]
4+
35
permissions:
46
contents: read
7+
58
jobs:
69
build:
710
runs-on: ubuntu-24.04
11+
strategy:
12+
matrix:
13+
db_type: [mariadb, postgresql]
14+
include:
15+
- db_type: mariadb
16+
compose_file: docker-compose.yml
17+
check_worker_health: true
18+
- db_type: postgresql
19+
compose_file: docker-compose-postgresql.yml
20+
check_worker_health: false
21+
822
env:
923
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
1024
IMAGE_NAME: fineract
25+
1126
steps:
1227
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
1328
with:
1429
fetch-depth: 0
30+
1531
- name: Set up JDK 21
1632
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4
1733
with:
1834
java-version: '21'
1935
distribution: 'zulu'
36+
2037
- name: Setup Gradle
2138
uses: gradle/actions/setup-gradle@ac638b010cf58a27ee6c972d7336334ccaf61c96 # v4.4.1
39+
2240
- name: Build the image
2341
run: ./gradlew --no-daemon --console=plain :fineract-provider:jibDockerBuild -Djib.to.image=$IMAGE_NAME -x test -x cucumber
24-
- name: Start the stack
25-
run: docker compose -f docker-compose.yml up -d
42+
43+
- name: Start the ${{ matrix.db_type }} stack
44+
run: docker compose -f ${{ matrix.compose_file }} up -d
45+
2646
- name: Check the stack
2747
run: docker ps
28-
- name: Check health
48+
49+
- name: Check health Manager
2950
run: curl -f -k --retry 60 --retry-all-errors --connect-timeout 30 --retry-delay 30 https://localhost:8443/fineract-provider/actuator/health
30-
- name: Check info
51+
52+
- name: Check info Manager
3153
run: (( $(curl -f -k --retry 5 --retry-all-errors --connect-timeout 30 --retry-delay 30 https://localhost:8443/fineract-provider/actuator/info | wc --chars) > 100 ))
Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
name: Fineract E2E Tests
2+
3+
on: [push, pull_request]
4+
5+
permissions:
6+
contents: read
7+
8+
jobs:
9+
test:
10+
name: E2E Tests (Shard ${{ matrix.shard_index }} of ${{ matrix.total_shards }})
11+
runs-on: ubuntu-24.04
12+
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
# Define the number of shards (1-based indexing)
17+
shard_index: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
18+
total_shards: [10]
19+
20+
env:
21+
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
22+
IMAGE_NAME: fineract
23+
BASE_URL: https://localhost:8443
24+
TEST_USERNAME: mifos
25+
TEST_PASSWORD: password
26+
TEST_STRONG_PASSWORD: A1b2c3d4e5f$
27+
TEST_TENANT_ID: default
28+
INITIALIZATION_ENABLED: true
29+
EVENT_VERIFICATION_ENABLED: true
30+
ACTIVEMQ_BROKER_URL: tcp://localhost:61616
31+
ACTIVEMQ_TOPIC_NAME: events
32+
33+
steps:
34+
- name: Checkout code
35+
uses: actions/checkout@v4
36+
with:
37+
fetch-depth: 0
38+
39+
- name: Set up JDK 21
40+
uses: actions/setup-java@v4
41+
with:
42+
java-version: '21'
43+
distribution: 'zulu'
44+
45+
- name: Setup Gradle
46+
uses: gradle/actions/setup-gradle@v4.4.1
47+
48+
- name: Make scripts executable
49+
run: chmod +x scripts/split-features.sh
50+
51+
- name: Split feature files into shards
52+
id: split-features
53+
run: |
54+
./scripts/split-features.sh ${{ matrix.total_shards }} ${{ matrix.shard_index }}
55+
echo "Shard ${{ matrix.shard_index }} feature files:"
56+
cat feature_shard_${{ matrix.shard_index }}.txt
57+
58+
- name: Build the image
59+
run: ./gradlew --no-daemon --console=plain :fineract-provider:jibDockerBuild -Djib.to.image=$IMAGE_NAME -x test -x cucumber
60+
61+
- name: Start the Fineract stack
62+
run: docker compose -f docker-compose-postgresql-test-activemq.yml up -d
63+
64+
- name: Check the stack
65+
run: docker ps
66+
67+
- name: Wait for Manager to be ready
68+
run: |
69+
# Wait for the container to be running
70+
echo "Waiting for Manager container to be ready..."
71+
timeout 300 bash -c 'until docker ps --filter "health=healthy" --filter "name=fineract" --format "{{.Status}}" | grep -q "healthy"; do
72+
if docker ps --filter "name=fineract" --format "{{.Status}}" | grep -q "unhealthy"; then
73+
echo "Container is unhealthy. Stopping..."
74+
docker ps -a
75+
docker logs $(docker ps -q --filter name=fineract) || true
76+
exit 1
77+
fi
78+
echo "Waiting for Manager to be ready..."
79+
sleep 5
80+
done'
81+
82+
# Check the health endpoint
83+
echo "Checking Manager health endpoint..."
84+
curl -f -k --retry 30 --retry-all-errors --connect-timeout 10 --retry-delay 10 \
85+
https://localhost:8443/fineract-provider/actuator/health
86+
87+
- name: Execute tests for shard ${{ matrix.shard_index }}
88+
run: |
89+
# Read feature files from the shard file
90+
FEATURES=$(tr '\n' ',' < "feature_shard_${{ matrix.shard_index }}.txt" | sed 's/,$//')
91+
92+
if [ -z "$FEATURES" ]; then
93+
echo "No features to test in this shard. Skipping..."
94+
exit 0
95+
fi
96+
97+
# Create a directory for individual allure results
98+
mkdir -p "allure-results-shard-${{ matrix.shard_index }}"
99+
100+
# Read each feature file path and run tests one by one
101+
while IFS= read -r feature_file || [ -n "$feature_file" ]; do
102+
# Skip empty lines
103+
[ -z "$feature_file" ] && continue
104+
105+
# Create a safe filename for the results
106+
safe_name=$(echo "$feature_file" | tr '/' '-' | tr ' ' '_')
107+
108+
echo "Testing feature: $feature_file"
109+
110+
# Run tests with individual allure results directory
111+
./gradlew --no-daemon --console=plain \
112+
:fineract-e2e-tests-runner:cucumber \
113+
-Pcucumber.features="$feature_file" \
114+
-Dallure.results.directory="allure-results-shard-${{ matrix.shard_index }}/$safe_name" \
115+
allureReport || echo "Test failed for $feature_file, continuing with next feature..."
116+
117+
# Copy the results to a merged directory
118+
if [ -d "allure-results-shard-${{ matrix.shard_index }}/$safe_name" ]; then
119+
cp -r "allure-results-shard-${{ matrix.shard_index }}/$safe_name/." "allure-results-merged/" || true
120+
fi
121+
done < "feature_shard_${{ matrix.shard_index }}.txt"
122+
123+
# Generate individual report for this shard
124+
if [ -d "allure-results-merged" ]; then
125+
mkdir -p "allure-report-shard-${{ matrix.shard_index }}"
126+
allure generate "allure-results-merged" --clean -o "allure-report-shard-${{ matrix.shard_index }}" || echo "Failed to generate Allure report for shard ${{ matrix.shard_index }}"
127+
fi
128+
129+
- name: Upload test results
130+
if: always()
131+
uses: actions/upload-artifact@v4
132+
with:
133+
name: allure-results-shard-${{ matrix.shard_index }}
134+
path: |
135+
allure-results-shard-${{ matrix.shard_index }}
136+
allure-results-merged
137+
**/build/allure-results
138+
**/build/reports/tests/test
139+
**/build/test-results/test
140+
retention-days: 5
141+
142+
- name: Upload Allure Report
143+
if: always()
144+
uses: actions/upload-artifact@v4
145+
with:
146+
name: allure-report-shard-${{ matrix.shard_index }}
147+
path: allure-report-shard-${{ matrix.shard_index }}
148+
retention-days: 5
149+
150+
- name: Upload logs
151+
if: always()
152+
uses: actions/upload-artifact@v4
153+
with:
154+
name: logs-shard-${{ matrix.shard_index }}
155+
path: |
156+
**/build/reports/tests/
157+
**/logs/
158+
**/out/
159+
retention-days: 5
160+
161+
- name: Clean up
162+
if: always()
163+
run: |
164+
docker compose -f docker-compose-postgresql-test-activemq.yml down -v
165+
docker system prune -f

0 commit comments

Comments
 (0)