Two important milestones are now in place within buildstream,
first a set of ansible rules for generating a cache server
that is already being used for the remote-cache test.

The codebase is an adaptation of the infrastructure ansible
scripts  from freedesktop-org updated for current CentOS, and
split into small libraries for ease of maintenance.

This already landed on master, and you can find the ansible
scripts in the buildstream-infra  repository, on the following
url:

[email protected]:BuildStream/infrastructure/infrastructure.git

The second milestone is a unittest that tests with a minimal
buildstream project if the build-cache works and is being used
simultaneously.

This was not trivial to implement and it required to rework the code
a few times as well as  asking for help from other developers as they
shared better
understanding of the internals of buildstream.

The main challenge was finding documentation on the possible
properties to pass to the tests to enable or disable something
as the documentation is somewhat insufficient, for instance:

-        fixture.configure({"artifacts": [{"url":
remote_services.artifact_service,}]})
+        fixture.configure({"artifacts": [{"url":
remote_services.artifact_service, "push": True,}]})

Fixture being a CliRemote()

just this "push":True took a few review interactions for us
to discover that it existed.

The test is fairly simple:
a new section on setup.cfg - remotecache (that runs when --remote-cache is
specified)
That setup runs a test that tries on the first stage to build a really
simple buildstream project, and verifies that cache files are downloaded.
On the second stage of the test we try to build the same project but with a
broken
url for the cache, making sure that nothing is downloaded.

This code can be verified on the official buildstream repository, with the
merge commit 96dbdb012a7d957e6f7ee84c1df00aaf60d4b2f3

Reply via email to