Skip to content
PitestsBackend1 file · +165 −40

Port Python bucket copy tests to TS for huggingface.js

Session from pi-sessions on Hugging Face by julien-c · CC-BY-4.0 · condensed by Coders Talk

10msession
0interventions
GOAL

Port a Python integration test for copying files between buckets to TypeScript, adding equivalent vitest tests for the copyFiles function in huggingface.js.

  1. Prompt · +0
    Write vitest tests in copy-files.spec.ts mirroring a Python test that copies files within the same bucket
  2. Agent did · +1m
    Explored existing spec files, copy-files.ts, commit.ts and test consts to understand bucket test conventions and available helpers before writing new tests
  3. Agent did · +4m
    Wrote initial integration tests for copyFiles into copy-files.spec.ts mirroring the Python test
  4. Agent did · +4m
    Investigated WebBlob/createBlob utilities and removed an unused createBlob import that didn't apply
  5. Agent did · +6m
    Expanded the spec with 140 lines of new tests, then cleaned up unused imports, leaving 3 integration tests covering same-bucket copy, folder copy, and related cases
  6. Agent did · +7m
    Ran tsc --noEmit type check; confirmed pre-existing unrelated errors (missing xetchunk-wasm dependency) and that new tests compiled cleanly
  7. Prompt · +8m
    ok, commit it
  8. Fail · +10m
    Second commit attempt failed with 'nothing to commit' since the change was already committed in a prior run
  9. Outcome · +10m
    Committed 139 insertions across 3 new integration tests for copyFiles in copy-files.spec.ts
VERDICT

I'd start by pointing the agent straight at existing bucket-related test files and the commit.ts/WebBlob utilities so it skips the long exploration phase. The type-check step before committing was the useful correction — it caught unused imports and confirmed no new errors were introduced. Next time I'd also just check git status before re-running the commit command to avoid the redundant 'nothing to commit' error.

I tried this · 0

Discussion · 0

How Builds work