The GitHub Actions job "Benchmarks PR Comment" on texera.git/main has failed.
Run started by GitHub user kunwp1 (triggered by kunwp1).

Head commit for run:
e08b7f336af68ce1bcaca012589beb41c7aed132 / Prateek Ganigi 
<[email protected]>
test(workflow-operator): add unit tests for MediaGenCodegen (#6438)

### What changes were proposed in this PR?
Adds dedicated unit test coverage for MediaGenCodegen, the TaskCodegen
object that generates the Python payload/parse snippets for Hugging Face
media-generation operators (text-to-image and text-to-video). This class
previously had no direct test coverage.

A new spec file, [MediaGenCodegenSpec.scala was created in the same test
package, mirroring the structure and patterns of TextGenCodegenSpec
(shared makeCtx helper; assertions on snippet structure/markers rather
than exact whitespace). It adds 9 tests covering:
- task equals "text-to-image"
- tasks equals exactly Set("text-to-image", "text-to-video")
- payloadPython emits the static {"inputs": prompt_value} payload
- parsePython branches on both media tasks, routes URL responses through
the shared _url_to_data_url helper, converts OpenAI b64_json payloads
into a data:image/png;base64, URL, and falls back to json.dumps(body)
- Snippets never inline raw CodegenContext string values (no sentinel
leakage)
- Context-independence: identical output across two unrelated
CodegenContext instances

### Any related issues, documentation, discussions?
Closes #6252

### How was this PR tested?
Added 9 unit tests in the new spec file, all passing via sbt:

sbt "WorkflowOperator/testOnly
org.apache.texera.amber.operator.huggingFace.codegen.MediaGenCodegenSpec"

[info] Tests: succeeded 9, failed 0, canceled 0, ignored 0, pending 0
[info] All tests passed.

### Was this PR authored or co-authored using generative AI tooling?
Co-authored with Claude Opus 4.8 in compliance with ASF

Report URL: https://github.com/apache/texera/actions/runs/29540453240

With regards,
GitHub Actions via GitBox

Reply via email to