// Comprehensive test management system for running tests, tracking results, and maintaining test documentation. Runs test files, parses results, creates test reports, maintains test index, and integrates with docs-manager to link tests to documentation. Use when running tests, checking test coverage, creating test documentation, or verifying test results.
| name | test-manager |
| description | Comprehensive test management system for running tests, tracking results, and maintaining test documentation. Runs test files, parses results, creates test reports, maintains test index, and integrates with docs-manager to link tests to documentation. Use when running tests, checking test coverage, creating test documentation, or verifying test results. |
| allowed-tools | Read, Write, Glob, Bash |
Professional test management system for Weavink test suites with automatic documentation integration.
tests/ or user-specified directory/home/leo/Syncthing/Code-Weavink/test-index.json/home/leo/Syncthing/Code-Weavink/test-reports/RGPD Tests (116 total tests):
runConsentTests.mjs - Consent management (8 tests)runConsentCategoryTests.mjs - Consent categories (12 tests)runPrivacySettingsTests.mjs - Privacy settings (8 tests)runAnalyticsConsentIntegrationTests.mjs - Analytics consent (12 tests)runDataExportTests.mjs - Data export (8 tests)runAccountDeletionTests.mjs - Account deletion (8 tests)runPhase3Tests.mjs - Phase 3 advanced (38 tests)runPhase4Tests.mjs - Phase 4 enterprise (22 tests)runAllRGPDTests.mjs - Runs all RGPD testsOther Tests:
queryEnhancement.comprehensive.test.js - Query enhancement testsTriggers:
Process:
Identify Test File
Prepare Test Environment
# Navigate to project root
cd ~/temp2/temp2
# Check if node_modules exists
if [ ! -d "node_modules" ]; then
npm install
fi
Execute Test File
# For .mjs files
node -r dotenv/config runConsentCategoryTests.mjs
# For .js files
node tests/queryEnhancement.comprehensive.test.js
# Capture output
node -r dotenv/config runConsentCategoryTests.mjs > test-output.log 2>&1
Parse Test Output Extract:
Update Test Index Add/update entry in test-index.json:
{
"testId": "rgpd-consent-category-001",
"testFile": "runConsentCategoryTests.mjs",
"testSuite": "RGPD Consent Categories",
"totalTests": 12,
"passed": 12,
"failed": 0,
"successRate": "100%",
"duration": "2.5s",
"lastRun": "2025-11-11T14:30:00Z",
"status": "passing",
"relatedDocs": [
"documentation/rgpd/CONSENT_IMPLEMENTATION_GUIDE.md",
"documentation/rgpd/RGPD_TESTING_GUIDE.md"
],
"relatedFunctions": [
"recordConsent",
"getUserConsents",
"hasConsent"
],
"coverage": {
"files": ["lib/services/servicePrivacy/consentService.js"],
"percentage": 95
}
}
Generate Test Report (optional) Create markdown report:
# Test Report: RGPD Consent Categories
**Date**: 2025-11-11
**Status**: โ
PASSING
**Success Rate**: 100% (12/12)
**Duration**: 2.5s
## Summary
All consent category tests passed successfully.
## Test Results
1. โ
Test Essential Category - PASSED
2. โ
Test AI Features Category - PASSED
...
Integrate with docs-manager
// Pass test metadata to docs-manager
{
action: "link_tests_to_docs",
testId: "rgpd-consent-category-001",
relatedDocs: ["documentation/rgpd/CONSENT_IMPLEMENTATION_GUIDE.md"],
testResults: {
passed: 12,
failed: 0,
coverage: "95%"
}
}
Report Results
โ
Test Suite: RGPD Consent Categories
Results:
- Total: 12 tests
- Passed: 12 โ
- Failed: 0
- Success Rate: 100%
- Duration: 2.5s
Related Documentation:
- documentation/rgpd/CONSENT_IMPLEMENTATION_GUIDE.md
- documentation/rgpd/RGPD_TESTING_GUIDE.md
Next steps:
1. Review test report
2. Update documentation (run docs-manager)
3. Commit changes (run git-manager)
Triggers:
Process:
Read Test Index
cat ~/temp2/temp2/test-index.json
Parse and Display
๐ Test Status Overview
Total Test Suites: 9
Overall Pass Rate: 100%
Last Run: 2025-11-11
Test Suites:
โ
RGPD Consent (8/8) - 100%
โ
RGPD Categories (12/12) - 100%
โ
RGPD Privacy Settings (8/8) - 100%
โ
Query Enhancement (45/45) - 100%
Coverage: 92% overall
Triggers:
Process:
Analyze Test File
Create Test Guide
---
id: test-rgpd-consent-category-001
title: RGPD Consent Category Tests
category: testing
tags: [rgpd, consent, testing, categories]
status: active
created: YYYY-MM-DD
updated: YYYY-MM-DD
related:
- documentation/rgpd/CONSENT_IMPLEMENTATION_GUIDE.md
- documentation/rgpd/RGPD_TESTING_GUIDE.md
testFile: runConsentCategoryTests.mjs
testResults:
passed: 12
failed: 0
successRate: 100%
---
# RGPD Consent Category Tests
## Overview
Test suite for validating consent category management...
Link to Documentation
Triggers:
Process:
Analyze Test Files
Generate Coverage Report
๐ Test Coverage Report
Overall Coverage: 92%
By Module:
- servicePrivacy: 95% (tested: 45/48 functions)
- analytics: 88% (tested: 22/25 functions)
- admin: 90% (tested: 36/40 functions)
Untested Functions:
- servicePrivacy.deprecatedFunction()
- analytics.legacyTracker()
Well-Tested Functions (>10 tests):
- recordConsent() - 12 tests
- getUserConsents() - 8 tests
After tests run successfully:
Prepare Integration Data
{
testId: "rgpd-consent-category-001",
testSuite: "RGPD Consent Categories",
results: {
passed: 12,
failed: 0,
duration: "2.5s"
},
testedFunctions: [
"recordConsent",
"getUserConsents",
"hasConsent",
"batchGrantConsents"
],
relatedDocs: [
"documentation/rgpd/CONSENT_IMPLEMENTATION_GUIDE.md",
"documentation/rgpd/RGPD_TESTING_GUIDE.md"
]
}
Call docs-manager
Pass test data to docs-manager with instruction:
"Update documentation/rgpd/CONSENT_IMPLEMENTATION_GUIDE.md to include test coverage:
- recordConsent: Tested โ
(12 tests)
- getUserConsents: Tested โ
(8 tests)
Test suite: runConsentCategoryTests.mjs (100% passing)"
Verify Integration
{
"metadata": {
"project": "Weavink Tests",
"lastUpdated": "2025-11-11",
"totalSuites": 9,
"totalTests": 161,
"overallPassRate": "100%"
},
"suites": [
{
"testId": "rgpd-consent-001",
"testFile": "runConsentTests.mjs",
"testSuite": "RGPD Consent Management",
"category": "rgpd",
"totalTests": 8,
"passed": 8,
"failed": 0,
"successRate": "100%",
"duration": "1.8s",
"lastRun": "2025-11-11T14:30:00Z",
"status": "passing",
"relatedDocs": [
"documentation/rgpd/CONSENT_IMPLEMENTATION_GUIDE.md",
"documentation/rgpd/RGPD_TESTING_GUIDE.md"
],
"testedFunctions": [
"recordConsent",
"withdrawConsent",
"getUserConsents",
"hasConsent",
"batchGrantConsents",
"getConsentHistory"
],
"coverage": {
"files": ["lib/services/servicePrivacy/consentService.js"],
"functions": 6,
"percentage": 95
},
"tests": [
{
"name": "Grant Individual Consent",
"status": "passed",
"duration": "120ms"
}
]
}
]
}
#!/bin/bash
# run-all-tests.sh
echo "๐งช Running All Weavink Tests"
echo "============================"
cd ~/temp2/temp2
# RGPD Tests
echo "\n๐ RGPD Tests..."
node -r dotenv/config runAllRGPDTests.mjs
# Query Enhancement Tests
echo "\n๐ Query Enhancement Tests..."
node tests/queryEnhancement.comprehensive.test.js
echo "\nโ
All tests complete!"
#!/bin/bash
# parse-test-output.sh
LOG_FILE=$1
PASSED=$(grep "Passed:" "$LOG_FILE" | awk '{print $2}')
FAILED=$(grep "Failed:" "$LOG_FILE" | awk '{print $2}')
TOTAL=$((PASSED + FAILED))
SUCCESS_RATE=$(echo "scale=2; $PASSED / $TOTAL * 100" | bc)
echo "{\"passed\": $PASSED, \"failed\": $FAILED, \"total\": $TOTAL, \"successRate\": \"${SUCCESS_RATE}%\"}"
CRITICAL: ALWAYS ASK BEFORE RUNNING TESTS IN PRODUCTION
Before running tests that might affect production data:
Safe to run without asking:
test- prefixed user IDsAfter successful test run:
// Data passed to docs-manager
{
source: "test-manager",
action: "update_test_coverage",
testSuite: "RGPD Consent Categories",
results: {
passed: 12,
failed: 0,
coverage: "95%"
},
relatedDocs: ["documentation/rgpd/CONSENT_IMPLEMENTATION_GUIDE.md"],
testedFunctions: ["recordConsent", "getUserConsents"],
request: "Update documentation with test coverage information"
}
After tests pass and docs updated:
// Data passed to git-manager
{
source: "test-manager",
action: "commit_test_results",
message: "โ
Tests: RGPD Consent Categories (12/12 passing)",
files: [
"test-index.json",
"test-reports/rgpd-consent-categories.md",
"documentation/rgpd/CONSENT_IMPLEMENTATION_GUIDE.md" // Updated by docs-manager
],
request: "Commit test results and updated documentation"
}
User: "Run the RGPD consent category tests"
test-manager:
1. โ
Runs: node -r dotenv/config runConsentCategoryTests.mjs
2. โ
Parses results: 12/12 passed
3. โ
Updates test-index.json
4. โ
Passes to docs-manager:
"Update documentation/rgpd/CONSENT_IMPLEMENTATION_GUIDE.md with test coverage"
docs-manager:
5. โ
Finds documentation/rgpd/CONSENT_IMPLEMENTATION_GUIDE.md
6. โ ๏ธ ASKS: "Add test coverage (12/12 passing) to guide? [Y/n]"
User: "Y"
docs-manager:
7. โ
Updates guide with test information
8. โ
Updates docs-index.json
9. โ
Passes to git-manager:
"Commit test results and docs"
git-manager:
10. โ ๏ธ ASKS: "Commit changes with message:
'โ
Tests: RGPD Consent (12/12) + Updated docs'
Files: test-index.json, documentation/rgpd/CONSENT_IMPLEMENTATION_GUIDE.md
Proceed? [Y/n]"
User: "Y"
git-manager:
11. โ
Creates commit
12. โ
Pushes changes
13. โ
Reports: "Committed and pushed!"
Complete: Tests run โ Docs updated โ Changes committed โ
User: "What's our test coverage?"
test-manager:
1. โ
Reads test-index.json
2. โ
Analyzes coverage data
3. โ
Reports:
๐ Test Coverage Report
Overall: 161 tests, 100% passing
By Category:
- RGPD (116 tests): 100% โ
- Query Enhancement (45 tests): 100% โ
Coverage by Module:
- servicePrivacy: 95%
- analytics: 88%
- admin: 90%
Untested Functions (5):
- deprecatedHelper()
- legacyValidator()
- oldProcessor()
- unusedFormatter()
- archiveUtil()
User: "Run all RGPD tests"
test-manager:
1. โ
Runs: node -r dotenv/config runAllRGPDTests.mjs
2. โ Parses results: 115/116 passed, 1 failed
3. โ Updates test-index.json with failure
4. โ Reports:
โ Test Suite Failed: RGPD All Tests
Results:
- Total: 116 tests
- Passed: 115 โ
- Failed: 1 โ
- Success Rate: 99.1%
Failed Test:
- Test 8: Account Deletion Grace Period
Error: Expected 30 days, got 29 days
โ NOT proceeding with documentation or commit
โ Tests must pass before updating docs
Action Required:
1. Fix the failing test
2. Re-run tests
3. Only after 100% pass โ update docs โ commit
if ! node -r dotenv/config runConsentTests.mjs; then
echo "โ Test execution failed"
echo "Check: Node modules installed?"
echo "Check: .env file present?"
echo "Check: Firebase credentials?"
exit 1
fi
try {
const results = parseTestOutput(output);
} catch (error) {
console.log("โ Could not parse test output");
console.log("Showing raw output:");
console.log(output);
}
# Backup before updating
cp test-index.json test-index.json.backup
# Validate JSON
if ! jq empty test-index.json 2>/dev/null; then
echo "โ test-index.json is invalid"
echo "Restoring from backup..."
mv test-index.json.backup test-index.json
fi
A well-maintained test system should have:
This skill manages Weavink's test suite with 161+ tests across 9 test suites, ensuring code quality and enabling automated documentation and version control integration.