Skip to content

Commit 8e8ebb4

Browse files
authored
Merge pull request #84 from mongodb/development
Merge development branch into main
2 parents e4dfe53 + 45d5e58 commit 8e8ebb4

39 files changed

Lines changed: 1485 additions & 817 deletions

.github/scripts/generate-test-summary-jest.sh

Lines changed: 32 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,17 @@ set -e
55
# Shows breakdown by test type (unit vs integration)
66
# Usage: ./generate-test-summary-jest.sh <unit-json> <integration-json>
77

8+
# Guard: skip if GITHUB_STEP_SUMMARY is not set
9+
if [ -z "$GITHUB_STEP_SUMMARY" ]; then
10+
echo "Warning: GITHUB_STEP_SUMMARY not set, skipping summary generation"
11+
exit 0
12+
fi
13+
814
UNIT_JSON="${1:-}"
915
INTEGRATION_JSON="${2:-}"
1016

11-
echo "## Test Results" >> $GITHUB_STEP_SUMMARY
12-
echo "" >> $GITHUB_STEP_SUMMARY
17+
echo "## Test Results" >> "$GITHUB_STEP_SUMMARY"
18+
echo "" >> "$GITHUB_STEP_SUMMARY"
1319

1420
# Function to parse Jest JSON file
1521
parse_json() {
@@ -55,37 +61,37 @@ total_failed=$((unit_failed + int_failed))
5561
total_skipped=$((unit_skipped + int_skipped))
5662

5763
# Display detailed breakdown
58-
echo "### Summary by Test Type" >> $GITHUB_STEP_SUMMARY
59-
echo "" >> $GITHUB_STEP_SUMMARY
60-
echo "| Test Type | Passed | Failed | Skipped | Total |" >> $GITHUB_STEP_SUMMARY
61-
echo "|-----------|--------|--------|---------|-------|" >> $GITHUB_STEP_SUMMARY
64+
echo "### Summary by Test Type" >> "$GITHUB_STEP_SUMMARY"
65+
echo "" >> "$GITHUB_STEP_SUMMARY"
66+
echo "| Test Type | Passed | Failed | Skipped | Total |" >> "$GITHUB_STEP_SUMMARY"
67+
echo "|-----------|--------|--------|---------|-------|" >> "$GITHUB_STEP_SUMMARY"
6268

6369
if [ -f "$UNIT_JSON" ]; then
64-
echo "| 🔧 Unit Tests | $unit_passed | $unit_failed | $unit_skipped | $unit_tests |" >> $GITHUB_STEP_SUMMARY
70+
echo "| 🔧 Unit Tests | $unit_passed | $unit_failed | $unit_skipped | $unit_tests |" >> "$GITHUB_STEP_SUMMARY"
6571
fi
6672

6773
if [ -f "$INTEGRATION_JSON" ]; then
68-
echo "| 🔗 Integration Tests | $int_passed | $int_failed | $int_skipped | $int_tests |" >> $GITHUB_STEP_SUMMARY
74+
echo "| 🔗 Integration Tests | $int_passed | $int_failed | $int_skipped | $int_tests |" >> "$GITHUB_STEP_SUMMARY"
6975
fi
7076

71-
echo "| **Total** | **$total_passed** | **$total_failed** | **$total_skipped** | **$total_tests** |" >> $GITHUB_STEP_SUMMARY
72-
echo "" >> $GITHUB_STEP_SUMMARY
77+
echo "| **Total** | **$total_passed** | **$total_failed** | **$total_skipped** | **$total_tests** |" >> "$GITHUB_STEP_SUMMARY"
78+
echo "" >> "$GITHUB_STEP_SUMMARY"
7379

7480
# Overall status
75-
echo "### Overall Status" >> $GITHUB_STEP_SUMMARY
76-
echo "" >> $GITHUB_STEP_SUMMARY
77-
echo "| Status | Count |" >> $GITHUB_STEP_SUMMARY
78-
echo "|--------|-------|" >> $GITHUB_STEP_SUMMARY
79-
echo "| ✅ Passed | $total_passed |" >> $GITHUB_STEP_SUMMARY
80-
echo "| ❌ Failed | $total_failed |" >> $GITHUB_STEP_SUMMARY
81-
echo "| ⏭️ Skipped | $total_skipped |" >> $GITHUB_STEP_SUMMARY
82-
echo "| **Total** | **$total_tests** |" >> $GITHUB_STEP_SUMMARY
83-
echo "" >> $GITHUB_STEP_SUMMARY
81+
echo "### Overall Status" >> "$GITHUB_STEP_SUMMARY"
82+
echo "" >> "$GITHUB_STEP_SUMMARY"
83+
echo "| Status | Count |" >> "$GITHUB_STEP_SUMMARY"
84+
echo "|--------|-------|" >> "$GITHUB_STEP_SUMMARY"
85+
echo "| ✅ Passed | $total_passed |" >> "$GITHUB_STEP_SUMMARY"
86+
echo "| ❌ Failed | $total_failed |" >> "$GITHUB_STEP_SUMMARY"
87+
echo "| ⏭️ Skipped | $total_skipped |" >> "$GITHUB_STEP_SUMMARY"
88+
echo "| **Total** | **$total_tests** |" >> "$GITHUB_STEP_SUMMARY"
89+
echo "" >> "$GITHUB_STEP_SUMMARY"
8490

8591
# List failed tests if any
8692
if [ $total_failed -gt 0 ]; then
87-
echo "### ❌ Failed Tests" >> $GITHUB_STEP_SUMMARY
88-
echo "" >> $GITHUB_STEP_SUMMARY
93+
echo "### ❌ Failed Tests" >> "$GITHUB_STEP_SUMMARY"
94+
echo "" >> "$GITHUB_STEP_SUMMARY"
8995

9096
failed_tests_file=$(mktemp)
9197

@@ -107,16 +113,16 @@ if [ $total_failed -gt 0 ]; then
107113

108114
if [ -s "$failed_tests_file" ]; then
109115
while IFS= read -r test; do
110-
echo "- \`$test\`" >> $GITHUB_STEP_SUMMARY
116+
echo "- \`$test\`" >> "$GITHUB_STEP_SUMMARY"
111117
done < "$failed_tests_file"
112118
else
113-
echo "_Unable to parse individual test names_" >> $GITHUB_STEP_SUMMARY
119+
echo "_Unable to parse individual test names_" >> "$GITHUB_STEP_SUMMARY"
114120
fi
115121

116-
echo "" >> $GITHUB_STEP_SUMMARY
117-
echo "❌ **Tests failed!**" >> $GITHUB_STEP_SUMMARY
122+
echo "" >> "$GITHUB_STEP_SUMMARY"
123+
echo "❌ **Tests failed!**" >> "$GITHUB_STEP_SUMMARY"
118124
rm -f "$failed_tests_file"
119125
exit 1
120126
else
121-
echo "✅ **All tests passed!**" >> $GITHUB_STEP_SUMMARY
127+
echo "✅ **All tests passed!**" >> "$GITHUB_STEP_SUMMARY"
122128
fi

.github/workflows/run-express-tests.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,16 @@ jobs:
4141
- name: Add sample data to database
4242
run: mongorestore --archive=sampledata.archive --port=27017
4343

44+
- name: Install MongoDB Shell (mongosh)
45+
run: |
46+
curl https://downloads.mongodb.com/compass/mongosh-2.3.8-linux-x64.tgz -o mongosh.tgz
47+
tar -xzf mongosh.tgz
48+
sudo cp mongosh-2.3.8-linux-x64/bin/* /usr/local/bin/
49+
50+
- name: Create indexes for aggregation performance
51+
run: |
52+
mongosh "mongodb://localhost:27017/sample_mflix?directConnection=true" --eval "db.comments.createIndex({ movie_id: 1 })"
53+
4454
- name: Set up Node.js
4555
uses: actions/setup-node@v4
4656
with:
@@ -52,15 +62,16 @@ jobs:
5262

5363
- name: Run unit tests
5464
working-directory: mflix/server/js-express
55-
run: npm run test:unit -- --json --outputFile=test-results-unit.json || true
65+
run: npm run test:unit -- --json --outputFile=test-results-unit.json
5666
env:
57-
MONGODB_URI: mongodb://localhost:27017/sample_mflix
67+
MONGODB_URI: mongodb://localhost:27017/sample_mflix?directConnection=true
5868

5969
- name: Run integration tests
6070
working-directory: mflix/server/js-express
61-
run: npm run test:integration -- --json --outputFile=test-results-integration.json || true
71+
continue-on-error: true
72+
run: npm run test:integration -- --json --outputFile=test-results-integration.json
6273
env:
63-
MONGODB_URI: mongodb://localhost:27017/sample_mflix
74+
MONGODB_URI: mongodb://localhost:27017/sample_mflix?directConnection=true
6475
ENABLE_SEARCH_TESTS: true
6576
# Note: Vector search tests will be skipped without VOYAGE_API_KEY
6677
# Run these tests locally with a valid API key

mflix/README-JAVA-SPRING.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,16 @@ This is a full-stack movie browsing application built with Java Spring Boot and
1414
└── mvnw
1515
```
1616

17+
## Data Limitations
18+
19+
The `sample_mflix` dataset contains movies released up to **2016**. Searching for movies from 2017 or later will return no results. This is a limitation of the sample dataset, not the application.
20+
1721
## Prerequisites
1822

1923
- **Java 21** or higher
2024
- **Node.js 20** or higher
2125
- **MongoDB Atlas cluster or local deployment** with the `sample_mflix` dataset loaded
22-
- [Load sample data](https://www.mongodb.com/docs/atlas/sample-data/)
26+
- [Load sample data](https://www.mongodb.com/docs/atlas/sample-data/)
2327
- **Maven** (included via Maven Wrapper)
2428
- **Voyage AI API key** (For MongoDB Vector Search)
2529
- [Get a Voyage AI API key](https://www.voyageai.com/)

mflix/README-JAVASCRIPT-EXPRESS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ This is a full-stack movie browsing application built with Express.js and Next.j
1414
└── tsconfig.json
1515
```
1616

17+
## Data Limitations
18+
19+
The `sample_mflix` dataset contains movies released up to **2016**. Searching for movies from 2017 or later will return no results. This is a limitation of the sample dataset, not the application.
20+
1721
## Prerequisites
1822

1923
- **Node.js 22** or higher

mflix/README-PYTHON-FASTAPI.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ This is a full-stack movie browsing application built with Python FastAPI and Ne
1717
└── requirements.txt
1818
```
1919

20+
## Data Limitations
21+
22+
The `sample_mflix` dataset contains movies released up to **2016**. Searching for movies from 2017 or later will return no results. This is a limitation of the sample dataset, not the application.
23+
2024
## Prerequisites
2125

2226
- **Python 3.10** to **Python 3.13**

mflix/client/app/aggregations/aggregations.module.css

Lines changed: 41 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,53 @@
1-
/* Aggregations styles */
1+
/* Aggregations styles - MongoDB Branded */
22
.container {
33
max-width: 1200px;
44
margin: 0 auto;
5-
padding: 2rem;
5+
padding: 2.5rem;
66
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
77
}
88

99
.title {
10-
font-size: 2.5rem;
10+
font-size: 2.75rem;
1111
font-weight: 700;
12-
color: #1a1a1a;
13-
margin-bottom: 0.5rem;
12+
color: var(--mongodb-slate);
13+
margin-bottom: 0.75rem;
1414
text-align: center;
1515
}
1616

17+
.title::after {
18+
content: '';
19+
display: block;
20+
width: 100px;
21+
height: 4px;
22+
background: var(--mongodb-spring);
23+
margin: 1rem auto 0;
24+
border-radius: 2px;
25+
}
26+
1727
.subtitle {
18-
font-size: 1.1rem;
19-
color: #666;
28+
font-size: 1.15rem;
29+
color: var(--color-text-secondary);
2030
text-align: center;
2131
margin-bottom: 3rem;
32+
font-weight: 500;
2233
}
2334

2435
.section {
2536
margin-bottom: 3rem;
26-
background: #fff;
27-
border-radius: 8px;
28-
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
37+
background: var(--mongodb-white);
38+
border-radius: var(--radius-xl);
39+
box-shadow: var(--shadow-lg);
2940
overflow: hidden;
41+
border: 2px solid var(--mongodb-mint);
3042
}
3143

3244
.sectionTitle {
3345
font-size: 1.5rem;
34-
font-weight: 600;
35-
color: #2c3e50;
46+
font-weight: 700;
47+
color: var(--mongodb-white);
3648
margin: 0;
3749
padding: 1.5rem 2rem;
38-
background: #f8f9fa;
39-
border-bottom: 1px solid #e9ecef;
50+
background: var(--mongodb-forest);
4051
}
4152

4253
.tableContainer {
@@ -47,31 +58,34 @@
4758
.table {
4859
width: 100%;
4960
border-collapse: collapse;
50-
font-size: 0.9rem;
61+
font-size: 0.95rem;
5162
}
5263

5364
.table th {
54-
background: #34495e;
55-
color: white;
65+
background: var(--mongodb-slate);
66+
color: var(--mongodb-white);
5667
font-weight: 600;
57-
padding: 1rem;
68+
padding: 1.125rem 1.25rem;
5869
text-align: left;
5970
white-space: nowrap;
71+
font-size: 0.9rem;
72+
text-transform: uppercase;
73+
letter-spacing: 0.05em;
6074
}
6175

6276
.table td {
63-
padding: 1rem;
64-
border-bottom: 1px solid #e9ecef;
77+
padding: 1.125rem 1.25rem;
78+
border-bottom: 1px solid var(--color-border);
6579
vertical-align: top;
6680
}
6781

6882
.table tr:hover {
69-
background: #f8f9fa;
83+
background: #F7FAFC;
7084
}
7185

7286
.movieTitle {
7387
font-weight: 600;
74-
color: #2c3e50;
88+
color: var(--mongodb-slate);
7589
max-width: 200px;
7690
word-wrap: break-word;
7791
}
@@ -96,9 +110,9 @@
96110
.comment {
97111
margin-bottom: 0.75rem;
98112
padding: 0.5rem;
99-
background: #f8f9fa;
100-
border-radius: 4px;
101-
border-left: 3px solid #3498db;
113+
background: #F7FAFC;
114+
border-radius: var(--radius-md);
115+
border-left: 2px solid var(--color-border);
102116
}
103117

104118
.comment:last-child {
@@ -107,14 +121,14 @@
107121

108122
.commentText {
109123
font-size: 0.85rem;
110-
color: #2c3e50;
124+
color: var(--mongodb-slate);
111125
margin-bottom: 0.25rem;
112126
line-height: 1.4;
113127
}
114128

115129
.commentMeta {
116130
font-size: 0.75rem;
117-
color: #7f8c8d;
131+
color: var(--color-text-muted);
118132
font-style: italic;
119133
}
120134

0 commit comments

Comments
 (0)