Skip to content
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
12 changes: 12 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ members = [
"lib/stringtheory",
"test/antithesis/harness",
"test/antithesis/intake",
"test/antithesis/scenarios/general",
]
resolver = "2"

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,7 @@ endif

##@ Antithesis

ANTITHESIS_CONFIG_DIR := test/antithesis/deploy
ANTITHESIS_CONFIG_DIR := test/antithesis/scenarios/general
ANTITHESIS_COMPOSE_FILE := $(ANTITHESIS_CONFIG_DIR)/docker-compose.yaml

.PHONY: check-antithesis-tools
Expand Down
24 changes: 13 additions & 11 deletions test/antithesis/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Antithesis runs — do not run `snouty launch` directly.

**snouty launch**

Use `snouty launch --json --webhook basic_test --config test/antithesis/deploy`
Use `snouty launch --json --webhook basic_test --config test/antithesis/scenarios/general`
to start an Antithesis run. Always run `compose build` first to ensure images
are up to date.

Expand All @@ -27,16 +27,18 @@ testing. Antithesis will not run any test commands until it receives this event.

**Directory layout**

- `harness/` — the harness Rust crate (`harness`), a member of the
repository-root workspace. `src/lib.rs` holds shared helpers; each
`src/bin/*.rs` is an Antithesis test command named after its file. Run cargo
from this directory; it is built, fmt'd, Clippy'd, and tested from the repo
root via the usual `make check-all` / `make test`.
- `deploy/` — all Antithesis/Docker infrastructure: the `Dockerfile`,
- `harness/` — the shared harness Rust crate (`harness`), a member of the
repository-root workspace. `src/lib.rs` holds shared helpers and `src/bin/`
holds test commands reused across scenarios. Run cargo from this directory;
it is built, fmt'd, Clippy'd, and tested from the repo root via the usual
`make check-all` / `make test`.
- `scenarios/general/` — all Antithesis/Docker infrastructure: the `Dockerfile`,
`docker-compose.yaml`, and per-container build inputs grouped by service
(`deploy/adp/`, `deploy/workload/`). This is the directory snouty consumes as
`--config`; it contains `docker-compose.yaml` at its top. Snouty will push
tagged images, consume this directory, and launch the run.
(`scenarios/general/adp/`, `scenarios/general/workload/`). This is the directory snouty consumes as
`--config`; it contains `docker-compose.yaml` at its top. Its Cargo package
(`antithesis-scenario-general`) owns general-only test commands under
`src/bin/`. Snouty will push tagged images, consume this directory, and
launch the run.

**scratchbook**

Expand All @@ -46,7 +48,7 @@ per-property evidence files (in `scratchbook/properties/`), property
relationship maps, and other persistent integration notes. Keep it up to date as
Antithesis-related decisions change.

**test templates** (`deploy/workload/test/`)
**test templates** (`scenarios/general/workload/test/`)

This directory contains test templates. A test template is a directory
containing test command executable files. Each test command must have a valid
Expand Down
2 changes: 1 addition & 1 deletion test/antithesis/harness/src/bin/eventually_adp_alive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ mod unix_check {
adp_api_addr: String,
#[arg(
long = "dsd-socket",
env = "DSD_SOCKET",
env = "ADP_DOGSTATSD_SOCKET",
default_value = "/var/run/datadog/dsd.socket"
)]
dsd_socket: PathBuf,
Expand Down
3 changes: 1 addition & 2 deletions test/antithesis/harness/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//! Shared helpers for the Antithesis harness, used by the `src/bin/*` test
//! commands.
//! Shared helpers for Antithesis test commands.

#[cfg(unix)]
pub mod driver;
Expand Down
18 changes: 18 additions & 0 deletions test/antithesis/scenarios/general/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[package]
name = "antithesis-scenario-general"
version = "0.1.0"
edition = { workspace = true }
license = { workspace = true }
repository = { workspace = true }
publish = false

[lints]
workspace = true

