Repository navigation
Adding a test target — proposal and a draft ready to go #2006
Closed
new-usemame
started this conversation in
Discussions
Replies: 3 comments
|
Branch is up: #2007 (draft). Verified locally — 23 iOS + 1 tvOS smoke. Happy to restructure if any of the options I listed (split iOS/tvOS, drop the seeded tests, or anything else) reads better for review. |
0 replies
|
Marked #2007 as ready for review. CI is currently blocked on the first-time-contributor approval gate — once a maintainer kicks the workflows off and they go green, the diff is good to land or restructure as you'd prefer. |
0 replies
|
Please see Jellyfin's AI Policy. jellyfin.org/docs/general/contributing/llm-policies |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
There is currently no test target in
Swiftfin.xcodeproj—xcodebuild testis a no-op because no*Testsbundle exists. I'd like to change that.Proposal
Add two unit-test bundles, one per host app:
SwiftfinTests(host:Swiftfin iOS)SwiftfinTVOSTests(host:Swiftfin tvOS)Both wired into the matching shared schemes so
xcodebuild test -scheme "Swiftfin"and-scheme "Swiftfin tvOS"each run their suites locally and in CI.Why now
Without a test target, every behavior change has to ship as a changes-only PR. That makes regressions in pure-logic code (formatters, parsers, model adapters) expensive to catch — they only surface when a user files an issue. Seeding the test target is the prerequisite for landing fixes with the unit tests that prove they're fixes, not just edits.
What's in the draft
I have a branch ready (
new-usemame:chore/add-test-target) that:Scripts/add_test_target.rb(uses thexcodeprojruby gem; safe to re-run).Swiftfin.xcschemeandSwiftfin tvOS.xcscheme(build-for-testing entries +TestActiontestable references).Shared/Extensions/:FixedWidthInteger.timeLabel— playback-position formatter (1h boundary, >24h durations, zero-padding rules)RuntimeFormatStyle—Duration → Stringformat selector (>= 3600sswitch betweenMM:SSandH:MM:SS)Duration.ticks(_:)— Jellyfin's 100-nanosecond tick decoder, used everywhere runtime is decoded from the serverString.trimmingSuffix(_:)— display-name normalization (exact-match, no-match, longer-than-input, partial-trail, empty suffix)SwiftfinTVOSTestsso the bundle proves out; tvOS-specific tests can land alongside whatever tvOS work follows.Verified locally:
Diff is ~830 lines, most of which is
project.pbxprojboilerplate for the new targets. The behavior change is zero — no production code is touched, and none of the seeded tests assert anything that current code doesn't already do.What I need from a maintainer
A thumbs-up to open the PR. If you'd rather have iOS and tvOS targets split into two PRs, or want me to drop the seeded tests and ship a pure-scaffold PR first, say the word and I'll restructure. Branch is sitting on my fork ready to push.
All reactions