Skip to content
PitestsBackend1 file · +16 −4

Add bucket copy integration tests in hub package (TS)

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

23msession
1interventions
GOAL

Port a set of Python integration tests for HfApi.copy_files bucket-to-bucket scenarios into TypeScript vitest tests for the hub package's copy-files module.

  1. Prompt · +0
    Write vitest tests in copy-files.spec.ts mirroring the Python integration tests for bucket-to-bucket and repo-to-bucket copy_files scenarios.
  2. Agent did · +0m
    Explored existing spec files, bucket handling logic across copy-files.ts, create-repo.ts, commit.ts, file-exists.ts, paths-info.ts, download-file.ts and error.ts to understand conventions and error types before writing tests.
  3. Agent did · +4m
    Edited copy-files.spec.ts multiple times over ~20 minutes to add the ported integration tests for bucket-to-same-bucket, bucket-to-different-bucket-folder, and repo-to-bucket-with-revision scenarios.
  4. Intervention · +23m
    Developer re-sent the exact same request to write the Python-mirrored tests, word for word, suggesting the prior edits hadn't produced what was wanted or were incomplete.
    Why: I asked again with the same wording because the tests it wrote before weren't matching what I needed, so I wanted it to redo the work properly.
  5. Outcome · +23m
    Session ends with the developer re-issuing the identical test-writing prompt; no confirmation the new tests pass.
VERDICT

Next time I'd give it the full list of Python test cases upfront instead of one at a time, so it has the complete picture before writing anything. Re-sending the same prompt verbatim was the only real correction here, and it didn't clearly resolve anything since the transcript ends without confirming the tests actually pass.

I tried this · 0

Discussion · 0

How Builds work