Skip to content

[PLT-0] Fix test expectations for updated test assets#2062

Merged
mrobers1982 merged 3 commits into
developfrom
mrobers1982/fix-test-asset-expectations
Jul 10, 2026
Merged

[PLT-0] Fix test expectations for updated test assets#2062
mrobers1982 merged 3 commits into
developfrom
mrobers1982/fix-test-asset-expectations

Conversation

@mrobers1982

@mrobers1982 mrobers1982 commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Description

Follow-up to #2055 (test-asset repath). The new hosted assets differ from the deleted originals, so several tests needed their fixtures/expected values realigned.

Changes

Bucket 1 — image_url byte-equality failures

  • image_url pointed at https://picsum.photos/200/300.jpg, which returns a different random image per request, breaking every requests.get(image_url).content == requests.get(data_row.row_data).content assertion in test_data_rows.py. Repointed to a stable, byte-stable JPEG (potato.jpeg).
  • This also fixes test_data_rows_upsert.py::test_multiple_chunks (assert 7 == 11): the shorter picsum URL under-filled the mocked 300-byte upsert chunks. Verified by reproducing the chunker locally — potato URL yields 11 upload calls, matching the assertion.
  • Applied the same picsum → stable-JPEG swap in lbox-alignerr/tests/conftest.py (latent there — no byte-equality asserts — but removes the third-party dependency).

Bucket 2 — expected values for new asset content

  • Text: TextEntity token updated to match sample-text.txt at offsets 112–128 (server extracts text[start:end+1]).
  • Document: entity token IDs / groupId / text re-derived from the new sample-pdf-textlayer.json, and page width updated 612 → 594 (new test-pdf.pdf MediaBox).
  • Video: frame_rate 10 → 25, frame_count 100 → 627 (intrinsic to test_video_500kb.mp4, verified via ffprobe).

Notes / not in scope

The following pre-date this change and reproduce on develop (backend/staging, not asset-related), so they are intentionally not addressed here:

  • test_bulk_assign_data_rows*project_based_user fixture uses the removed addMembersToOrganization mutation.
  • test_get_slice — shared-org state-leak flakiness.

Verification

Test-only changes. Text/Document values are read directly from the new asset files (deterministic). The video frame_count = 627 and all server-rehost byte-equality checks can only be fully confirmed by the integration job running against staging.

🤖 Generated with Claude Code


Note

Low Risk
Test-only and dependency-pin changes; no production SDK logic beyond cosmetic formatting in project.py.

Overview
Follow-up to test-asset repathing: integration and export tests are updated so fixtures and assertions match the new hosted files, not the removed originals.

Stable image URL: IMG_URL in libs/labelbox and lbox-alignerr conftest switches from picsum.photos to a fixed GCS JPEG (potato.jpeg), with comments explaining byte-equality and upsert chunk-count tests that depended on a non-random source.

Annotation import expectations: Text entity token, document token IDs / groupId / selected text, and PDF page width (612594) are refreshed for sample-text.txt, sample-pdf-textlayer.json, and test-pdf.pdf.

Video streamable export: Expected frame_rate (1025) and frame_count (100627) for test_video_500kb.mp4.

Dev deps: Root and lbox-alignerr pytest capped to <9 until pytest-cases supports pytest 9.

Minor formatting-only edits in project.get_overview, batch overview integration test, and unit tests—no API behavior change.

Reviewed by Cursor Bugbot for commit c778ba7. Bugbot is set up for automated code reviews on this repo. Configure here.

Follow-up to the test-asset repath (#2055). The new hosted assets differ
from the deleted originals, so several tests need their fixtures/expected
values realigned:

- image_url: point at a stable, byte-stable JPEG (potato.jpeg) instead of
  picsum.photos, which returns a random image per request and broke every
  byte-equality assertion in test_data_rows.py. This also restores
  test_multiple_chunks (the shorter picsum URL under-filled the mocked
  300-byte upsert chunks, yielding 7 upload calls instead of 11).
- Same picsum -> stable JPEG swap in the alignerr conftest (latent; no
  byte-equality asserts there, but removes the third-party dependency).
- Text TextEntity token updated to match sample-text.txt at offsets 112-128.
- Document entity token IDs/groupId/text and page width (594) updated to
  match sample-pdf-textlayer.json / test-pdf.pdf.
- Video frame_rate/frame_count updated to test_video_500kb.mp4 (25 fps, 627).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
mrobers1982 and others added 2 commits July 9, 2026 18:06
CI installs deps via `rye sync -f --update-all`, which ignores the lockfile
and resolves `pytest>=8.1.1` to pytest 9.1.1. pytest 9 changed the internal
IdMaker signature, which pytest-cases (<=3.10.1) still calls the old way at
import time, raising `TypeError: IdMaker.__init__() takes 7 positional
arguments but 8 were given` and breaking collection in every test job.

Cap pytest <9 in the root and alignerr dev-dependencies until pytest-cases
ships pytest 9 support.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
project.py, test_batch.py, and test_project.py (last touched by #2060) were
not formatted per the repo's ruff config, failing `rye fmt --check` on every
PR. Formatted with ruff 0.8.2 (the version bundled by CI's rye 0.43.0).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mrobers1982
mrobers1982 merged commit b28a12c into develop Jul 10, 2026
18 of 30 checks passed
@mrobers1982
mrobers1982 deleted the mrobers1982/fix-test-asset-expectations branch July 10, 2026 14:57
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.

2 participants