test(npm): npm virtual composition rows, part 2/3 (S31 plan: 19/19)

Summary

Part 2 of 3 of the S31 (npm-virtual) plan, step 19: the end-to-end harness and e2e catalog. This stack has 3 MRs, each targeting the previous one; review and merge them bottom-up. The spec is S31 (npm-virtual).

This part adds the virtual-composition rows to the npm e2e suite:

  • merged-install-round-trip: a client installs through a virtual repository that merges a hosted and a remote position, with the usage events of the install asserted.
  • tarball-single-winner: the tarball comes from the lowest-position holder only.
  • hosted-publish-visible: a publish to a hosted position is visible through the virtual repository at once.
  • rule-denial-reroutes: recorded as blocked, with no declaring test.
  • The npm upstream stub gains Version, PackumentOf, SetPackage, TarballPath and CountOf, with tests. The npm e2e client gains Dist and Dists, and package functional gains the shared AssertVirtualEvent; the maven suite keeps its own copy of that helper for a follow-up.
  • docs/testing/e2e/npm.md gets the ## Virtual repositories section, the four rows, and their ## Usage data rows. The Scope section no longer lists virtual repositories as out of scope.

Governing ADRs

None. The change adds tests and catalog documentation; it changes no runtime behavior.

Testing

  • E2e catalog: this part names merged-install-round-trip, tarball-single-winner and hosted-publish-visible as new automatable rows, each declared by its test in e2e/functional/npm/virtual_test.go, and the blocked rule-denial-reroutes. go run ./e2e/cmd/e2e-catalog generate -check and check -quiet pass (345 scenarios, 0 disagreements).
  • The e2e suite needs the full rig and does not run on a developer machine, so it is compile-checked (go vet -tags=e2e ./e2e/...) and linted (golangci-lint --build-tags=e2e, 0 issues). test:e2e:caproni:functional is a manual job on the MR pipeline; the run on bf4fa8d1 passed: https://gitlab.com/gitlab-org/ops/artifact-registry/-/jobs/17007345633
  • The stub's PackumentOf tests run in go test ./e2e/internal/upstream/....

docs/user/** is not affected: nothing here changes a customer-visible surface.

Size

About 710 reviewable LoC (660 added, 48 removed), of which virtual_test.go is about 410. Each row's test, its catalog row, its pattern entry and its scenario id must land together or lint:e2e-catalog-sync fails, and the three rows share the helpers in that file.

Stacked MRs (review/merge bottom-up)

Related to #900 (closed)

Edited by David Fernandez

Merge request reports

Loading
Loading