piper-plus テスト実行
各言語ランタイムのテストを CI と同じ条件でローカル実行します。
変更ファイル
!git diff --name-only HEAD 2>/dev/null | head -20
ターゲット選択
$ARGUMENTS:
python→ Python 全体rust→ Rust workspacecs→ .NET solutiongo→ Go modulejs→ JS/WASM (npm-package)cpp→ C++ (cmake build + ctest)all→ 上記すべて (順次、失敗しても次に進む)- (空) →
git diff HEADの結果から判定 (複数該当ならそれら全部)
各ターゲットの実行コマンド
Python
cd src/python_run
uv run pytest tests/ -o addopts="" -v --tb=short
cd ../..
# G2P 単体テスト (もし対象なら)
cd src/python/g2p
uv run pytest -o addopts="" -v --tb=short
cd ../../..
注意:
- pytest.ini の
--covを-o addopts=""で上書き (pytest-cov が無い環境向け) - 学習・ベンチマーク系テストは除外 (
-m "unit and not training and not benchmark"も可)
Rust
cd src/rust
cargo test -p piper-plus --no-fail-fast
cargo test -p piper-plus --features naist-jdic --no-fail-fast
cd ../..
C# (.NET)
dotnet test src/csharp/PiperPlus.sln -c Release --nologo --verbosity minimal
Go
cd src/go
go vet ./... ./phonemize/...
go test -race -count=1 ./... ./phonemize/...
cd ../..
JavaScript / WASM
cd src/wasm/openjtalk-web
npm run test:npm-package:all
cd ../../..
C++
# Build がまだなら先にビルド
if [ ! -f build/CMakeCache.txt ]; then
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=ON
fi
cmake --build build --config Release
ctest --test-dir build -C Release --output-on-failure
結果報告
各ターゲット完了後、以下の形式で報告:
## テスト実行結果
| ランタイム | Pass | Fail | Skip | 時間 |
|----------|------|------|------|------|
| Python (pytest) | 212 | 0 | 20 | 22s |
| Rust (cargo test) | 145 | 0 | 0 | 1m |
| ... | ... | ... | ... | ... |
### 失敗詳細
(失敗があった場合のみ、最初の 3 件まで)
- `test_xxx` (ファイル:行): エラー要約
失敗時のヒント
- Python ImportError →
uv syncで依存をインストール - Rust feature not found →
cargo buildで先にビルドを通す - C# build failed →
dotnet restore src/csharp/PiperPlus.slnを実行 - WASM ImportError →
cd src/wasm/openjtalk-web && npm install - C++ ctest failed →
cmake --build build --verboseでビルドエラーを再確認
注意
- 失敗しても他のターゲットを続行する (
all時) - 単一ターゲット時は失敗即停止
- 環境依存テスト (espeak-ng 等) はスキップされる場合あり