diff --git a/docs/docs/concepts/environment-token.mdx b/docs/docs/concepts/environment-token.mdx new file mode 100644 index 0000000000..9b243e3530 --- /dev/null +++ b/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). diff --git a/docs/docs/tools-and-integrations/testkube.mdx b/docs/docs/tools-and-integrations/testkube.mdx index c885a96a7c..77efe8cfc7 100644 --- a/docs/docs/tools-and-integrations/testkube.mdx +++ b/docs/docs/tools-and-integrations/testkube.mdx @@ -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: @@ -113,7 +113,8 @@ 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 @@ -121,6 +122,12 @@ kubectl testkube create test --file my/file/location.yaml --type "tracetest/test 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: diff --git a/docs/sidebars.js b/docs/sidebars.js index 42532712c7..c873132206 100644 --- a/docs/sidebars.js +++ b/docs/sidebars.js @@ -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",