Skip to content

Collapse built-in phonemizer smoke tests from 18 cases to 6 - #2399

Open
KakaruHayate wants to merge 1 commit into
openutau:masterfrom
KakaruHayate:refactor/phonemizer-smoke-tests
Open

Collapse built-in phonemizer smoke tests from 18 cases to 6#2399
KakaruHayate wants to merge 1 commit into
openutau:masterfrom
KakaruHayate:refactor/phonemizer-smoke-tests

Conversation

@KakaruHayate

@KakaruHayate KakaruHayate commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

OpenUtau.Test/Plugins/PhonemizerTest.cs declares its three smoke checks on an abstract generic base class and derives six empty classes from it. xunit re-runs inherited facts for every concrete class, so CreationTest, SetSingerTest and DummySingerPhonemizeTest are each executed six times — 18 test cases where 6 suffice.

This collapses them into one parameterized test with a single case per built-in phonemizer, keeping identical coverage:

  1. the phonemizer is constructible
  2. SetSinger tolerates a missing singer and a null singer
  3. a dummy note is phonemized with a dummy singer without throwing

The state sequence is unchanged (construct → SetSinger(CreateMissing)SetSinger(null)SetSinger(dummy)Process), so the three checks are merged into one method body rather than rewritten.

Verification

dotnet test in pr-test:

master (7ef99328) this PR
Total 428 416
Passed 427 415
Skipped 1 1
Failed 0 0

Exactly 12 fewer test cases, green on all three platforms. Locally the --list-tests diff is only the 18 removed entries plus the 6 added PhonemizerTest.SmokeTest rows (236 → 224 entries).

No production code is touched. Happy to keep three separate assertions per phonemizer instead if per-behaviour granularity in the test report is preferred.

`PhonemizerTest<T>` declared `CreationTest`, `SetSingerTest` and
`DummySingerPhonemizeTest` on an abstract generic base class, and six empty
classes derived from it. xunit re-runs inherited facts for every concrete
class, so those three checks were actually executed 3 x 6 = 18 times.

The three checks are combined into one parameterized test with a single case
per phonemizer, keeping the same coverage:

* constructible
* tolerates a missing singer and a null singer
* phonemizes a dummy note with a dummy singer

12 fewer test cases run (each built-in phonemizer now contributes one case
instead of three), and the redundant instantiation of every phonemizer is
gone. No production code is touched.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants