Compare commits

...

4 Commits

Author SHA1 Message Date
Ashwin Bhatkal
b3f7970b96 ci(e2e): save main's server binary in cacheci 2026-11-03 22:58:22 +05:30
Ashwin Bhatkal
47a2ce14a6 feat(tests): add --prebuilt-signoz to run an existing signoz image 2026-11-03 22:58:22 +05:30
Ashwin Bhatkal
3be463e06a ci(e2e): pin Node 22 2026-11-03 22:58:22 +05:30
Ashwin Bhatkal
e11224105c ci(e2e): run the suite on 10 shards 2026-11-03 22:58:21 +05:30
7 changed files with 62 additions and 22 deletions

View File

@@ -46,8 +46,34 @@ jobs:
docker build -f "$RUNNER_TEMP/inject.Dockerfile" "$RUNNER_TEMP/cacheci"
- name: build
run: |
docker build -f cmd/enterprise/Dockerfile.integration --build-arg TARGETARCH=amd64 --build-arg ZEUSURL=http://zeus:8080 .
docker build -f cmd/enterprise/Dockerfile.integration --tag signoz:integration --build-arg TARGETARCH=amd64 --build-arg ZEUSURL=http://zeus:8080 .
docker build -f cmd/enterprise/Dockerfile.with-web.integration --build-arg TARGETARCH=amd64 --build-arg ZEUSURL=http://zeus:8080 .
# e2eci runs this server binary for changes that leave the server as it
# is here, and builds only the web.
- name: e2e-signoz-key
id: e2e-signoz-key
run: |
echo "key=$(tests/e2e/scripts/signoz-key.sh)" >> "$GITHUB_OUTPUT"
- name: e2e-signoz
run: |
mkdir -p "$RUNNER_TEMP/e2e-signoz"
id=$(docker create signoz:integration)
docker cp "$id":/root/signoz "$RUNNER_TEMP/e2e-signoz/signoz"
docker rm "$id"
- name: save-e2e-signoz
uses: actions/cache/save@v4
with:
path: ${{ runner.temp }}/e2e-signoz
key: ${{ steps.e2e-signoz-key.outputs.key }}
# Older keys only match commits main has moved past.
- name: prune-e2e-signoz
env:
GH_TOKEN: ${{ github.token }}
KEY: ${{ steps.e2e-signoz-key.outputs.key }}
run: |
gh cache list --repo "$GITHUB_REPOSITORY" --key e2e-signoz- --json key --jq '.[].key' \
| grep -vxF "$KEY" \
| xargs -r -n 1 gh cache delete --repo "$GITHUB_REPOSITORY"
# docker cp instead of --output type=local (the local exporter stalls on
# multi-GB outputs); tarballs instead of raw trees so the host never hits
# the permission and symlink semantics that broke docker cp.

View File

@@ -47,7 +47,7 @@ jobs:
- name: node
uses: actions/setup-node@v4
with:
node-version: lts/*
node-version: "22"
- name: install-pnpm
uses: pnpm/action-setup@v6
with:
@@ -67,7 +67,7 @@ jobs:
matrix:
project:
- chromium
shard: [1, 2, 3, 4]
shard: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
needs: changes
if: needs.changes.outputs.e2e == 'true'
runs-on: ubuntu-latest
@@ -105,7 +105,7 @@ jobs:
- name: node
uses: actions/setup-node@v4
with:
node-version: lts/*
node-version: "22"
- name: install-pnpm
uses: pnpm/action-setup@v6
with:
@@ -162,7 +162,7 @@ jobs:
- name: playwright-test
run: |
cd tests/e2e && \
pnpm playwright test --project=${{ matrix.project }} --shard=${{ matrix.shard }}/4
pnpm playwright test --project=${{ matrix.project }} --shard=${{ matrix.shard }}/10
- name: teardown-stack
if: always()
run: |

View File

@@ -352,6 +352,7 @@ The same pytest flags integration tests expose work here, since E2E reuses the s
- `--teardown` — tear everything down.
- `--clean` — prune the docker build caches, forcing the next image build to start cold.
- `--with-web` — build the frontend into the SigNoz container. **Required for E2E**; integration tests don't need it.
- `--prebuilt-signoz` — run the `signoz:integration` image already in the local image store instead of building it. The image must be built with `ZEUSURL=http://zeus:8080`. CI uses it when main's server binary matches the change.
- `--sqlstore-provider`, `--postgres-version`, `--clickhouse-version`, etc. — see `docs/contributing/tests/integration.md`.
## What should I remember?

View File

@@ -88,6 +88,12 @@ def pytest_addoption(parser: pytest.Parser):
default=False,
help="Build and run with web. Run pytest --basetemp=./tmp/ -vv --with-web src/bootstrap/setup::test_setup to setup your local dev environment with web.",
)
parser.addoption(
"--prebuilt-signoz",
action="store_true",
default=False,
help="Run the signoz:integration image already in the local image store instead of building it. The image must be built with ZEUSURL=http://zeus:8080.",
)
parser.addoption(
"--sqlstore-provider",
action="store",

View File

@@ -0,0 +1,4 @@
#!/usr/bin/env bash
set -euo pipefail
echo "e2e-signoz-$(git rev-parse HEAD:cmd HEAD:ee HEAD:pkg HEAD:go.mod HEAD:go.sum HEAD:.dockerignore HEAD:.github/workflows/cacheci.yml | sha256sum | cut -c1-32)"

View File

@@ -28,6 +28,8 @@ def zeus(
def create() -> types.TestContainerDocker:
container = WireMockContainer(image="wiremock/wiremock:2.35.1-1", secure=False)
container.with_network(network)
# The zeus address in images built for --prebuilt-signoz.
container.with_network_aliases("zeus")
container.start()
return types.TestContainerDocker(

View File

@@ -58,23 +58,24 @@ def create_signoz(
# The docker CLI is required: the Dockerfiles use BuildKit cache
# mounts, which docker-py does not support.
subprocess.run(
[
"docker",
"build",
"--file",
str(context / dockerfile_path),
"--tag",
"signoz:integration",
"--build-arg",
f"TARGETARCH={arch}",
"--build-arg",
f"ZEUSURL={zeus.container_configs['8080'].base()}",
str(context),
],
check=True,
env=os.environ | {"DOCKER_BUILDKIT": "1"},
)
if not pytestconfig.getoption("--prebuilt-signoz"):
subprocess.run(
[
"docker",
"build",
"--file",
str(context / dockerfile_path),
"--tag",
"signoz:integration",
"--build-arg",
f"TARGETARCH={arch}",
"--build-arg",
f"ZEUSURL={zeus.container_configs['8080'].base()}",
str(context),
],
check=True,
env=os.environ | {"DOCKER_BUILDKIT": "1"},
)
env = (
{