Share the Go e2e harness through golang_e2e_matrix: go(), the file-proxy publisher, Machine/ChmodGuard and the grant mocks are copied across 5 suites

Offen
#1,980 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
22/100
Issue-Typ
Refactoring
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
go, rust
Bereich
testing-qa

Rechercherichtung

Start with crates/socket-patch-cli/tests/golang_e2e_matrix/mod.rs, which already holds the toolchain gate, then compare the local go(), stage() and Machine/ChmodGuard copies in e2e_golang_build.rs and e2e_vendor_golang_build.rs. Move the shared helpers into the matrix module, keep GOFLAGS pinned and GOWORK removed unless a caller sets them, and check that the hosted_build GOFLAGS=-mod=mod cases still set it explicitly. Done when the five Go suites pass with SOCKET_PATCH_GO_E2E_REQUIRED=1 and no assertion has been weakened.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

agent:triaged arch-audit priority:p3 refactor

[agent] Filed by the scheduled architecture audit (audit-cli-tests). Register: register.

Kind: refactor. Register ID: T65.

Problem

Every Go suite already includes golang_e2e_matrix/mod.rs for the toolchain gate, yet each one re-writes the rest of the harness. The two suites below are e2e_golang_build.rs (build) and e2e_vendor_golang_build.rs (vendor_build).

  • go() runner, 4 local copies plus golang_e2e_matrix::go_envs.
    • build L74-L82 and vendor_build L103 are identical.
    • The Machine variants have drifted:
      • hosted_build L97-L112
      • workspace_build L77-L93:```` this one pins GOFLAGS="" and removes `GOWORK`, and hosted doesn't.
  • File-GOPROXY publish + module zip, 5 copies.
    • build L86 and L344.
    • hosted_build L147-L178 and workspace_build L135-L166`````` are the same code apart from names.
    • vendor_build.
  • stage() and go_env. build L86-L152 and vendor_build L120 differ only in comments.
  • Machine and ChmodGuard. ChmodGuard + Drop are md5-identical in hosted_build L136 and workspace_build L119-L127. Machine differs only by a machines/ subdirectory. Separately, build and vendor_build keep a non-panic-safe chmod_writable/walkdir instead.
  • harvest_sums ×2. It has drifted on go_directive() vs a hard-coded go 1.18.
  • Hosted grant JSON and mount_sumdb ×3. See workspace_build L511-L550``````` and hosted_state L67-L105.```````` goZipDirhashH1 appears in exactly these three files.
  • Day-2 env. day2_env and day2 are 2 copies.
  • gopatch path. smod()/socket_module() are 2 copies, and the patch.socket.dev/gopatch/ literal appears in 6 files.
Proposed change

Move into golang_e2e_matrix:

  • a Proxy (publish, zip, harvest_sums);
  • Machine + ChmodGuard (replacing chmod_writable/walkdir);
  • one go(cmd_dir, env) that always pins GOFLAGS and removes GOWORK unless the caller sets them;
  • day2_env;
  • mount_go_grant/mount_sumdb;
  • a SOCKET_GO_MODULE constant.

Then delete the local copies. The workspace go() behavior (pinning GOFLAGS) becomes the default. Check that hosted_build's GOFLAGS=-mod=mod cases still set it explicitly.

Size

6 test files plus golang_e2e_matrix/mod.rs. Roughly −250 lines.

Acceptance criteria
  • The Go suites (e2e_golang_build, e2e_golang_hosted_build, e2e_golang_hosted_state, e2e_golang_workspace_build, e2e_vendor_golang_build) pass unchanged on the go-compatibility matrix rows, with SOCKET_PATCH_GO_E2E_REQUIRED=1.
  • No assertion is weakened.
Vorherrschende Sprache
Rust
Sterne
9
Forks
2
Ø Merge
1 T. 8 Std.
Gemergte PRs (30 T.)
309

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus SocketDev/socket-patch

Alle Issues in SocketDev/socket-patch

Ähnliche Issues

Weitere Issues zu Rust

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.