Skip to main content
Glama

DollhouseMCP

by DollhouseMCP
EXTENDED_NODE_TEST_PREVENTION_STRATEGY.md4.81 kB
# Extended Node Test Failure Prevention Strategy ## Problem Statement Extended Node Compatibility tests repeatedly fail when merging to develop because: 1. These tests only run on develop/main branches (not feature branches) 2. We have duplicate test files testing the same configuration values 3. Developers update one test file but miss the other 4. No local validation before push ## Root Causes ### 1. Duplicate Test Files - `test/__tests__/config/IndexConfig.test.ts` (Extended Node) - `test/unit/IndexConfig.test.ts` (Regular tests) Both test the same configuration values but are maintained separately. ### 2. CI Pipeline Gaps - Extended Node tests don't run on feature branches - Developers can't catch these failures before merging - First failure visibility is AFTER merge to develop ### 3. Configuration Drift - Config values changed in code - Test expectations updated in one file - Other test file forgotten ## Prevention Strategy ### Immediate Actions #### 1. Consolidate Configuration Tests - [ ] Identify all duplicate test files - [ ] Create shared test utilities for config validation - [ ] Use single source of truth for expected values #### 2. Enable Extended Node Tests on Feature Branches Option A: Run on all branches (expensive) ```yaml on: push: branches: ['**'] # Run on all branches ``` Option B: Run on PR to develop (recommended) ```yaml on: pull_request: branches: [develop] types: [opened, synchronize] ``` #### 3. Add Pre-Merge Validation Script Create `scripts/pre-merge-check.sh`: ```bash #!/bin/bash # Run both test suites locally before pushing npm test -- test/__tests__/config/ npm test -- test/unit/ # Check for config/test mismatches node scripts/validate-config-tests.js ``` #### 4. Configuration Test Validator Create `scripts/validate-config-tests.js`: ```javascript // Compare expected values across all test files // Alert if mismatches found // Prevent merge if values don't align ``` ### Long-term Solutions #### 1. Single Configuration Test Suite - Merge all config tests into one location - Remove duplicate test files - Use data-driven tests with single source of truth #### 2. Configuration Constants File Create `test/constants/expectedConfigValues.ts`: ```typescript export const EXPECTED_CONFIG = { performance: { defaultSimilarityThreshold: 0.3, defaultSimilarLimit: 5, // ... all other values } }; ``` Use in ALL test files: ```typescript import { EXPECTED_CONFIG } from '../constants/expectedConfigValues'; expect(config.performance.defaultSimilarityThreshold) .toBe(EXPECTED_CONFIG.performance.defaultSimilarityThreshold); ``` #### 3. GitHub Actions Matrix Strategy Run Extended Node tests on feature branches with conditions: - If files in `src/portfolio/config/` changed - If files in `test/**/*config*` changed - If PR targets develop branch #### 4. Local Git Hooks `.githooks/pre-push`: ```bash #!/bin/bash # Check if pushing to develop if [[ "$2" =~ develop$ ]]; then echo "Running Extended Node compatibility check..." npm run test:extended-node fi ``` ## Implementation Priority ### Phase 1: Immediate Fix (This PR) 1. ✅ Fix current test expectation mismatches 2. ✅ Document the issue and prevention strategy 3. Add local validation script ### Phase 2: Short-term (Next Sprint) 1. Create configuration constants file 2. Update all test files to use constants 3. Add PR checks for Extended Node tests ### Phase 3: Long-term (Next Month) 1. Consolidate duplicate test suites 2. Implement full CI matrix strategy 3. Add automated config/test validation ## Validation Checklist Before merging to develop, ensure: - [ ] All config values match between code and tests - [ ] Both test suites pass locally - [ ] No duplicate test files with different expectations - [ ] Configuration changes documented - [ ] Test expectations updated in ALL locations ## Commands for Validation ```bash # Check all config-related tests find test -name "*[Cc]onfig*.test.ts" -exec grep -H "defaultSimilarity" {} \; # Run both test suites npm test -- test/__tests__/config/ npm test -- test/unit/ # Check actual config values grep -r "defaultSimilarity" src/portfolio/config/ # Verify alignment npm run validate:config-tests # (to be implemented) ``` ## Monitoring Track Extended Node test failures: - Create GitHub Issue template for tracking - Weekly review of failure patterns - Quarterly assessment of prevention effectiveness ## Success Metrics - Zero Extended Node failures due to test mismatches - All config changes caught before merge - Reduced developer friction - Faster CI/CD pipeline --- *Created: 2025-09-27* *Issue: Extended Node Compatibility repeatedly fails on develop merge* *Solution: Multi-phase prevention strategy with immediate fixes and long-term improvements*

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/DollhouseMCP/DollhouseMCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server