We'd like to use Hurl scripts as a way to automate and run integration tests on the ldapi service.
This PR contains mostly changes that allow us to do that both locally and in CI.
Changes to the application code
We now check the CI environment variable and disable authentication if it's set to true. This allows us to run the built container in CI and run test against it.
Changes to test code
a new test source path: test-hurl for running hurl scripts. Right now it's located at ./datahost-ld-openapi/test-hurl but I'm thinking of nesting different kinds of tests under test/main, test/hurl etc.
a utility namespace for launching hurl (via clojure.java.shell/sh) and dealing with variables. The safest approach is to launch generate new, unique variables for each script (as everything is scoped to a series anyway).
only a few regression tests were added (scripts I used to verify fixes for bugs). More are in the works (but will come as different PR).
documentation for the hurl setup in datahost-ld-openapi/doc/integration-testing.md
Changes to CI setup
more details on that in the comment. tldr: added new jobs for running hurl tests.
better names for existing jobs
the hurl tests are run via a babashka script (datahost-ld-openapi/bin/hurl-runner.bb)
We'd like to use Hurl scripts as a way to automate and run integration tests on the ldapi service.
This PR contains mostly changes that allow us to do that both locally and in CI.
Changes to the application code
CI
environment variable and disable authentication if it's set totrue
. This allows us to run the built container in CI and run test against it.Changes to test code
test-hurl
for running hurl scripts. Right now it's located at./datahost-ld-openapi/test-hurl
but I'm thinking of nesting different kinds of tests undertest/main
,test/hurl
etc.clojure.java.shell/sh
) and dealing with variables. The safest approach is to launch generate new, unique variables for each script (as everything is scoped to a series anyway).datahost-ld-openapi/doc/integration-testing.md
Changes to CI setup
datahost-ld-openapi/bin/hurl-runner.bb
)