Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/telekom/pubsub-horizon-probe
Probe is a tool for performing Horizon SSE E2E tests :satellite:
https://github.com/telekom/pubsub-horizon-probe
e2e smoketest sse
Last synced: about 2 months ago
JSON representation
Probe is a tool for performing Horizon SSE E2E tests :satellite:
- Host: GitHub
- URL: https://github.com/telekom/pubsub-horizon-probe
- Owner: telekom
- Created: 2024-02-21T10:22:08.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-03-11T09:26:20.000Z (10 months ago)
- Last Synced: 2024-06-20T22:21:35.783Z (7 months ago)
- Topics: e2e, smoketest, sse
- Language: Go
- Homepage:
- Size: 221 KB
- Stars: 0
- Watchers: 6
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSES/Apache-2.0.txt
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
Probe
[![REUSE status](https://api.reuse.software/badge/github.com/telekom/pubsub-horizon-probe)](https://api.reuse.software/info/github.com/telekom/pubsub-horizon-probe)
[![Go Test](https://github.com/telekom/pubsub-horizon-probe/actions/workflows/go-test.yml/badge.svg)](https://github.com/telekom/pubsub-horizon-probe/actions/workflows/go-test.yml)## Overview
Probe is a tool for performing Horizon SSE E2E tests 📡## Running Probe
Before running Probe you might want to generate a configuration file instead of using environment variables.
If you want to run Probe from source replace `probe` with `go run .`.### Generate a new configuration
```bash
probe init
```### Run Probe
```bash
probe start --template template.json
```
### Using a template
To define the content of the event you are sending to Horizon, you have to provide a template in the form of a JSON file.
The `{{ EventId }}` placeholder is automatically replaced with a fresh UUID.**A template could look as follows**:
```json
{
"id":"{{ EventId }}",
"source":"http://apihost/some/path/resource/1234",
"specversion":"1.0",
"type":"my.example.event.v1",
"datacontenttype":"application/json",
"dataref":"http://apihost/some/api/v1/resource/1234",
"data":{
"hello": "world"
},
"dataschema":"http://apihost/schema/definition.json"
}
```### Behaviour
The success status of the application can be determined by checking the exit code.
If an error occurred or the configured thresholds have been violated the application will exit with
exit-code **1** instead of **0**.## Configuration
All the configuration properties can be set in your `config.yml` or with an environment variable.| Path | Variable | Type | Default | Description |
|------------------------------|------------------------------------|--------|--------------------------------------------|-------------------------------------------------|
| logLevel | PROBE_LOGLEVEL | string | info | Defines the log-level. |
| publishing.endpoint | PROBE_PUBLISHING_ENDPOINT | string | https://horizon.example.com/events | Horizon endpoint for publishing events. |
| publishing.oidc.url | PROBE_PUBLISHING_OIDC_URL | string | https://oidc.example.com/ | OIDC token endpoint of the idp. |
| publishing.oidc.clientId | PROBE_PUBLISHING_OIDC_CLIENTID | string | client-id | The client-id that is passed to the idp. |
| publishing.oidc.clientSecret | PROBE_PUBLISHING_OIDC_CLIENTSECRET | string | client-secret | The client-secret that is passed to the idp. |
| consuming.endpoint | PROBE_CONSUMING_ENDPOINT | string | https://horizon.example.com/sse/somesubid | Horizon endpoint for retrieving events via sse. |
| consuming.oidc.url | PROBE_CONSUMING_OIDC_URL | string | https://oidc.example.com/ | OIDC token endpoint of the idp. |
| consuming.oidc.clientId | PROBE_CONSUMING_OIDC_CLIENTID | string | client-id | The client-id that is passed to the idp. |
| consuming.oidc.clientSecret | PROBE_CONSUMING_OIDC_CLIENTSECRET | string | client-secret | The client-secret that is passed to the idp. |## Docker
Probe is supposed to run in a Docker container.
If you run Probe a container with the default command you can pass arguments through the following arguments.| Argument | Variable | Default |
|-----------------|-------------------------|---------------|
| --message-count | PROBE_ARG_MESSAGE_COUNT | 3 |
| --timeout | PROBE_ARG_TIMEOUT | 30s |
| --max-latency | PROBE_ARG_MAX_LATENCY | 5s |
| --template | PROBE_ARG_TEMPLATE | template.json |## Code of Conduct
This project has adopted the [Contributor Covenant](https://www.contributor-covenant.org/) in version 2.1 as our code of conduct. Please see the details in our [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md). All contributors must abide by the code of conduct.By participating in this project, you agree to abide by its [Code of Conduct](./CODE_OF_CONDUCT.md) at all times.
## Licensing
This project follows the [REUSE standard for software licensing](https://reuse.software/).
Each file contains copyright and license information, and license texts can be found in the [LICENSES](./LICENSES) folder. For more information visit https://reuse.software/.