Test Directory

This directory contains all testing frameworks, quality assurance tools, and automated validation systems for the IT-Journey project.

๐Ÿงช Testing Philosophy

The IT-Journey testing framework follows modern DevOps practices with emphasis on:

๐Ÿ“ Directory Structure

test/
โ”œโ”€โ”€ README.md                           # This comprehensive guide
โ”œโ”€โ”€ hyperlink-guardian/                 # Complete link health monitoring system
โ”‚   โ”œโ”€โ”€ scripts/                       # Core testing scripts
โ”‚   โ”‚   โ”œโ”€โ”€ guardian.sh               # Main link testing engine
โ”‚   โ”‚   โ”œโ”€โ”€ ai-analyzer.py            # AI-powered failure analysis
โ”‚   โ”‚   โ””โ”€โ”€ validate.sh               # Local validation and testing
โ”‚   โ”œโ”€โ”€ config/                       # Configuration files
โ”‚   โ”‚   โ”œโ”€โ”€ guardian-config.yml       # Main configuration
โ”‚   โ”‚   โ”œโ”€โ”€ exclusions.txt           # URL exclusion patterns
โ”‚   โ”‚   โ””โ”€โ”€ test-config.json         # Test environment settings
โ”‚   โ”œโ”€โ”€ templates/                    # Output and report templates
โ”‚   โ”‚   โ”œโ”€โ”€ issue-template.md         # GitHub issue template
โ”‚   โ”‚   โ””โ”€โ”€ report-template.html      # HTML report template
โ”‚   โ””โ”€โ”€ docs/                         # Testing documentation
โ”‚       โ”œโ”€โ”€ setup.md                  # Setup and configuration guide
โ”‚       โ”œโ”€โ”€ usage.md                  # Usage examples and patterns
โ”‚       โ””โ”€โ”€ troubleshooting.md        # Common issues and solutions
โ””โ”€โ”€ [future-test-frameworks]/          # Additional testing systems

The flagship testing system that provides comprehensive link health monitoring with AI-powered analysis.

Quick Start

# Run basic link health check
./test/hyperlink-guardian/scripts/guardian.sh

# Run with verbose output and custom settings
./test/hyperlink-guardian/scripts/guardian.sh --verbose --parallel 15

# Validate the system locally
./test/hyperlink-guardian/scripts/validate.sh

Key Features

Configuration

The system uses a layered configuration approach:

  1. Default Settings: Built into the scripts
  2. Configuration Files: YAML and JSON config files
  3. Environment Variables: Runtime overrides
  4. Command Line Arguments: Per-execution customization

๐Ÿš€ GitHub Actions Integration

The testing framework integrates seamlessly with GitHub Actions:

Workflow Location: .github/workflows/hyperlink-guardian.yml

Schedule: Daily at 3:00 AM UTC (configurable)

Triggers:

Outputs:

๐Ÿ“Š Output and Reporting

Test Results Structure

test-results/
โ”œโ”€โ”€ summary.json              # High-level statistics and metadata
โ”œโ”€โ”€ detailed-results.csv      # Complete test results with timestamps
โ”œโ”€โ”€ broken-links.json        # Categorized broken link analysis
โ”œโ”€โ”€ ai-analysis.json         # AI-generated insights and recommendations
โ”œโ”€โ”€ performance-metrics.json  # Execution timing and resource usage
โ””โ”€โ”€ artifacts/               # Supporting files and logs
    โ”œโ”€โ”€ raw-links.txt        # All discovered links
    โ”œโ”€โ”€ test-log.txt        # Execution log with debug info
    โ””โ”€โ”€ screenshots/         # Visual evidence (future enhancement)

AI Analysis Output

The AI analysis provides:

๐Ÿ› ๏ธ Development and Customization

Adding New Test Types

  1. Create a new subdirectory under test/
  2. Follow the established structure pattern
  3. Update this README with documentation
  4. Add GitHub Actions integration if needed

The system is designed for extensibility:

Custom Link Types: Add new URL patterns and validation rules Enhanced AI Analysis: Extend prompts and analysis categories
Additional Outputs: Create new report formats and destinations Integration Points: Connect with external monitoring systems

Local Development

# Set up development environment
cd test/hyperlink-guardian
./scripts/validate.sh --setup

# Run tests with development settings
./scripts/guardian.sh --config config/test-config.json --verbose

# Test AI analysis locally (requires OPENAI_API_KEY)
export OPENAI_API_KEY="your-key-here"
./scripts/ai-analyzer.py --input ./test-results --verbose

๐Ÿ“š Educational Value

The testing framework serves multiple educational purposes:

DevOps Learning

AI Integration

Software Engineering

๐Ÿ”ง Configuration Reference

Environment Variables

Variable Description Default Required
SITE_URL Target site URL for testing Auto-detected No
OPENAI_API_KEY OpenAI API key for AI analysis None For AI features
MAX_PARALLEL Maximum parallel link tests 10 No
TIMEOUT Request timeout in seconds 30 No
VERBOSE Enable verbose logging false No

Configuration Files

Guardian Config (config/guardian-config.yml):

site:
  url: "https://bamr87.github.io/it-journey"
  timeout: 30
  retry_count: 2

testing:
  max_parallel: 10
  exclude_patterns: 
    - "localhost"
    - "127.0.0.1"
  
ai_analysis:
  model: "gpt-4"
  max_tokens: 3000
  temperature: 0.3

๐Ÿšจ Troubleshooting

Common Issues

No Links Found: Check file patterns and exclusion rules Permission Denied: Ensure scripts are executable (chmod +x) AI Analysis Fails: Verify OPENAI_API_KEY is set correctly Timeout Errors: Increase timeout values for slow connections

Debug Mode

# Enable comprehensive debugging
export VERBOSE=true
export DEBUG=true
./test/hyperlink-guardian/scripts/guardian.sh --verbose

Getting Help

  1. Documentation: Check test/hyperlink-guardian/docs/ for detailed guides
  2. Issues: Report problems via GitHub Issues with the testing label
  3. Discussions: Join community discussions for questions and improvements
  4. Quest Guide: Follow the Hyperlink Guardian Quest

๐Ÿค Contributing

Testing improvements are always welcome:

Areas for Contribution

Development Guidelines

  1. Follow the established directory structure
  2. Include comprehensive documentation
  3. Add configuration examples
  4. Test across multiple platforms
  5. Consider educational value in design decisions

๐Ÿ“ˆ Future Roadmap

Planned Enhancements

Integration Opportunities


The test directory embodies the IT-Journey commitment to quality, education, and automation - ensuring that every learner has access to reliable, up-to-date educational resources while providing real-world examples of modern testing practices.