Skip to content

Conviva: add a test suite for the connector - #137

Open
ceyhun-o wants to merge 19 commits into
mainfrom
maintenance/conviva-tests
Open

ceyhun-o wants to merge 19 commits into
mainfrom
maintenance/conviva-tests

Conversation

@ceyhun-o

@ceyhun-o ceyhun-o commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds the first automated tests for the Conviva connector, in a new THEOplayerConnectorConvivaTests SwiftPM target with a shared scheme. The target is also added to the CI test loop.

The only production change is a test seam. ConvivaEndpoints gets an internal init(analytics: CISAnalytics), so tests can inject a recording fake that captures every call to the Conviva SDK. There is no public API change.

The test target depends on THEOplayerConnectorConviva (which brings THEOplayerSDK and ConvivaSDK), THEOplayerTHEOliveIntegration, THEOplayerTHEOadsIntegration and Google IMA (iOS only, which the OptiView Ads integration's module imports). Only the test target uses them, so SwiftPM consumers of the connector products don't fetch them.

The tests drive a real THEOplayer (most SDK events have no public init) and cover these areas:

  • Session lifecycle: start, end, restart while paused, a new source vs the same source, and metadata cleared or kept between sessions.
  • Player state: PLAYING, PAUSED, BUFFERING and STOPPED.
  • Errors: a fatal error fails the session once and resets it. A network error is reported as a warning and keeps the session. The network-error test uses https://cdn.theoplayer.com/video/elephants-dream/404/index.m3u8, where the 4th video segment returns HTTP 403.
  • Live and VOD detection: infinite vs finite duration, and a customer-provided isLive is not overwritten.
  • Encoding type: HLS and HESP on the public THEOlive demo channel, and a customer-provided value wins.
  • Bitrate: reported in kbps to the content endpoint, during ads to the ad endpoint, and again for a new session.
  • Ad breaks: pod index, position and serialization, ad events forwarded only during an ad break, failed ad breaks, and OptiView Ads interstitials (past/position).

Test synchronization

Waits are driven by player events where possible, the same approach as the player smoke tests:

  • The ENDED test waits for PLAYING on Elephants Dream before seeking to 2 s before the end, then waits for a real ENDED.
  • Ad-break and failed-ad-break tests wait for AD_BREAK_BEGIN / AD_BREAK_END (plus one main-queue hop for the connector's queued forwarding) instead of a fixed main-queue sentinel.
  • Bitrate tests trigger the SDK's active-quality-changed event with a known bandwidth (1_234_567 bps → 1234 kbps) instead of waiting for AVPlayer access logs; these use @_spi(Core) import THEOplayerSDK.
  • No timeouts were raised.

Results

The Conviva suite passed 32/32 in 20 consecutive GitHub CI runs (THEOplayer SDK 11.16.0, Xcode 26.3, iPhone 17 / iOS 26.5), and again on this PR's latest commit. cocoapods-validate passes.

build-and-test is still red because the Uplynk tests don't compile against SDK 11.16.0 (MockServerSideAdIntegrationController does not conform to CustomAdIntegrationController). This fails the same way on main and is not touched by this PR.

Known gap, not covered by a test: on HESP/THEOlive, Conviva.streamUrl stays "unknown". It is captured on SOURCE_CHANGE, and the later CURRENT_SOURCE_CHANGE only updates encoding_type.

Link to Devin session: https://dolby.devinenterprise.com/sessions/50c8aced921146a9b29941f29ac495cd
Open in Devin Desktop: https://dolby.devinenterprise.com/desktop/session/50c8aced921146a9b29941f29ac495cd?variant=devin
Requested by: @ceyhun-o

@devin-ai-integration

Copy link
Copy Markdown
Contributor

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration
devin-ai-integration Bot force-pushed the maintenance/conviva-tests branch from fde7b17 to f86a7b6 Compare November 19, 2026 10:23
@ceyhun-o
ceyhun-o requested a review from therama November 19, 2026 11:25
@ceyhun-o
ceyhun-o marked this pull request as ready for review November 19, 2026 11:25
Comment thread Package.swift
.testTarget(
name: "THEOplayerConnectorConvivaTests",
dependencies: [
"THEOplayerConnectorConviva",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Isn't adding THEOplayerConnectorConviva enough to also implicitly include THEOplayerSDK and ConvivaSDK?
Perhaps give it a try: keep THEOplayerConnectorConviva and remove the other 2 I mentioned.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yes, that works. I removed THEOplayerSDK and ConvivaSDK from the test target in 1bb6d8e. The tests still compile and all 32 Conviva tests run on CI.

One test fails, testEndedReportsStoppedAndEndsSession (no ENDED event within 60 s), but it isn't caused by this change. The commit before this change fails the same way now that SwiftPM resolves THEOplayer SDK 11.16.0. It passed on 11.15.1. I'm looking into that separately.

Written by Devin

ceyhun-o and others added 12 commits November 23, 2026 11:31
Co-Authored-By: Ceyhun Ozgoc <ceyhun.ozgoc@dolby.com>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…alytics and run it on CI

Co-Authored-By: Ceyhun Ozgoc <ceyhun.ozgoc@dolby.com>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…errors and player state

Co-Authored-By: Ceyhun Ozgoc <ceyhun.ozgoc@dolby.com>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Ceyhun Ozgoc <ceyhun.ozgoc@dolby.com>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Ceyhun Ozgoc <ceyhun.ozgoc@dolby.com>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Ceyhun Ozgoc <ceyhun.ozgoc@dolby.com>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…annel

Co-Authored-By: Ceyhun Ozgoc <ceyhun.ozgoc@dolby.com>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
… the session

Co-Authored-By: Ceyhun Ozgoc <ceyhun.ozgoc@dolby.com>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Ceyhun Ozgoc <ceyhun.ozgoc@dolby.com>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Ceyhun Ozgoc <ceyhun.ozgoc@dolby.com>
…ration

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Ceyhun Ozgoc <ceyhun.ozgoc@dolby.com>
…vivaSDK

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Ceyhun Ozgoc <ceyhun.ozgoc@dolby.com>
@devin-ai-integration
devin-ai-integration Bot force-pushed the maintenance/conviva-tests branch from 1bb6d8e to 1cc08d2 Compare November 23, 2026 11:31
ceyhun-o and others added 7 commits November 23, 2026 04:15
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
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