Files
hakorune/tools/smokes/v2/configs/matrix.conf
Selfhosting Dev 73b90a7c28 feat: スモークテストv2実装&Phase 15.5後のプラグイン対応
Phase 15.5 Core Box削除後の新テストシステム構築:

## 実装内容
- スモークテストv2システム完全実装(3段階プロファイル)
- 共通ライブラリ(test_runner/plugin_manager/result_checker/preflight)
- インタープリター層完全削除(約350行)
- PyVM重要インフラ特化保持戦略(JSON v0ブリッジ専用)
- nyash.tomlパス修正(13箇所、プラグイン正常ロード確認)

## 動作確認済み
- 基本算術演算(+, -, *, /)
- 制御構文(if, loop, break, continue)
- 変数代入とスコープ
- プラグインロード(20個の.soファイル)

## 既知の問題
- StringBox/IntegerBoxメソッドが動作しない
  - オブジェクト生成は成功するがメソッド呼び出しでエラー
  - Phase 15.5影響でプラグイン実装が不完全な可能性

## ドキュメント
- docs/development/testing/smoke-tests-v2.md 作成
- docs/reference/pyvm-usage-guidelines.md 作成
- CODEX_QUESTION.md(Codex相談用)作成

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-24 09:30:42 +09:00

231 lines
6.6 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# matrix.conf - マトリックステスト定義
# 全組み合わせテストfull プロファイル用)
# マトリックス軸定義
declare -a MATRIX_BACKENDS=("vm" "llvm")
declare -a MATRIX_PLUGIN_MODES=("dynamic" "static")
declare -a MATRIX_OPTIMIZATION_LEVELS=("debug" "release")
declare -a MATRIX_USING_MODES=("enabled" "disabled")
# 除外組み合わせ(実行不可能な組み合わせ)
MATRIX_EXCLUSIONS=(
"vm:static" # VMバックエンドは静的プラグイン非対応
"llvm:dynamic:debug" # LLVM+動的プラグインのデバッグモードは不安定
)
# 組み合わせ生成
generate_matrix_combinations() {
local combinations=()
for backend in "${MATRIX_BACKENDS[@]}"; do
for plugin_mode in "${MATRIX_PLUGIN_MODES[@]}"; do
for opt_level in "${MATRIX_OPTIMIZATION_LEVELS[@]}"; do
for using_mode in "${MATRIX_USING_MODES[@]}"; do
local combo="${backend}:${plugin_mode}:${opt_level}:${using_mode}"
# 除外チェック
local excluded=false
for exclusion in "${MATRIX_EXCLUSIONS[@]}"; do
if echo "$combo" | grep -q "^$exclusion"; then
excluded=true
break
fi
done
if [ "$excluded" = false ]; then
combinations+=("$combo")
fi
done
done
done
done
printf '%s\n' "${combinations[@]}"
}
# 環境設定適用
apply_matrix_config() {
local combination="$1"
IFS=':' read -ra PARTS <<< "$combination"
local backend="${PARTS[0]}"
local plugin_mode="${PARTS[1]}"
local opt_level="${PARTS[2]}"
local using_mode="${PARTS[3]}"
echo "[INFO] Applying matrix config: $combination" >&2
# バックエンド設定
case "$backend" in
"vm")
export NYASH_BACKEND=""
;;
"llvm")
export NYASH_BACKEND="llvm"
export NYASH_LLVM_USE_HARNESS=1
;;
esac
# プラグインモード設定
case "$plugin_mode" in
"dynamic")
export NYASH_DISABLE_PLUGINS=0
export SMOKES_PLUGIN_MODE="dynamic"
;;
"static")
export NYASH_DISABLE_PLUGINS=1
export SMOKES_PLUGIN_MODE="static"
;;
esac
# 最適化レベル設定
case "$opt_level" in
"debug")
export NYASH_CLI_VERBOSE=1
export NYASH_DEBUG_FUEL="unlimited"
export NYASH_OPTIMIZATION_LEVEL=0
;;
"release")
export NYASH_CLI_VERBOSE=0
export NYASH_DEBUG_FUEL="10000"
export NYASH_OPTIMIZATION_LEVEL=3
;;
esac
# using system設定
case "$using_mode" in
"enabled")
export NYASH_ENABLE_USING=1
export NYASH_RESOLVE_FIX_BRACES=1
;;
"disabled")
export NYASH_ENABLE_USING=0
export NYASH_RESOLVE_FIX_BRACES=0
;;
esac
# マトリックス用調整
export SMOKES_MATRIX_MODE=1
export SMOKES_CURRENT_COMBINATION="$combination"
export SMOKES_DEFAULT_TIMEOUT=90 # マトリックステストは時間がかかる
}
# マトリックステスト実行
run_matrix_test() {
local test_script="$1"
local combination="$2"
echo "[INFO] Running matrix test: $test_script with $combination" >&2
# 組み合わせ適用
apply_matrix_config "$combination"
# テストスクリプト実行
local start_time end_time duration exit_code
start_time=$(date +%s.%N)
if timeout "${SMOKES_DEFAULT_TIMEOUT:-90}" bash "$test_script"; then
exit_code=0
else
exit_code=$?
fi
end_time=$(date +%s.%N)
duration=$(echo "$end_time - $start_time" | bc -l)
# 結果記録
echo "[RESULT] $test_script:$combination:$exit_code:${duration}s" >&2
return $exit_code
}
# 全マトリックステスト実行
run_all_matrix_tests() {
local test_pattern="${1:-*.sh}"
local results_file="${2:-matrix_results.txt}"
echo "[INFO] Starting matrix testing with pattern: $test_pattern" >&2
local combinations
mapfile -t combinations < <(generate_matrix_combinations)
local total_tests=0
local passed_tests=0
local failed_tests=0
# 結果ファイル初期化
echo "# Matrix Test Results - $(date)" > "$results_file"
echo "# Format: test_script:combination:exit_code:duration" >> "$results_file"
# テストスクリプト検索
local test_scripts
mapfile -t test_scripts < <(find profiles/full/matrix -name "$test_pattern" -type f)
for script in "${test_scripts[@]}"; do
for combination in "${combinations[@]}"; do
((total_tests++))
echo "[INFO] [$total_tests] Testing $script with $combination" >&2
if run_matrix_test "$script" "$combination"; then
((passed_tests++))
echo "PASS:$script:$combination:$(date)" >> "$results_file"
else
((failed_tests++))
echo "FAIL:$script:$combination:$(date)" >> "$results_file"
fi
done
done
# サマリー出力
cat << EOF
===============================================
Matrix Test Summary
===============================================
Total combinations: ${#combinations[@]}
Total tests: $total_tests
Passed: $passed_tests
Failed: $failed_tests
Success rate: $(echo "scale=1; $passed_tests * 100 / $total_tests" | bc -l)%
Results saved to: $results_file
===============================================
EOF
[ $failed_tests -eq 0 ]
}
# マトリックス情報表示
show_matrix_info() {
echo "Available Matrix Combinations:"
echo "=============================="
local combinations
mapfile -t combinations < <(generate_matrix_combinations)
local count=1
for combo in "${combinations[@]}"; do
printf "%2d. %s\n" $count "$combo"
((count++))
done
echo ""
echo "Total combinations: ${#combinations[@]}"
echo ""
echo "Matrix Axes:"
echo " Backends: ${MATRIX_BACKENDS[*]}"
echo " Plugin Modes: ${MATRIX_PLUGIN_MODES[*]}"
echo " Optimization: ${MATRIX_OPTIMIZATION_LEVELS[*]}"
echo " Using System: ${MATRIX_USING_MODES[*]}"
echo ""
echo "Exclusions:"
for exclusion in "${MATRIX_EXCLUSIONS[@]}"; do
echo " - $exclusion"
done
}
# 使用例
# source configs/matrix.conf
# show_matrix_info
# run_all_matrix_tests "*.sh" "results.txt"