Skip to content

Commit b861da9

Browse files
authored
Merge pull request #30 from objectstack-ai/copilot/init-test-scripts-setup
2 parents fd10c85 + a9de990 commit b861da9

File tree

8 files changed

+1019
-1
lines changed

8 files changed

+1019
-1
lines changed
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: Test ObjectDocs Lifecycle
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
pull_request:
7+
branches: [ main, develop ]
8+
workflow_dispatch:
9+
10+
jobs:
11+
test-quick:
12+
name: Quick Build Test
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
19+
- name: Setup Node.js
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: '20'
23+
24+
- name: Setup pnpm
25+
uses: pnpm/action-setup@v4
26+
with:
27+
version: '10.x'
28+
29+
- name: Install dependencies
30+
run: pnpm install
31+
32+
- name: Run quick build test
33+
run: pnpm test:quick
34+
35+
- name: Upload test results
36+
if: always()
37+
uses: actions/upload-artifact@v4
38+
with:
39+
name: quick-test-results
40+
path: /tmp/objectdocs-*.log
41+
retention-days: 7
42+
if-no-files-found: ignore
43+
44+
test-full:
45+
name: Full Lifecycle Test
46+
runs-on: ubuntu-latest
47+
48+
steps:
49+
- name: Checkout repository
50+
uses: actions/checkout@v4
51+
52+
- name: Setup Node.js
53+
uses: actions/setup-node@v4
54+
with:
55+
node-version: '20'
56+
57+
- name: Setup pnpm
58+
uses: pnpm/action-setup@v4
59+
with:
60+
version: '10.x'
61+
62+
- name: Install dependencies
63+
run: pnpm install
64+
65+
- name: Run full lifecycle test
66+
run: pnpm test:site
67+
68+
- name: Upload server logs
69+
if: always()
70+
uses: actions/upload-artifact@v4
71+
with:
72+
name: full-test-results
73+
path: /tmp/objectdocs-*.log
74+
retention-days: 7
75+
if-no-files-found: ignore

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,9 @@ next-env.d.ts
3737
.next
3838

3939
# objectdocs
40-
content/.objectdocs
40+
content/.objectdocs
41+
42+
# test artifacts
43+
/tmp/objectdocs-test-*
44+
/tmp/dev-server.log
45+
/tmp/start-server.log

Makefile

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# ObjectDocs Development Tasks
2+
# Run with: make <target> or pnpm run <script>
3+
4+
.PHONY: help install dev build test test-quick test-full clean
5+
6+
# Default target
7+
help:
8+
@echo "ObjectDocs Development Tasks"
9+
@echo ""
10+
@echo "Available targets:"
11+
@echo " install - Install all dependencies"
12+
@echo " dev - Start development server"
13+
@echo " build - Build the site"
14+
@echo " test - Run all tests"
15+
@echo " test-quick - Run quick build test"
16+
@echo " test-full - Run full lifecycle test"
17+
@echo " clean - Clean build artifacts"
18+
@echo ""
19+
20+
install:
21+
pnpm install
22+
23+
dev:
24+
pnpm dev
25+
26+
build:
27+
pnpm build
28+
29+
test: test-quick test-full
30+
31+
test-quick:
32+
@echo "Running quick build test..."
33+
bash test-quick.sh
34+
35+
test-full:
36+
@echo "Running full lifecycle test..."
37+
bash test-site.sh
38+
39+
clean:
40+
rm -rf node_modules
41+
rm -rf .next
42+
rm -rf content/.objectdocs
43+
rm -rf packages/*/node_modules
44+
rm -rf examples/*/node_modules
45+
find . -name ".next" -type d -exec rm -rf {} + 2>/dev/null || true
46+
find . -name "*.tsbuildinfo" -delete 2>/dev/null || true

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,20 @@ This repository is a monorepo managed by pnpm workspaces:
198198

199199
- **[examples/starter](./examples/starter)**: A complete starter template demonstrating the recommended project structure. Includes comprehensive documentation on architecture, testing, and deployment guides. Ready for production use on Vercel and other platforms.
200200

201+
## 🧪 Testing
202+
203+
ObjectDocs includes comprehensive test scripts to validate the complete lifecycle:
204+
205+
```bash
206+
# Quick build test (recommended for CI)
207+
pnpm test:quick
208+
209+
# Full lifecycle test (includes server startup tests)
210+
pnpm test:site
211+
```
212+
213+
See [TESTING.md](./TESTING.md) for detailed testing documentation.
214+
201215
## 🤝 Contributing
202216

203217
Contributions are welcome! Please read our [Contributing Guide](./CONTRIBUTING.md) for details on our code of conduct and the process for submitting pull requests.

0 commit comments

Comments
 (0)