Skip to content

Preparation for test migration - done tests compatible with tests and root location#1487

Open
jscotka wants to merge 5 commits into
rhinstaller:mainfrom
jscotka:test_migration_simplier
Open

Preparation for test migration - done tests compatible with tests and root location#1487
jscotka wants to merge 5 commits into
rhinstaller:mainfrom
jscotka:test_migration_simplier

Conversation

@jscotka
Copy link
Copy Markdown

@jscotka jscotka commented Aug 12, 2025

Add tests/ Directory Structure with Smart Migration Tool

🎯 Overview

Introduces organized test structure with tests/ subdirectory while maintaining full backward compatibility. Includes intelligent migration script with shared dependency analysis.

🚀 Key Features

1. Enhanced Test Discovery

  • Dual-location search: Automatically finds tests in both root directory and tests/ subdirectory
  • Zero breaking changes: All existing tests continue to work unchanged
  • Backward compatible: ./containers/runner/launch works seamlessly with both locations

2. Smart Migration Script (scripts/migrate-test.sh)

  • Shared dependency detection: Prevents breaking tests during migration
  • Interactive strategies: 4 migration options for handling dependencies
  • Batch operations: Migrate related tests together safely
  • Analysis tools: Repository-wide dependency overview

3. Migration Safety

# Before: Risky migration could break other tests
scripts/migrate-test.sh keyboard  # Could break 4 other keyboard tests

# After: Intelligent handling
scripts/migrate-test.sh keyboard-convert-vc
# ⚠️ Shared dependency detected: post-lib-keyboard.sh
# Options:
#   1) Move all tests that use this dependency together
#   2) Copy dependency (keep original for other tests)
#   3) Skip dependency / 4) Cancel migration

📊 Current Status

  • Root directory: 321 tests (preserved, working)
  • Tests directory: 2 tests (migrated examples)
  • Dependency analysis: 7/8 dependencies are shared across multiple tests
  • Migration readiness: ~200+ tests ready for immediate safe migration

Verification

# ✅ Legacy tests work (backward compatibility)
./containers/runner/launch lang --dry-run

# ✅ Migrated tests work (new structure)
./containers/runner/launch keyboard --dry-run

# ✅ Analysis tools work
scripts/migrate-test.sh --analyze-dependencies
scripts/migrate-test.sh --check-test testname

🔧 Usage

# List available tests for migration
scripts/migrate-test.sh --list-root

# Analyze dependencies before migration
scripts/migrate-test.sh --check-test hostname

# Safe migration with dependency handling
scripts/migrate-test.sh hostname nfs basic-ftp

🎯 Benefits

  • Better organization: Clean test structure for growing test suite
  • Zero disruption: Complete backward compatibility maintained
  • Safe migration: Intelligent dependency handling prevents test breakage
  • Gradual adoption: Teams can migrate tests at their own pace
  • Future-ready: Foundation for test categorization and better organization

Ready for production use - enables safe, incremental test organization improvement! 🎉

Copy link
Copy Markdown

@github-advanced-security github-advanced-security AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ShellCheck found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants