commit | 594086ed8f67eb284f02527bd4e417e1c4845f81 | [log] [tgz] |
---|---|---|
author | Patrick Meiring <meiring@google.com> | Tue Aug 08 03:19:30 2023 |
committer | LUCI CQ <infra-scoped@luci-project-accounts.iam.gserviceaccount.com> | Tue Aug 08 03:19:30 2023 |
tree | 6faba56c836775aefd0a2404c7fd08ac6f12db5a | |
parent | c4e0e2259dbd26a459b74b603d2de178b2b5731f [diff] |
[common] Improve ShouldResembleProto to handle protos in structs. A number of cases have arisen where tests want to compare vanilla go structs with one or more nested proto messages. For example, structs representing rows in Spanner with protocol buffer fields. Neither Goconvey's ShouldResemble or its replacement that handles proto messages (ShouldResembleProto) can do equality comparisons on these, leading to ad-hoc workarounds in tests or direct calls into gocmp which are generally unsatisfactory from a readability perspective. Rather than implement a third ShouldResembleXXX method, this CL modifies the comparison in the existing ShouldResembleProto method to allow protos nested in other ways. The gocmp-comparison is stricter than the existing ShouldResembleProto test as it verifies the type of the enclosing slice (if any), so some tests must be updated. Some CV tests were using ShouldResembleProto on go structs with datastore keys and protos inside them, the old ShouldResembleProto was performing no meaningful comparison in this case due to a bug. Rather than delete this test, datastore key equality was updated slightly to allow the test to pass. BUG=None TEST=SPANNER_EMULATOR=1 INTEGRATION_TESTS=1 go test go.chromium.org/luci/... Change-Id: I9424e58e0b1f693e9bebb3774996466bfce25f73 Reviewed-on: https://chromium-review.googlesource.com/c/infra/luci/luci-go/+/4749987 Reviewed-by: Robbie Iannucci <iannucci@chromium.org> Commit-Queue: Patrick Meiring <meiring@google.com> Reviewed-by: Tuan Nguyen <nqmtuan@google.com>
LUCI Go code is meant to be worked on from an Chromium infra.git checkout, which enforces packages versions and Go toolchain version. First get fetch via depot_tools.git then run:
fetch infra cd infra/go eval `./env.py` cd src/go.chromium.org/luci
It is now possible to directly install tools with go install:
go install go.chromium.org/luci/auth/client/cmd/...@latest go install go.chromium.org/luci/buildbucket/cmd/...@latest go install go.chromium.org/luci/cipd/client/cmd/...@latest go install go.chromium.org/luci/client/cmd/...@latest go install go.chromium.org/luci/cv/cmd/...@latest go install go.chromium.org/luci/gce/cmd/...@latest go install go.chromium.org/luci/grpc/cmd/...@latest go install go.chromium.org/luci/logdog/client/cmd/...@latest go install go.chromium.org/luci/luci_notify/cmd/...@latest go install go.chromium.org/luci/lucicfg/cmd/...@latest go install go.chromium.org/luci/luciexe/legacy/cmd/...@latest go install go.chromium.org/luci/mailer/cmd/...@latest go install go.chromium.org/luci/mmutex/cmd/...@latest go install go.chromium.org/luci/resultdb/cmd/...@latest go install go.chromium.org/luci/server/cmd/...@latest go install go.chromium.org/luci/swarming/cmd/...@latest go install go.chromium.org/luci/tokenserver/cmd/...@latest go install go.chromium.org/luci/tools/cmd/...@latest
Contributing uses the same flow as Chromium contributions.