Skip to content

Commit

Permalink
docs(run-groups): add code sample and update concepts (#3887)
Browse files Browse the repository at this point in the history
  • Loading branch information
Adnan Rahić authored Jun 3, 2024
1 parent 21d9969 commit f68fd04
Show file tree
Hide file tree
Showing 14 changed files with 4,996 additions and 1 deletion.
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

0 comments on commit f68fd04

Please sign in to comment.