Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(run-groups): add code sample and update concepts #3887

Merged
merged 1 commit into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/docs/concepts/run-groups.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Last, but not least important, if multiple tests are run inside a run group, the
## Using Run Groups from the CLI

:::note
[Check out the sample code on GitHub here.](https://github.com/kubeshop/tracetest/tree/main/examples/environment-automation)
[Check out the sample code on GitHub here.](https://github.com/kubeshop/tracetest/tree/main/examples/tracetest-run-groups-cli)
:::

You can run multiple tests at once by providing multiple `-f file.yaml` parameters to the `tracetest run test` command. These tests will be placed under the same run group.
Expand Down
6 changes: 6 additions & 0 deletions examples/tracetest-run-groups-cli/.env.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# GRPC
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT="http://tracetest-agent:4317/"
# or, use HTTP
# OTEL_EXPORTER_OTLP_TRACES_ENDPOINT="http://tracetest-agent:4318/v1/traces"
TRACETEST_API_KEY="<YOUR_TRACETEST_API_KEY>"
TRACETEST_API_TOKEN="<YOUR_TRACETEST_TOKEN>"
3 changes: 3 additions & 0 deletions examples/tracetest-run-groups-cli/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
.DS_Store
.env
7 changes: 7 additions & 0 deletions examples/tracetest-run-groups-cli/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM node:slim
WORKDIR /usr/src/app
COPY package*.json ./
RUN npm install
COPY . .
EXPOSE 8080
CMD [ "npm", "run", "with-grpc-tracer" ]
10 changes: 10 additions & 0 deletions examples/tracetest-run-groups-cli/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const express = require("express")
const app = express()
app.get("/", (req, res) => {
setTimeout(() => {
res.send("Hello World")
}, 1000);
})
app.listen(8080, () => {
console.log(`Listening for requests on http://localhost:8080`)
})
23 changes: 23 additions & 0 deletions examples/tracetest-run-groups-cli/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
version: '3'
services:
app:
image: tracetest-run-groups
extra_hosts:
- "host.docker.internal:host-gateway"
build: .
ports:
- "8080:8080"
environment:
- OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=${OTEL_EXPORTER_OTLP_TRACES_ENDPOINT}

# Cloud-based Managed Tracetest
tracetest-agent:
image: kubeshop/tracetest-agent:latest
command:
- "--mode=verbose"
environment:
# Find the Agent API Key here: https://docs.tracetest.io/configuration/agent
- TRACETEST_API_KEY=${TRACETEST_API_KEY}
ports:
- 4317:4317
- 4318:4318
Loading
Loading