From 34508af2a60e7433c2511196899f27e45ae89e51 Mon Sep 17 00:00:00 2001 From: Daniel Dias Date: Wed, 29 Nov 2023 19:34:07 -0300 Subject: [PATCH 1/3] chore: update testkube integration docs --- docs/docs/concepts/environment-token.mdx | 27 +++++++++++++++++++ docs/docs/tools-and-integrations/testkube.mdx | 11 ++++++-- docs/sidebars.js | 5 ++++ 3 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 docs/docs/concepts/environment-token.mdx diff --git a/docs/docs/concepts/environment-token.mdx b/docs/docs/concepts/environment-token.mdx new file mode 100644 index 0000000000..7643a2eaaf --- /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 Tracetest CLI against an organization and environment. + +![](https://res.cloudinary.com/djwdcmwdz/image/upload/v1701296331/docs/environment-tokens_gkt9kx.png) + +These tokens ared used to configure Tracetest CLI in environment that 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..f29c92d5f1 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 the your [token](../concepts/environment-token.mdx), [environment](../concepts/environments.mdx) and [organization](../concepts/organizations.mdx) using the `TRACETEST_TOKEN`, `TRACETEST_ENVIRONMENT` and `TRACETEST_ORGANIZATION` `--variable`s + +```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 20cb52c22f..acda47c1a5 100644 --- a/docs/sidebars.js +++ b/docs/sidebars.js @@ -623,6 +623,11 @@ const sidebars = { id: "concepts/environments", label: "Environments", }, + { + type: "doc", + id: "concepts/environment-tokens", + label: "Environment Tokens", + }, { type: "doc", id: "concepts/assertions", From 7480deb90df51105b591cf45dfc41fba3d8d2742 Mon Sep 17 00:00:00 2001 From: Daniel Baptista Dias Date: Thu, 30 Nov 2023 11:19:33 -0300 Subject: [PATCH 2/3] Apply suggestions from code review Co-authored-by: Julianne Fermi --- docs/docs/concepts/environment-token.mdx | 4 ++-- docs/docs/tools-and-integrations/testkube.mdx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/docs/concepts/environment-token.mdx b/docs/docs/concepts/environment-token.mdx index 7643a2eaaf..9b243e3530 100644 --- a/docs/docs/concepts/environment-token.mdx +++ b/docs/docs/concepts/environment-token.mdx @@ -12,11 +12,11 @@ keywords: image: https://res.cloudinary.com/djwdcmwdz/image/upload/v1698686403/docs/Blog_Thumbnail_14_rsvkmo.jpg --- -Environment Tokens are strings used to authenticate Tracetest CLI against an organization and environment. +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 ared used to configure Tracetest CLI in environment that you cannot login with user interaction, like CI/CD environments. +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: diff --git a/docs/docs/tools-and-integrations/testkube.mdx b/docs/docs/tools-and-integrations/testkube.mdx index f29c92d5f1..4c8797768d 100644 --- a/docs/docs/tools-and-integrations/testkube.mdx +++ b/docs/docs/tools-and-integrations/testkube.mdx @@ -114,7 +114,7 @@ spec: ``` 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) +- **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 From 22e8c8532d4757355ed8c8de2a6de60ea45f081f Mon Sep 17 00:00:00 2001 From: Daniel Dias Date: Thu, 30 Nov 2023 11:24:52 -0300 Subject: [PATCH 3/3] added PR suggestion --- docs/docs/tools-and-integrations/testkube.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docs/tools-and-integrations/testkube.mdx b/docs/docs/tools-and-integrations/testkube.mdx index 4c8797768d..77efe8cfc7 100644 --- a/docs/docs/tools-and-integrations/testkube.mdx +++ b/docs/docs/tools-and-integrations/testkube.mdx @@ -122,7 +122,7 @@ 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 the your [token](../concepts/environment-token.mdx), [environment](../concepts/environments.mdx) and [organization](../concepts/organizations.mdx) using the `TRACETEST_TOKEN`, `TRACETEST_ENVIRONMENT` and `TRACETEST_ORGANIZATION` `--variable`s +- **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