Add jobs view integration tests for selection, pinning and classification - #9804
Open
camd wants to merge 4 commits into
Open
Add jobs view integration tests for selection, pinning and classification#9804camd wants to merge 4 commits into
camd wants to merge 4 commits into
Conversation
✅ Deploy Preview for treeherder ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
…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
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
camd
force-pushed
the
camd/jobs-view-integration-tests
branch
from
August 29, 2026 17:05
fef38c0 to
1336a53
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #9804 +/- ##
=======================================
Coverage 83.67% 83.67%
=======================================
Files 640 640
Lines 38875 38875
Branches 3487 3492 +5
=======================================
Hits 32529 32529
Misses 5956 5956
Partials 390 390 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
The class-to-functional conversion replaced JobButton's custom shouldComponentUpdate with a plain memo(). Jobs are mutated in place when a classification is saved, so the memo comparison saw the same job reference and skipped the re-render; the classified star only appeared after the next jobs poll instead of immediately. Restore the old design by passing failure_classification_id and resultStatus as scalar props from JobGroup/JobsAndGroups: prop values are snapshotted at parent render time, so memo() sees the change even though the job object identity is unchanged.
Extends the two logged-in classification tests to verify the saved classification is reflected in the push list: the job button gains the star icon and data-classified marker, and (after deselecting) the 'u' unclassified-failures filter no longer shows the job. Notes: - The star svg's <title> adds 'classified' to the button text, so a /^B$/ hasText filter would miss the classified button; match on data-classified instead. - Keyboard shortcuts are ignored while an input has focus and Firefox does not move focus on button clicks, so blur the related-bug input before pressing Escape.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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. The new coverage also caught (and this PR fixes) a real regression: the job button was not re-rendering after saving a classification.
Changes
mockJobsApi.js— extracts the API fixture mocking fromjobs_view.spec.jsinto a shared helper so all jobs-view specs can use it. Extended with:seedLoggedInSession()+user: [SHERIFF_USER])/note/and/bug-job-map/so tests can assert what would be written to the backendjob_selection.spec.js(new, 5 tests)selectedTaskRunselects the job on loadn/pstep through unclassified failures (skipping already-classified jobs) with the URL updating at each steppinboard_classification.spec.js(new, 6 tests)bshortcut opens the related-bug input and adds a bug chip/note/and/bug-job-map/POST payloads, that the pinboard clears afterwards, and that the classification is reflected in the view: the job button gains the star icon anddata-classifiedmarker, and (after deselecting) theuunclassified-failures filter no longer shows the jobjobs_view.spec.js(+2 tests): theuunclassified-failures filter toggle, andsearchStrdeep links applying the filter on initial loadfailure_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 thebug_suggestions.jsonfixture:Bug fix: job button not updating after saving a classification
The new view-update assertions failed against the current code, and it turned out to be a real regression, not a test issue. The class-to-functional conversion replaced
JobButton's customshouldComponentUpdatewith a plainmemo(). Jobs are mutated in place when a classification is saved (PinBoard.jsxsetsjob.failure_classification_idand dispatchesapplyNewJobs), so the memo comparison saw the same job object reference and skipped the re-render — the classified star only appeared after the next jobs poll delivered fresh job objects, instead of immediately on save.Fix:
JobGroup/JobsAndGroupsnow passfailure_classification_idandresultStatustoJobButtonas scalar props (as the old class component received them). Prop values are snapshotted at parent render time, somemo()sees the change even though the job object identity is unchanged.JobButton.test.jsxis updated for the new props.Notes
pushState), so a single browser-back does not deselect. The back-button test loopsgoBack()with a comment for now; once that is fixed the test can be tightened to a singlegoBack()..first(), and the classified-state assertions scope to the job's own push (push-<id>), since only that push receives theapplyNewJobsupdate.hasTextis 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$/. The flip side: the star svg's<title>makes a classified button's text"Bclassified", so/^B$/would miss it — the post-save assertions match ondata-classifiedinstead.KeyboardShortcuts.jsx), and Firefox does not move focus on button clicks, so the spec blurs the related-bug input before pressing Escape.Testing
pnpm test:integration: all 35 tests pass (jobs-view specs also run with--repeat-eachlocally to check for flakiness)pnpm test: full unit suite passes (1088 tests), including the updatedJobButton.test.jsxpnpm lintclean