[dependencies]
antithesis_sdk = { workspace = true, features = ["full", "rand_v0_10"] }
anyhow = { workspace = true, features = ["std"] }
clap = { workspace = true, features = ["derive", "env", "error-context", "help", "std", "usage"] }
harness = { path = "../../harness" }
ryu = { workspace = true }
serde_json = { workspace = true }
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@ COPY . /tools
RUN --mount=type=cache,target=/tools/target,id=antithesis-tools-target \
--mount=type=cache,target=/root/.cargo/registry,id=cargo-registry \
--mount=type=cache,target=/root/.cargo/git,id=cargo-git \
cargo build --release \
--bin antithesis-intake \
--bin parallel_driver_send_dogstatsd --bin parallel_driver_sketchburst \
--bin eventually_adp_alive \
--bin first_sample_config && \
cargo build --release --package antithesis-intake --bin antithesis-intake && \
cargo build --release --package harness \
--bin first_sample_config \
--bin eventually_adp_alive && \
cargo build --release --package antithesis-scenario-general --bins && \
cp /tools/target/release/antithesis-intake /usr/local/bin/antithesis-intake && \
cp /tools/target/release/parallel_driver_send_dogstatsd /usr/local/bin/parallel_driver_send_dogstatsd && \
cp /tools/target/release/parallel_driver_sketchburst /usr/local/bin/parallel_driver_sketchburst && \
Expand All @@ -101,9 +101,9 @@ RUN mkdir -p /symbols && ln -s /usr/local/bin/agent-data-plane /symbols/agent-da
# main.rs requires a config file at the default path. Ship a minimal standalone config as a
# fallback. The boot wrapper overwrites it with the per-timeline config that first_sample_config
# samples onto the shared `agent-config` volume.
COPY test/antithesis/deploy/adp/datadog.yaml /etc/datadog-agent/datadog.yaml
COPY test/antithesis/scenarios/general/adp/datadog.yaml /etc/datadog-agent/datadog.yaml
# Boot wrapper waits for the config sentinel, copies the config into place, then execs ADP.
COPY --chmod=755 test/antithesis/deploy/adp/entrypoint.sh /entrypoint.sh
COPY --chmod=755 test/antithesis/scenarios/general/adp/entrypoint.sh /entrypoint.sh
# ADP's control-plane secure API requires an IPC TLS cert (a single PEM holding both certificate and
# private key) that the Core Agent normally generates. In standalone mode there is no Core Agent, so
# generate a self-signed cert+key. An empty auth_token satisfies the IPC auth config at startup.
Expand Down Expand Up @@ -137,12 +137,12 @@ RUN test -d /usr/share/ca-certificates || ( \
apt-get install --no-install-recommends -y ca-certificates && \
rm -rf /var/lib/apt/lists/* )
# Antithesis setup-complete helper and test templates (helper files + the "main" template dir).
COPY --chmod=755 test/antithesis/deploy/workload/setup-complete.sh /opt/antithesis/setup-complete.sh
COPY test/antithesis/deploy/workload/test/ /opt/antithesis/test/
COPY --chmod=755 test/antithesis/scenarios/general/workload/setup-complete.sh /opt/antithesis/setup-complete.sh
COPY test/antithesis/scenarios/general/workload/test/ /opt/antithesis/test/
# Inject the compiled test-command binaries into the "main" test template.
COPY --from=tools-builder --chmod=755 /usr/local/bin/first_sample_config /opt/antithesis/test/v1/main/first_sample_config
COPY --from=tools-builder --chmod=755 /usr/local/bin/parallel_driver_send_dogstatsd /opt/antithesis/test/v1/main/parallel_driver_send_dogstatsd
COPY --from=tools-builder --chmod=755 /usr/local/bin/parallel_driver_sketchburst /opt/antithesis/test/v1/main/parallel_driver_sketchburst
COPY --from=tools-builder --chmod=755 /usr/local/bin/eventually_adp_alive /opt/antithesis/test/v1/main/eventually_adp_alive
COPY --chmod=755 test/antithesis/deploy/workload/entrypoint.sh /entrypoint.sh
COPY --chmod=755 test/antithesis/scenarios/general/workload/entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ services:
platform: linux/amd64
init: true
build:
context: ../../..
dockerfile: test/antithesis/deploy/Dockerfile
context: ../../../..
dockerfile: test/antithesis/scenarios/general/Dockerfile
target: intake
image: intake:latest
environment:
Expand All @@ -26,8 +26,8 @@ services:
platform: linux/amd64
init: true
build:
context: ../../..
dockerfile: test/antithesis/deploy/Dockerfile
context: ../../../..
dockerfile: test/antithesis/scenarios/general/Dockerfile
target: adp
image: adp:latest
command: ["run"]
Expand All @@ -51,13 +51,13 @@ services:
platform: linux/amd64
init: true
build:
context: ../../..
dockerfile: test/antithesis/deploy/Dockerfile
context: ../../../..
dockerfile: test/antithesis/scenarios/general/Dockerfile
target: workload
image: workload:latest
environment:
NO_COLOR: "1"
DSD_SOCKET: "/var/run/datadog/dsd.socket"
ADP_DOGSTATSD_SOCKET: "/var/run/datadog/dsd.socket"
INTAKE_ADDR: "intake:2049"
volumes:
- dogstatsd-socket:/var/run/datadog
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ mod unix_driver {
struct Config {
#[arg(
long = "dogstatsd-socket",
env = "DSD_SOCKET",
env = "ADP_DOGSTATSD_SOCKET",
default_value = "/var/run/datadog/dsd.socket"
)]
dogstatsd_socket: PathBuf,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ mod unix_driver {
struct Config {
#[arg(
long = "dogstatsd-socket",
env = "DSD_SOCKET",
env = "ADP_DOGSTATSD_SOCKET",
default_value = "/var/run/datadog/dsd.socket"
)]
dogstatsd_socket: PathBuf,
Expand Down
2 changes: 1 addition & 1 deletion test/antithesis/scratchbook/w-property-intake.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ those riding as extensions. W6 reads the decompressed length in the handler.
## Hostname and W17

W17 resolves each series host against `DD_HOSTNAME`, default `antithesis-adp`.
Keep it in sync with `hostname:` in `test/antithesis/deploy/adp/datadog.yaml`. The `intake`
Keep it in sync with `hostname:` in `test/antithesis/scenarios/general/adp/datadog.yaml`. The `intake`
image sets `DD_HOSTNAME=antithesis-adp`.

Source-confirmed contract. The Agent emits a `type=host` resource on every v2
Expand Down