-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: minor naming tweaks and docs for integs
- Loading branch information
1 parent
777b4ec
commit 3e925cb
Showing
3 changed files
with
100 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
# Integration tests | ||
|
||
By default, these tests expect the services defined in the | ||
[../deploy/compose/compose.yaml](default compose script) -- MinIO, | ||
Kafka, and Keycloak -- to be up and running. Once they're ready, run | ||
the tests like so: | ||
|
||
```shell | ||
cargo test -p integration-tests | ||
``` | ||
|
||
To see more detailed output: | ||
|
||
```shell | ||
RUST_LOG=info cargo test -p integration-tests -- --nocapture | ||
``` | ||
|
||
The tests do not require Trustification itself to be running. Each | ||
test will start whatever services it requires and then shut them down | ||
when the test completes. It is possible, however, to override that | ||
default behavior and direct the integration tests at a particular | ||
Trustification instance. | ||
|
||
## Testing a remote Trustification instance | ||
|
||
Setting the `TRUST_URL` environment variable to the URL for a remote | ||
trustification server triggers the integs to be run against it. | ||
|
||
If it's set, other env vars will be required: | ||
* `TRUST_ID` -- a client id with *manager* authorization, i.e. "write" permissions | ||
* `TRUST_SECRET` -- the secret associated with `TRUST_ID` | ||
* `TRUST_USER_ID` -- (optional, defaults to `TRUST_ID`) a client id | ||
for a non-privileged user, i.e. "read-only" | ||
* `TRUST_USER_SECRET` -- (optional, defaults to `TRUST_SECRET`) the | ||
secret associated with `TRUST_USER_ID` | ||
* `KAFKA_BOOTSTRAP_SERVERS` -- (optional) if set, its value will be | ||
used to configure the event bus required by some of the | ||
tests. Otherwise, [https://aws.amazon.com/sqs/](SQS) is assumed | ||
and valid AWS credentials will be required. | ||
|
||
Some examples might be nice. Let's assume you're running a local | ||
instance of trustification like so: | ||
|
||
```shell | ||
docker compose -f deploy/compose/compose-trustification.yaml up | ||
``` | ||
|
||
The default URL for that instance is http://localhost:8084 so we'll | ||
point the integs there. We first need to set `KAFKA_BOOTSTRAP_SERVERS` | ||
for those tests that expect events. | ||
|
||
```shell | ||
export KAFKA_BOOTSTRAP_SERVERS=localhost:9092 | ||
``` | ||
|
||
To run all the tests: | ||
|
||
```shell | ||
TRUST_URL=http://localhost:8084 \ | ||
TRUST_ID=testing-manager \ | ||
TRUST_SECRET=R8A6KFeyxJsMDBhjfHbpZTIF0GWt43HP \ | ||
TRUST_USER_ID=testing-user \ | ||
TRUST_USER_SECRET=ZVzq9AMOVUdMY1lSohpx1jI3aW56QDPS \ | ||
cargo test -p integration-tests | ||
``` | ||
|
||
If you limit which tests run, you don't need to provide all the | ||
variables. For example, to run just the `bombastic_search` test, only | ||
these are needed: | ||
|
||
```shell | ||
TRUST_URL=http://localhost:8084 \ | ||
TRUST_ID=testing-manager \ | ||
TRUST_SECRET=R8A6KFeyxJsMDBhjfHbpZTIF0GWt43HP \ | ||
cargo test -p integration-tests bombastic_search | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters