The GitHub Actions job "Required Checks" on 
texera.git/gh-readonly-queue/main/pr-6889-ebc78fda96e93b7dfccce4ac779cc4eca9128f55
 has succeeded.
Run started by GitHub user aglinxinyuan (triggered by aglinxinyuan).

Head commit for run:
6b569dff00c0bbe2cb8e9c24a43d4aa20c56c528 / Xinyuan Lin <[email protected]>
test(amber): extend HuggingFaceModelResource unit test coverage (#6889)

### What changes were proposed in this PR?

Extends the existing unit spec from 87 to **126 tests** (+39), covering
the previously-untested upstream-facing code (`fetchSearchResults`,
`fetchAllModelsForTask`, `extractNextLink`, `buildSimplifiedList`,
`hasModelsForTask`, the `/tasks` walk, and `streamMediaWithCap`).

The Hub URLs are hard-coded in the resource, so there is no seam to
point at a local server; instead the spec swaps Unirest's global HTTP
client for an in-spec stub `Client`/`RawResponse` that serves canned
status/body/headers and records the outgoing URL and Authorization
header. Real Unirest plumbing still runs (including `asObject`, so the
media proxy is exercised end to end), and `afterEach` resets the config.
**No network calls** — the 50 MiB cap test uses a lazily generated
stream.

Covered: search vs browse listing (field simplification and defaulting,
exact query parameters, bearer-token forwarding, cache hits and
token-scoped cache bypass), Link-header pagination including the
`MAX_PAGES=50` cut-off and mid-pagination failure, the truncation-header
boundary at exactly `SEARCH_LIMIT`, task listing with warm-model
filtering and label fallback, and all three `413` size-cap paths in the
media proxy.

No source changes.

### Any related issues, documentation, discussions?

Closes #6886.

### How was this PR tested?

`sbt -java-home <jbr-17> "WorkflowExecutionService/testOnly
*HuggingFaceModelResourceSpec"` -> 126 succeeded, 0 failed.
`Test/scalafmtCheck` + `Test/scalafix --check` clean.

### Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Code (Opus 4.8 [1M context])

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

With regards,
GitHub Actions via GitBox

Reply via email to