Documentation
¶
Overview ¶
Package p2 runs the P2 routes of the assembled server: remote and virtual repositories, archive suffixes, external composite children and their origins, and the cache's integrity.
Role ¶
Test support: server-assembly suites for the P2 ecosystem, outside the modules. They drive the production router through HTTP requests. The package is one of its own so that CI selection can run it alone; its owner in tools/citestselection/test_ownership.json is p2.
Inputs ¶
- The production router from test/server/support/harness, through the harness's item world under the root's name (fixture_test.go, newItemWorld): the users reader, deployer and user, the deploy-libs permission and eight local, remote and virtual repositories, with the request and seed helpers of test/server/support.
- The Eclipse GLSP update site files in internal/artifacts/ecosystem/p2/testdata, read root-relative through repopath, and remote sources over stub backends (sourceIdentity, sourceBackend).
- The harness's remote world (harness.NewRemoteWorld): a P2 remote over a chi upstream the test serves, through the remote cache and its validation.
Outputs ¶
Assertions only:
- p2_test.go: archive suffix bounds and permissions, the remote and virtual wire paths, invalid or changed cached representations, virtual member filtering, a virtual's member files under their keys, and its composite built from p2Urls.
- p2_repositories_test.go: the members and P2 remote repositories a create or update through the repositories API gives a P2 virtual repository for its p2Urls, singly and in batches, and the writes it refuses.
- p2_external_test.go, p2_external_error_test.go and p2_external_cache_integrity_test.go: external composite children, their depth, origins and authority, metadata fallback, archive corruption, forged member selection and a changed published checksum.
- p2_xz_test.go: a remote's upstream content.xml.xz or artifacts.xml.xz that lost its xz index and footer, refused through the remote and through a virtual over it (#1331).
- p2_force_auth_test.go: forceP2Authentication's 401 with the Basic challenge for every anonymous read of a virtual repository that sets it, before a member's upstream is asked; the answers it leaves to a signed-in caller and when it is off; a nested virtual member read through a virtual repository whose own flag is off; and a remote's flag, which changes nothing (#1280).
- p2_force_auth_methods_test.go: the same 401 for an anonymous ?trace, PUT, DELETE and a method the item routes do not serve, and for a request without credentials while anonymous access is off; the answers it leaves to a signed-in caller and when it is off (#1435).
- served_copy_fault_test.go: an archive-backed remote whose served site archive, a stream or a cached item, fails to read answers 500, logged once (#1488).
References ¶
- Decision 0007: docs/research/decisions/0007-remote-repositories.md.
- Decision 0032: docs/research/decisions/0032-package-format-handlers.md.
- docs/testing/p2.md.
- Decision 0044: docs/research/decisions/0044-modular-monolith-migration.md (test/server/artifacts/<type> holds each ecosystem's server-assembly suites).
- docs/testing/server-test-ownership.md: how CI selection gives the package an owner.
- https://github.com/weaveplatform/artifactweave/issues/1068, https://github.com/weaveplatform/artifactweave/issues/1084, https://github.com/weaveplatform/artifactweave/issues/1257, https://github.com/weaveplatform/artifactweave/issues/1280 and https://github.com/weaveplatform/artifactweave/issues/1331
Status ¶
Implemented P9c (the plan's P31 group). P9d moved the router-level tests here from the server root (TST-06), and the tests that call the protocol's unexported code moved with it to internal/artifacts/ecosystem/p2/http (WEB-15).
Click to show internal directories.
Click to hide internal directories.