Skip to content

Commit

Permalink
chore: update testkube integration docs (#3414)
Browse files Browse the repository at this point in the history
* chore: update testkube integration docs

* Apply suggestions from code review

Co-authored-by: Julianne Fermi <julianne@kubeshop.io>

* added PR suggestion

---------

Co-authored-by: Julianne Fermi <julianne@kubeshop.io>
  • Loading branch information
danielbdias and jfermi committed Nov 30, 2023
1 parent cab0d5d commit ac1257f
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 2 deletions.
27 changes: 27 additions & 0 deletions docs/docs/concepts/environment-token.mdx
@@ -0,0 +1,27 @@
---
id: environment-tokens
title: Environment Tokens
description: Environment Tokens are strings used to authenticate Tracetest CLI against an organization and environment.
hide_table_of_contents: false
keywords:
- tracetest
- trace-based testing
- observability
- distributed tracing
- testing
image: https://res.cloudinary.com/djwdcmwdz/image/upload/v1698686403/docs/Blog_Thumbnail_14_rsvkmo.jpg
---

Environment Tokens are strings used to authenticate the Tracetest CLI against an organization and environment.

![](https://res.cloudinary.com/djwdcmwdz/image/upload/v1701296331/docs/environment-tokens_gkt9kx.png)

These tokens are used to configure the Tracetest CLI in environment where you cannot login with user interaction, like CI/CD environments.

Create a new token by clicking on the `Create a new token` button, choosing a name, role and expiration and then clicking on `Create`. This will create a token that you can copy and use to configure Tracetest CLI with:

```bash
tracetest configure --token {ADD_YOUR_TOKEN_HERE}
```

One example of this usage can be seen [here](https://github.com/kubeshop/tracetest/blob/main/.github/workflows/scheduled-jobs.yml#L23).
11 changes: 9 additions & 2 deletions docs/docs/tools-and-integrations/testkube.mdx
Expand Up @@ -64,7 +64,7 @@ This guide will show how to use Testkube alongside Tracetest to run your tests i
In your Kubernetes cluster you should have:

1. `Testkube`: Use HELM or the Testkube CLI to [install](https://kubeshop.github.io/testkube/installing) Testkube Server components in your cluster.
2. `Trecetest Server`: You need a running instance of Tracetest which is going to be executing your assertions. To do so you can follow the instructions defined in the Tracetest [documentation](https://docs.tracetest.io/deployment/kubernetes).
2. `Tracetest`: You need a running instance of [Tracetest](https://docs.tracetest.io/getting-started/installation/) or [Tracetest Core](https://docs.tracetest.io/core/getting-started/installation/) which is going to be executing your assertions. To do so, you can follow the instructions defined in the Tracetest [documentation](https://docs.tracetest.io/getting-started/overview).
3. `OpenTelemetry Instrumented Service`: In order to generate traces and spans, the service under test must support the basics for [propagation](https://opentelemetry.io/docs/reference/specification/context/api-propagators/) through HTTP requests, and also store traces and spans into a Data Store Backend (Jaeger, Grafana Tempo, OpenSearch, etc) or use the [OpenTelemetry Collector](https://docs.tracetest.io/configuration/overview#using-tracetest-without-a-trace-data-store).

On your machine you should have:
Expand Down Expand Up @@ -113,14 +113,21 @@ spec:
- attr:db.name = "pokeshop"
```

Execute the following command to create the test executor object in Testkube. Do not forget to provide the path to your Tracetest definition file using the `--file` argument, and also the Tracetest Server endpoint using the `TRACETEST_ENDPOINT` `--variable` (remember that the TRACETEST_ENDPOINT should be reachable from the Testkube instance):
Execute the following command to create the test executor object in Testkube. Do not forget to provide the path to your Tracetest definition file using the `--file` argument, and also the follow variables:
- **If you are using [Tracetest Core](https://docs.tracetest.io/core/getting-started/installation/)**: Define the Tracetest Server endpoint using the `TRACETEST_ENDPOINT` `--variable` (remember that the TRACETEST_ENDPOINT should be reachable from the Testkube instance).

```bash
kubectl testkube create test --file my/file/location.yaml --type "tracetest/test" --name pokeshop-tracetest-test --variable TRACETEST_ENDPOINT=http://tracetest
```

Note: In case you are doing a port forward to your Tracetest instance and you want to have the correct Tracetest URL in your results printed by the Testkube output, you can also provide an optional `TRACETEST_OUTPUT_ENDPOINT` variable (e.g. `--variable TRACETEST_OUTPUT_ENDPOINT=http://localhost:11633`).

- **If you are using [Tracetest](https://docs.tracetest.io/getting-started/installation/) on `app.tracetest.io` **: Define your [token](../concepts/environment-token.mdx), [environment](../concepts/environments.mdx) and [organization](../concepts/organizations.mdx) using the `TRACETEST_TOKEN`, `TRACETEST_ENVIRONMENT` and `TRACETEST_ORGANIZATION` variables

```bash
kubectl testkube create test --file my/file/location.yaml --type "tracetest/test" --name pokeshop-tracetest-test --variable TRACETEST_TOKEN=your-token --variable TRACETEST_ENVIRONMENT=your-environment-id --variable TRACETEST_ORGANIZATION=your-organization-id
```

### 3. Run the Test

Finally, to see the integration working, run the test by executing the following command:
Expand Down
5 changes: 5 additions & 0 deletions docs/sidebars.js
Expand Up @@ -628,6 +628,11 @@ const sidebars = {
id: "concepts/environments",
label: "Environments",
},
{
type: "doc",
id: "concepts/environment-tokens",
label: "Environment Tokens",
},
{
type: "doc",
id: "concepts/assertions",
Expand Down

0 comments on commit ac1257f

Please sign in to comment.