Skip to content

feat(tests): Comprehensive test suite optimization and integration te… #3

feat(tests): Comprehensive test suite optimization and integration te…

feat(tests): Comprehensive test suite optimization and integration te… #3

name: Test Shared Context
on:
push:
paths:
- 'src/core/context/**'
- 'src/core/session/**'
- 'src/cli/**'
- '.github/workflows/test-shared-context.yml'
pull_request:
paths:
- 'src/core/context/**'
- 'src/core/session/**'
- 'src/cli/**'
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build project
run: npm run build
- name: Run shared context tests
run: npm run test:shared-context
env:
CI: true
- name: Run all tests
run: npm run test:run
env:
CI: true
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results-${{ matrix.node-version }}
path: |
coverage/
test-results/
integration:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build project
run: npm run build
- name: Test CLI integration
run: |
# Initialize test project
mkdir -p /tmp/test-project
cd /tmp/test-project
npx stackmemory init
# Test status command with shared context
npx stackmemory status
# Create test frames and sync
echo "Testing shared context..." | npx stackmemory context push "Test Frame" --type task
npx stackmemory context add decision "Use shared context for cross-session reference"
# Verify context persistence
npx stackmemory status --project
- name: Verify shared context files
run: |
# Check if shared context directory exists
if [ -d "$HOME/.stackmemory/shared-context" ]; then
echo "✅ Shared context directory exists"
ls -la "$HOME/.stackmemory/shared-context/"
else
echo "❌ Shared context directory not found"
exit 1
fi