[tt-update] Update .gitignore with AI-generated and test artifacts pa… #11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: TaskTracker Tests | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| security_test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: '16' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run security tests | |
| run: node tests/run-tests.js security | |
| json_parsing_test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: '16' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Test JSON parsing error handling | |
| run: | | |
| # Create test script | |
| echo " | |
| /** | |
| * Simple JSON Parsing Test | |
| */ | |
| const { safeJsonParse } = require('./lib/utils/security-middleware'); | |
| const { formatJsonResult } = require('./lib/utils/structured-output'); | |
| let allTestsPassed = true; | |
| let testsRun = 0; | |
| function runTest(name, testFn) { | |
| testsRun++; | |
| console.log(\`\n=== Testing \${name} ===\`); | |
| try { | |
| const passed = testFn(); | |
| console.log(\`Test passed: \${passed}\`); | |
| if (!passed) allTestsPassed = false; | |
| return passed; | |
| } catch (error) { | |
| console.error(\`Test failed: \${error.message}\`); | |
| allTestsPassed = false; | |
| return false; | |
| } | |
| } | |
| // Test valid JSON | |
| runTest('Valid JSON', () => { | |
| const validJson = '{\"name\":\"test\",\"value\":42}'; | |
| const validResult = safeJsonParse(validJson); | |
| return validResult.name === 'test' && validResult.value === 42; | |
| }); | |
| // Test empty string | |
| runTest('Empty String', () => { | |
| const emptyResult = safeJsonParse('', { default: true }); | |
| return emptyResult.default === true; | |
| }); | |
| // Test malformed JSON | |
| runTest('Malformed JSON', () => { | |
| const malformedJson = '{name: \"test\"}'; | |
| const malformedResult = safeJsonParse(malformedJson, { default: true }); | |
| return malformedResult.default === true; | |
| }); | |
| // Test non-string input | |
| runTest('Non-String Input', () => { | |
| const nullResult = safeJsonParse(null, { default: true }); | |
| return nullResult.default === true; | |
| }); | |
| // Test circular references | |
| runTest('Circular References', () => { | |
| const obj = { name: 'circular' }; | |
| obj.self = obj; // Create circular reference | |
| const circularResult = formatJsonResult(obj); | |
| return circularResult.success === true && | |
| circularResult.data.name === 'circular' && | |
| typeof circularResult.data.self === 'string'; | |
| }); | |
| console.log(\`\n=== Testing Complete ===\`); | |
| console.log(\`\${testsRun} tests run, all tests passed: \${allTestsPassed}\`); | |
| process.exit(allTestsPassed ? 0 : 1); | |
| " > json-parsing-test.js | |
| # Run the test | |
| node json-parsing-test.js | |
| unit_test: | |
| runs-on: ubuntu-latest | |
| needs: [security_test, json_parsing_test] | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: '16' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run unit tests | |
| run: node tests/run-tests.js unit | |
| integration_test: | |
| runs-on: ubuntu-latest | |
| needs: unit_test | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: '16' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run integration tests | |
| run: node tests/run-tests.js integration | |
| performance_test: | |
| runs-on: ubuntu-latest | |
| needs: integration_test | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: '16' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run performance tests | |
| run: node tests/run-tests.js performance | |
| documentation_check: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Check documentation structure | |
| run: | | |
| # Verify main documentation files exist | |
| for dir in docs/user-guides docs/dev-reference docs/ai-integration; do | |
| if [ ! -f "$dir/README.md" ]; then | |
| echo "Missing README.md in $dir" | |
| exit 1 | |
| fi | |
| done | |
| # Verify architecture documentation exists | |
| if [ ! -f "docs/dev-docs/ARCHITECTURE.md" ]; then | |
| echo "Missing architecture documentation" | |
| exit 1 | |
| fi | |
| # Verify CLI reference exists | |
| if [ ! -f "docs/dev-reference/cli-reference.md" ]; then | |
| echo "Missing CLI reference documentation" | |
| exit 1 | |
| fi | |
| echo "✅ Documentation structure verified" | |
| template_check: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Check for templates | |
| run: | | |
| # Ensure Claude templates exist | |
| if [ ! -d "docs/dev-docs/claude-templates" ]; then | |
| echo "Claude templates directory not found" | |
| exit 1 | |
| fi | |
| # Check for required template files | |
| required_templates=("daily-update.txt" "task-create.txt" "pr-prepare.txt") | |
| for template in "${required_templates[@]}"; do | |
| if [ ! -f "docs/dev-docs/claude-templates/$template" ]; then | |
| echo "Template file $template not found" | |
| exit 1 | |
| fi | |
| done | |
| echo "✅ All required templates found" | |
| structure_check: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Verify repository structure | |
| run: | | |
| # Check for core lib structure | |
| for dir in lib/core lib/commands; do | |
| if [ ! -d "$dir" ]; then | |
| echo "Missing directory: $dir" | |
| exit 1 | |
| fi | |
| done | |
| # Check for command registry | |
| if [ ! -f "lib/commands/index.js" ]; then | |
| echo "Missing command registry" | |
| exit 1 | |
| fi | |
| # Check for core modules | |
| core_modules=("task-manager.js" "config-manager.js" "formatting.js" "cli-parser.js") | |
| for module in "${core_modules[@]}"; do | |
| if [ ! -f "lib/core/$module" ]; then | |
| echo "Missing core module: $module" | |
| exit 1 | |
| fi | |
| done | |
| # Verify monolithic script is gone | |
| if [ -f "lib/core/tasktracker.js" ]; then | |
| echo "Error: Monolithic script still exists" | |
| exit 1 | |
| fi | |
| echo "✅ Repository structure verified" |