Skip to content

Add jobs view integration tests for selection, pinning and classification - #9804

Open
camd wants to merge 2 commits into
masterfrom
camd/jobs-view-integration-tests
Open

Add jobs view integration tests for selection, pinning and classification#9804
camd wants to merge 2 commits into
masterfrom
camd/jobs-view-integration-tests

Conversation

@camd

@camd camd commented Aug 23, 2026

Copy link
Copy Markdown
Collaborator

We've had a few navigation regressions in the jobs view, so this adds more Playwright integration coverage there — particularly around job selection and the pinning / classification flow.

Changes

  • mockJobsApi.js — extracts the API fixture mocking from jobs_view.spec.js into a shared helper so all jobs-view specs can use it. Extended with:
    • a real failure-classification list
    • a logged-in mode (seedLoggedInSession() + user: [SHERIFF_USER])
    • capture of POST payloads to /note/ and /bug-job-map/ so tests can assert what would be written to the backend
  • job_selection.spec.js (new, 5 tests)
    • deep link with selectedTaskRun selects the job on load
    • n/p step through unclassified failures (skipping already-classified jobs) with the URL updating at each step
    • arrow keys step through all jobs regardless of status
    • Escape clears both the selection and the URL param
    • browser back after selecting a job returns to the unselected state
  • pinboard_classification.spec.js (new, 6 tests)
    • pinning via spacebar, the details panel pin button, and the push header pin-all button; un-pinning
    • the b shortcut opens the related-bug input and adds a bug chip
    • saving while logged out shows the "Must be logged in" notification
    • a full logged-in classification: pin, attach a bug, save — asserting the actual /note/ and /bug-job-map/ POST payloads and that the pinboard clears afterwards
  • jobs_view.spec.js (+2 tests): the u unclassified-failures filter toggle, and searchStr deep links applying the filter on initial load
  • failure_summary.spec.js (new, 3 tests) — the suggestions themselves are backend logic covered by pytest (tests/model/test_error_summary.py); these cover the frontend wiring using the bug_suggestions.json fixture:
    • the failure summary is the default tab for a failed job and renders the failure line with its suggested bugs
    • pinning a suggested bug pins the job with the bug attached
    • a logged-in user can classify from a suggested bug, asserting the note and bug-job-map API payloads

Notes

  • Selecting a job currently pushes two identical history entries (duplicate pushState), so a single browser-back does not deselect. The back-button test loops goBack() with a comment for now; once that is fixed the test can be tightened to a single goBack().
  • The fixtures serve the same job list for every push, so a selected job lights up a copy on each push — assertions use .first().
  • Playwright's hasText is case-insensitive substring matching (the classified icon's "classified" title text made 'D' match the Cpp button), so job symbols are matched with anchored regexes like /^B$/.

Testing

  • pnpm test:integration: all 35 tests pass (22 jobs-view tests, run with --repeat-each=2 locally to check for flakiness)
  • pnpm lint clean

…tion

Extract the API fixture mocks from jobs_view.spec.js into a shared
mockJobsApi.js helper, extended with a logged-in mode and capture of
POSTs to the note and bug-job-map endpoints.

New coverage:
- job_selection.spec.js: selectedTaskRun deep links, n/p and arrow-key
  navigation, escape clearing the selection, and browser back after
  selecting a job
- pinboard_classification.spec.js: pinning via spacebar, the details
  panel pin button and the push header pin-all button, adding a related
  bug with the b shortcut, the logged-out save error, and a full
  logged-in classification asserting the API payloads
- jobs_view.spec.js: the u unclassified-failures filter toggle and
  searchStr deep links
@netlify

netlify Bot commented Aug 23, 2026

Copy link
Copy Markdown

Deploy Preview for treeherder ready!

Name Link
🔨 Latest commit fef38c0
🔍 Latest deploy log https://app.netlify.com/projects/treeherder/deploys/6a8b5337306dbe00086b2558
😎 Deploy Preview https://deploy-preview-9804--treeherder.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

Serve the bug_suggestions.json fixture through the shared mock helper
(new bugSuggestions option) and cover the wiring from a selected
failed job through the failure summary tab to the pinboard:

- the failure summary is the default tab for a failed job and renders
  the failure line with its suggested bugs
- pinning a suggested bug pins the job with the bug attached
- a logged-in user can classify from a suggested bug, asserting the
  note and bug-job-map API payloads
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.

1 participant