Skip to content

feat: add searches and aggregation to express backend #17

feat: add searches and aggregation to express backend

feat: add searches and aggregation to express backend #17

name: Run Java Spring Boot Tests
on:
pull_request_target:
branches:
- development
push:
branches:
- development
jobs:
test:
name: Run Java Spring Boot Tests
runs-on: ubuntu-latest
# Require manual approval for fork PRs
environment: testing
defaults:
run:
working-directory: server/java-spring
env:
MONGODB_URI: ${{ secrets.MFLIX_URI }}
ENABLE_SEARCH_TESTS: true
steps:
- name: Checkout code
uses: actions/checkout@v5
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up JDK 21
uses: actions/setup-java@v5
with:
java-version: '21'
distribution: 'temurin'
cache: 'maven'
- name: Make mvnw executable
run: chmod +x mvnw
- name: Debug environment variables
run: |
echo "Checking environment variables..."
echo "MONGODB_URI is set: $(if [ -n "$MONGODB_URI" ]; then echo 'YES'; else echo 'NO'; fi)"
echo "ENABLE_SEARCH_TESTS is set: $(if [ -n "$ENABLE_SEARCH_TESTS" ]; then echo 'YES'; else echo 'NO'; fi)"
echo "MONGODB_URI length: ${#MONGODB_URI}"
- name: Run unit tests
run: ./mvnw test
- name: Run integration tests
run: ./mvnw test -Dtest=MongoDBSearchIntegrationTest
continue-on-error: true
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results
path: server/java-spring/target/surefire-reports/
retention-days: 30
- name: Generate Test Summary
if: always()
working-directory: .
run: |
chmod +x .github/scripts/generate-test-summary-surefire.sh
.github/scripts/generate-test-summary-surefire.sh server/java-spring/target/surefire-reports