[fakes] fake-resultstore-wrap.sh

Factored out more reusable single-purpose scripts, for composing different
types of rsproxy tests.

fake-resultstore-wrap.sh is a command wrapper that starts and shuts down
a fake resultstore server, primarily used for integration testing.
It preserves the exit status of the wrapped command, verified by bazel
tests.

scripts/rs-ninja.sh is similar to rs-fakebuild.sh in that its main
purpose is to act as a command-prefix that responds to the RSPROXY_FIFO
environment variable set by rsproxy-wrap.sh -- they work together.
This design allows the proxy wrap and ninja invocation to be separated
by multiple layers of wrapping and functional composition.
rs-ninja.sh also generates a uuid for ninja to use as the invocation Id.
rs-ninja.sh is intended to be installed as part of the package.

Multiple scripts have been refactored to use rs-ninja.sh and
fake-resultstore-wrap.sh: test-rsproxy-wrap.sh, e2e_test.sh.

fakecas/server.go: resolves conflicting requirements in instance names
by adjusting when using the fake CAS from remote-apis-sdks.
This avoids an error from their fake library.

Generally, we are shaping scripts to be usable for both production
deployment and bazel-test usability.

Bug: 390427892
Change-Id: Id82cbdd4d809b7c97b14f95774a34e61e437fe71
Reviewed-on: https://fuchsia-review.googlesource.com/c/rsclient/+/1363477
Reviewed-by: Jay Zhuang <jayzhuang@google.com>
Commit-Queue: David Fang <fangism@google.com>
8 files changed
tree: 35357bae10bb4487eaebae207208c4d9a004b934
  1. cmd/
  2. internal/
  3. scripts/
  4. tools/
  5. .bazelversion
  6. .gitignore
  7. AUTHORS
  8. BUILD.bazel
  9. CONTRIBUTING.md
  10. GEMINI.md
  11. go.mod
  12. go.sum
  13. LICENSE
  14. MODULE.bazel
  15. OWNERS
  16. PATENTS
  17. README.md
  18. version.bzl
README.md

ResultStore Client Tools

The rsclient repository contains tools that support the use of ResultStore services and API.

rsproxy acts as a bridge between build tools and the ResultStore service.

The first supported build tool is Fuchsia's fork of ninja.

Developing from source

Prerequisites

  • rsclient builds with Bazel. We recommend using Bazelisk to use the version of Bazel currently supported by this code base.

rsclient is supported for Linux, and is yet untested on other platforms.

Setup

Before working with the code base, we recommend installing the precommit hook once per git clone with:

./scripts/install_precommit.sh

This runs a variety of checks and automatic regeneration steps for you before committing local changes.

Building

To build everything:

$ bazelisk build ...

Testing

To run tests:

$ bazelisk test ...

Install

Versioning

Not yet applicable.

Releases

Not yet applicable.