aries-vcr
aries-vcr copied to clipboard
Add a test API script to aries-vcr with a "Known Good Results" file and GitHub Actions when changes are detected
Add a script that executes (likely via "curl") a number of API endpoints against the OrgBook BC "dev" instance, saves the results, intelligently compares it against known good results (KGRs) and generates an error if the run results differ from the KGRs. Once implemented, define a way to run the process continually and notify on error.
Notes:
- @ianco will provide the initial set of test cases to be run.
- "Intelligently" means filtering out expected changes like date/timestamps -- if any.
- This type of processing is going on in Aries Agent Test Harness, so boring from that implementation is reasonable.
- Not sure where this should be managed since for now we want to run against OrgBook BC Dev, which is not part of Aries VCR. Perhaps we set this up and run this in another BCGov repo (perhaps orgbook-config?) and run it on after each dev deployment.
I recall @ianco started integrating these scripts into aries-vcr. I can't find the PR.
We have an OCP project set specifically for hosting this type of tooling; Digital Trust Monitoring Services (ca7f8f). When things are ready queue it up with me.
Work in progress is here (the Aries VCR demo issuer):
https://github.com/bcgov/aries-vcr-issuer-controller/pull/63
(PR from the ianco repo to bcgov)
Everything runs fine when I run locally but it fails in GHA. I think it's a resourcing issue, as there are a large number of containers required to run the tests (von network; aries vcr (minimum set of containers I believe) and the issuer agent.
OK got it running finally. The GHA spins up von-network and aries-vcr, and then initializes, builds and runs the aries-vcr-issuere-agent. (Only the necessary docker containers are started). Once the dockers are running GHA runs some scripts to create a bunch of credentials and post them to orgbook. The credentials are "random", but the randomizer is always started with the sale "seed", so all the "random" credentials are generated consistently with every run.
The s.a.y. script (by Akiff):
- reads in some KGR data from a csv file (company numbers, api endpoints, ...)
- converts each line to an aries-vcr api call
- calls the api
- compares the result against KGR
The s.a.y. script still needs a few tweaks, and currently a "different from yesterday" result won't fail the GHA script.