Repository navigation
test(frontend): share HTTP service and computing-unit fixtures - #9722
Merged
aglinxinyuan merged 2 commits intoNov 26, 2026
Merged
Conversation
The HTTP service specs each configured the testing module and flushed their expected requests by hand, and the computing-unit specs each built their unit records by hand; several also registered services that are already provided in root. They now share setupHttpServiceTest, flushHttpRequest and the computing-unit record builders, and drop the redundant registrations while keeping their named mocks.
aglinxinyuan
requested review from
kunwp1
and
a balanced review from Copilot
November 26, 2026 06:08
Contributor
Automated Reviewer SuggestionsBased on the
|
kunwp1
approved these changes
Nov 26, 2026
…s local - The login spec's provider cases name each node they check. As on main, the Apple-only case does not check the Google button. - The dashboard-entry case gets its asserted WRITE access from its own input, not the shared default. - makeDashboardComputingUnit always merges the resource limits. The one case that needs no resource clears the field itself.
aglinxinyuan
enabled auto-merge
November 26, 2026 19:00
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #9722 +/- ##
============================================
- Coverage 91.78% 91.77% -0.02%
Complexity 5135 5135
============================================
Files 1306 1308 +2
Lines 58243 58079 -164
Branches 7576 7558 -18
============================================
- Hits 53458 53301 -157
+ Misses 2893 2889 -4
+ Partials 1892 1889 -3
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
What changes were proposed in this PR?
Two groups of frontend specs set up the same things by hand. They now share two test helpers:
common/testing/http-service-test-utils.ts:setupHttpServiceTestconfigures the testing module withHttpClientTestingModulefor a service and returns the service withHttpTestingController, andflushHttpRequestexpects one request, checks its method (and its body, response type, content type or query params when a test gives them) and flushes the response. The auth, Google and Apple sign-in, user config, GUI config, Gmail, warehouse, deployment version, computing-unit managing, admin and feedback service specs and the login page spec use them.common/testing/computing-unit-test-fixtures.ts:makeDashboardComputingUnitbuilds a computing-unit record with per-test overrides of the record and its resource limits,makeLocalComputingUnitbuilds a local unit, andNAN_COMPUTING_UNIT_RESOURCEholds the unknown limits. The creation modal, status service, admin and user computing-unit, cluster capacity, list item, utility and dashboard type specs use them.The specs also stop registering services that are already provided in root and keep their named mocks. Every test keeps its name, its inputs and its expected values, in the same order.
Any related issues, documentation, discussions?
Closes #9721.
How was this PR tested?
ng test --watch=falsefromfrontend: the 7,428 cases in the 256 spec files have the same names, outcomes and order within each file on main and on this branch, compared case by case fromjunit.xml.flushHttpRequestexpecting GET for every request (30 of 170 cases), expecting a null body (21 of 170),setupHttpServiceTestdropping the extra providers (68 of 170),makeDashboardComputingUnitignoring resource overrides (7 of 193), and the login spec's provider checks swapping the ORCID and Apple buttons (4 of 64).yarn format:ci,npx tsc --noEmit -p src/tsconfig.app.jsonandnpx tsc --noEmit -p src/tsconfig.spec.jsonWas this PR authored or co-authored using generative AI tooling?
Generated-by: Antigravity (Gemini), Codex (GPT-6) and Claude Code (Claude Opus 5.5)