Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions .github/workflows/new-issue-notify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,33 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Send Slack Notification for New Issue
env:
ISSUE_TITLE: ${{ github.event.issue.title }}
ISSUE_USER: ${{ github.event.issue.user.login }}
ISSUE_URL: ${{ github.event.issue.html_url }}
REPO_NAME: ${{ github.repository }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
run: |
MESSAGE_TEXT="*📢 New Issue Opened in ${{ github.repository }} 📢*\n\n*Issue Title:* ${{ github.event.issue.title }}\n*Opened By:* ${{ github.event.issue.user.login }}\n\n*View Issue:* ${{ github.event.issue.html_url }}"
# Build message text using jq to safely handle user input
MESSAGE_TEXT=$(jq -n \
--arg repo "$REPO_NAME" \
--arg title "$ISSUE_TITLE" \
--arg user "$ISSUE_USER" \
--arg url "$ISSUE_URL" \
'*📢 New Issue Opened in \($repo) 📢*\n\n*Issue Title:* \($title)\n*Opened By:* \($user)\n\n*View Issue:* \($url)')

# Build Slack payload
SLACK_PAYLOAD=$(jq -n \
--arg text "${MESSAGE_TEXT}" \
--arg text "$MESSAGE_TEXT" \
'{
"channel": "#docs-devdocs-notifications",
"username": "Issue Notifier",
"icon_emoji": ":mega:",
"text": $text
}')

# Send to Slack
curl -X POST \
-H 'Content-type: application/json' \
--data "$SLACK_PAYLOAD" \
${{ secrets.SLACK_WEBHOOK }}
"$SLACK_WEBHOOK"
41 changes: 28 additions & 13 deletions .github/workflows/run-express-tests.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Run Express Tests

on:
pull_request_target:
pull_request:
branches:
- development
paths:
Expand All @@ -16,38 +16,54 @@ jobs:
test:
name: Run Express Tests
runs-on: ubuntu-latest
# Require manual approval for fork PRs
environment: testing

defaults:
run:
working-directory: server/js-express

steps:
- name: Checkout code
uses: actions/checkout@v5
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Install Atlas CLI
run: |
curl https://fastdl.mongodb.org/mongocli/mongodb-atlas-cli_1.47.0_linux_x86_64.deb --output atlas-cli.deb
sudo apt install ./atlas-cli.deb

- name: Set up a local deployment using Atlas CLI
run: |
atlas deployments setup myLocalRs1 --type local --port 27017 --force

- name: Install MongoDB Database Tools to load sample data
run: |
curl https://fastdl.mongodb.org/tools/db/mongodb-database-tools-ubuntu2204-x86_64-100.13.0.deb --output mdb-db-tools.deb
sudo apt install ./mdb-db-tools.deb

- name: Download sample data
run: curl https://atlas-education.s3.amazonaws.com/sampledata.archive -o sampledata.archive

- name: Add sample data to database
run: mongorestore --archive=sampledata.archive --port=27017

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install dependencies
working-directory: server/js-express
run: npm install

- name: Run unit tests
working-directory: server/js-express
run: npm run test:unit -- --json --outputFile=test-results-unit.json || true
env:
MONGODB_URI: ${{ secrets.MFLIX_URI }}
MONGODB_URI: mongodb://localhost:27017/sample_mflix

- name: Run integration tests
working-directory: server/js-express
run: npm run test:integration -- --json --outputFile=test-results-integration.json || true
env:
MONGODB_URI: ${{ secrets.MFLIX_URI }}
MONGODB_URI: mongodb://localhost:27017/sample_mflix
ENABLE_SEARCH_TESTS: true
VOYAGE_API_KEY: ${{ secrets.VOYAGE_AI }}
# Note: Vector search tests will be skipped without VOYAGE_API_KEY
# Run these tests locally with a valid API key

- name: Upload test results
uses: actions/upload-artifact@v4
Expand All @@ -62,7 +78,6 @@ jobs:

- name: Generate Test Summary
if: always()
working-directory: .
run: |
chmod +x .github/scripts/generate-test-summary-jest.sh
.github/scripts/generate-test-summary-jest.sh \
Expand Down
45 changes: 31 additions & 14 deletions .github/workflows/run-java-spring-boot-tests.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Run Java Spring Boot Tests

on:
pull_request_target:
pull_request:
branches:
- development
paths:
Expand All @@ -16,22 +16,30 @@ jobs:
test:
name: Run Java Spring Boot Tests
runs-on: ubuntu-latest
# Require manual approval for fork PRs
environment: testing

defaults:
run:
working-directory: mflix/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: Install Atlas CLI
run: |
curl https://fastdl.mongodb.org/mongocli/mongodb-atlas-cli_1.47.0_linux_x86_64.deb --output atlas-cli.deb
sudo apt install ./atlas-cli.deb

- name: Set up a local deployment using Atlas CLI
run: |
atlas deployments setup myLocalRs1 --type local --port 27017 --force

- name: Install MongoDB Database Tools to load sample data
run: |
curl https://fastdl.mongodb.org/tools/db/mongodb-database-tools-ubuntu2204-x86_64-100.13.0.deb --output mdb-db-tools.deb
sudo apt install ./mdb-db-tools.deb

- name: Download sample data
run: curl https://atlas-education.s3.amazonaws.com/sampledata.archive -o sampledata.archive

- name: Add sample data to database
run: mongorestore --archive=sampledata.archive --port=27017

- name: Set up JDK 21
uses: actions/setup-java@v5
Expand All @@ -41,14 +49,24 @@ jobs:
cache: 'maven'

- name: Make mvnw executable
working-directory: mflix/server/java-spring
run: chmod +x mvnw

- name: Run unit tests
working-directory: mflix/server/java-spring
run: ./mvnw test
env:
MONGODB_URI: mongodb://localhost:27017/sample_mflix

- name: Run integration tests
working-directory: mflix/server/java-spring
run: ./mvnw test -Dtest=MongoDBSearchIntegrationTest
continue-on-error: true
env:
MONGODB_URI: mongodb://localhost:27017/sample_mflix
ENABLE_SEARCH_TESTS: true
# Note: Vector search tests will be skipped without VOYAGE_API_KEY
# Run these tests locally with a valid API key

- name: Upload test results
uses: actions/upload-artifact@v4
Expand All @@ -60,7 +78,6 @@ jobs:

- 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 mflix/server/java-spring/target/surefire-reports
39 changes: 27 additions & 12 deletions .github/workflows/run-python-tests.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Run Python Tests

on:
pull_request_target:
pull_request:
branches:
- development
paths:
Expand All @@ -16,40 +16,56 @@ jobs:
test:
name: Run Python Tests
runs-on: ubuntu-latest
# Require manual approval for fork PRs
environment: testing

defaults:
run:
working-directory: mflix/server/python-fastapi

steps:
- name: Checkout code
uses: actions/checkout@v5
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Install Atlas CLI
run: |
curl https://fastdl.mongodb.org/mongocli/mongodb-atlas-cli_1.47.0_linux_x86_64.deb --output atlas-cli.deb
sudo apt install ./atlas-cli.deb

- name: Set up a local deployment using Atlas CLI
run: |
atlas deployments setup myLocalRs1 --type local --port 27017 --force

- name: Install MongoDB Database Tools to load sample data
run: |
curl https://fastdl.mongodb.org/tools/db/mongodb-database-tools-ubuntu2204-x86_64-100.13.0.deb --output mdb-db-tools.deb
sudo apt install ./mdb-db-tools.deb

- name: Download sample data
run: curl https://atlas-education.s3.amazonaws.com/sampledata.archive -o sampledata.archive

- name: Add sample data to database
run: mongorestore --archive=sampledata.archive --port=27017

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.13'
cache: 'pip'
cache-dependency-path: mflix/server/python-fastapi/requirements.txt

- name: Install dependencies
working-directory: mflix/server/python-fastapi
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt

- name: Run unit tests
working-directory: mflix/server/python-fastapi
run: pytest -m unit --verbose --tb=short --junit-xml=test-results-unit.xml
env:
MONGO_URI: ${{ secrets.MFLIX_URI }}
MONGO_URI: mongodb://localhost:27017
MONGO_DB: sample_mflix

- name: Run integration tests
working-directory: mflix/server/python-fastapi
run: pytest -m integration --verbose --tb=short --junit-xml=test-results-integration.xml || true
env:
MONGO_URI: ${{ secrets.MFLIX_URI }}
MONGO_URI: mongodb://localhost:27017
MONGO_DB: sample_mflix

- name: Upload test results
Expand All @@ -65,7 +81,6 @@ jobs:

- name: Generate Test Summary
if: always()
working-directory: .
run: |
chmod +x .github/scripts/generate-test-summary-pytest.sh
.github/scripts/generate-test-summary-pytest.sh \
Expand Down