diff options
author | Ben Hutchings <ben.hutchings@codethink.co.uk> | 2020-05-06 22:45:42 +0100 |
---|---|---|
committer | Ben Hutchings <ben.hutchings@codethink.co.uk> | 2020-06-01 15:26:47 +0100 |
commit | 14eac038d2fa7ac4845135a827ca8c2f2bab559c (patch) | |
tree | 516737a7c9f8bc176fee1f5e3b4ec4dd28ce9550 /yarns.webapp | |
parent | 5963f66a434d49a4a6e8dfc02cfe256c88d1e1e6 (diff) | |
download | lorry-controller-14eac038d2fa7ac4845135a827ca8c2f2bab559c.tar.gz |
Update terminology for hosts in internal APIs and web templates
This is intended to replace all uses of "Trove" that should really be
"Downstream Host" or "Upstream Host", except in the database schema
and the REST API (which will probably change later).
* ARCH: Update example code to reflect API name change
* yarns.webapp: Update test descriptions and uses of internal APIs
* units: Update and rename the ls-troves units (although they still
use the ls-troves endpoint for now)
Some references that really are specific to Trove integration are
retained.
Related to #3.
Diffstat (limited to 'yarns.webapp')
-rw-r--r-- | yarns.webapp/020-status.yarn | 2 | ||||
-rw-r--r-- | yarns.webapp/050-hosts.yarn (renamed from yarns.webapp/050-troves.yarn) | 40 | ||||
-rw-r--r-- | yarns.webapp/900-implementations.yarn | 14 |
3 files changed, 28 insertions, 28 deletions
diff --git a/yarns.webapp/020-status.yarn b/yarns.webapp/020-status.yarn index 5749920..8fb8593 100644 --- a/yarns.webapp/020-status.yarn +++ b/yarns.webapp/020-status.yarn @@ -3,7 +3,7 @@ WEBAPP status reporting WEBAPP reports it status via an HTTP request. We verify that when it starts up, the status is that it is doing nothing: there are no jobs, -it has no Lorry or Trove specs. +it has no Lorry or Host specs. SCENARIO WEBAPP is idle when it starts GIVEN a running WEBAPP diff --git a/yarns.webapp/050-troves.yarn b/yarns.webapp/050-hosts.yarn index 503ac09..dfa9e5b 100644 --- a/yarns.webapp/050-troves.yarn +++ b/yarns.webapp/050-hosts.yarn @@ -1,16 +1,16 @@ -Handling of remote Troves -========================= +Handling of Upstream Hosts +========================== -This chapter has tests for WEBAPP's handling of remote Troves: getting -the listing of repositories to mirror from the Trove, and creating +This chapter has tests for WEBAPP's handling of Upstream Hosts: getting +the listing of repositories to mirror from the Host, and creating entries in the run-queue for them. -Reading a remote Trove specification from CONFGIT -------------------------------------------------- +Reading a Host specification from CONFGIT +----------------------------------------- When there's a `troves` section in the Lorry Controller configuration -file, the WEBAPP should include that in the list of Troves when +file, the WEBAPP should include that in the list of Hosts when reported. SCENARIO a Trove is listed in CONFGIT @@ -18,55 +18,55 @@ reported. AND an empty lorry-controller.conf in CONFGIT AND WEBAPP uses CONFGIT as its configuration directory -Note that we need to fake a remote Trove, using static files, to keep +Note that we need to fake an Upstream Host, using static files, to keep test setup simpler. - AND WEBAPP fakes Trove example-trove + AND WEBAPP fakes Upstream Host example-trove AND a running WEBAPP -Initially WEBAPP should report no known Troves, and have an empty +Initially WEBAPP should report no known Hosts, and have an empty run-queue. WHEN admin makes request GET /1.0/status THEN response has run_queue set to [] - AND response has troves set to [] + AND response has hosts set to [] Let's add a `troves` section to the configuration file. After WEBAPP -reads that, it should list the added Trove in status. +reads that, it should list the added Host in status. GIVEN lorry-controller.conf in CONFGIT adds trove example-trove AND lorry-controller.conf in CONFGIT has prefixmap example:example for example-trove WHEN admin makes request POST /1.0/read-configuration AND admin makes request GET /1.0/status - THEN response has troves item 0 field trovehost set to "example-trove" + THEN response has hosts item 0 field host set to "example-trove" However, this should not have made WEBAPP to fetch a new list of -repositories from the remote Trove. +repositories from the Upstream Host. THEN response has run_queue set to [] If we tell WEBAPP to fetch the list, we should see repositories. - GIVEN remote Trove example-trove has repository example/foo + GIVEN Upstream Host example-trove has repository example/foo WHEN admin makes request POST /1.0/ls-troves AND admin makes request GET /1.0/list-queue THEN response has queue set to ["example/foo"] If we re-read the configuration again, without any changes to it or to -the fake Trove's repository list, the same Troves and Lorry specs +the fake Upstream Host's repository list, the same Host and Lorry specs should remain in STATEDB. (It wasn't always thus, due to a bug.) WHEN admin makes request POST /1.0/read-configuration AND admin makes request GET /1.0/status - THEN response has troves item 0 field trovehost set to "example-trove" + THEN response has hosts item 0 field host set to "example-trove" WHEN admin makes request GET /1.0/list-queue THEN response has queue set to ["example/foo"] -If the Trove deletes a repository, we should still keep it locally, to -avoid disasters. However, it will be removed from the Trove's STATEDB, +If the Upstream Host deletes a repository, we should still keep it locally, to +avoid disasters. However, it will be removed from the Host's STATEDB, and it won't be lorried anymore. - GIVEN remote Trove example-trove doesn't have repository example/foo + GIVEN Upstream Host example-trove doesn't have repository example/foo WHEN admin makes request POST /1.0/ls-troves AND admin makes request GET /1.0/list-queue THEN response has queue set to [] diff --git a/yarns.webapp/900-implementations.yarn b/yarns.webapp/900-implementations.yarn index 245cd73..9a759ba 100644 --- a/yarns.webapp/900-implementations.yarn +++ b/yarns.webapp/900-implementations.yarn @@ -227,15 +227,15 @@ configuration directory is. add_to_config_file "$DATADIR/webapp.conf" \ configuration-directory "$DATADIR/$MATCH_1" -Make WEBAPP fake access to a Trove using a static file. +Make WEBAPP fake access to an Upstream Host using a static file. - IMPLEMENTS GIVEN WEBAPP fakes Trove (\S+) + IMPLEMENTS GIVEN WEBAPP fakes Upstream Host (\S+) add_to_config_file "$DATADIR/webapp.conf" \ - debug-fake-trove "$MATCH_1=$DATADIR/$MATCH_1.trove" + debug-fake-upstream-host "$MATCH_1=$DATADIR/$MATCH_1.trove" -Control the ls listing of a remote Trove. +Control the ls listing of an Upstream Host. - IMPLEMENTS GIVEN remote Trove (\S+) has repository (\S+) + IMPLEMENTS GIVEN Upstream Host (\S+) has repository (\S+) filename="$DATADIR/$MATCH_1.trove" if [ ! -e "$filename" ] then @@ -253,9 +253,9 @@ Control the ls listing of a remote Trove. json.dump(data, f) ' "$filename" -Remove a repository from the fake remote Trove. +Remove a repository from the fake Upstream Host. - IMPLEMENTS GIVEN remote Trove (\S+) doesn't have repository (\S+) + IMPLEMENTS GIVEN Upstream Host (\S+) doesn't have repository (\S+) filename="$DATADIR/$MATCH_1.trove" if [ ! -e "$filename" ] then |