Skip to content

Commit 2b0cad1

Browse files
authored
enhancement(antithesis): Move antithesis/deploy to scenarios/general (#1890)
## Summary I am slowly developing a House Style for `test/antithesis`. The next PR in this stack as of this writing -- #1891 -- introduces a new scenario with a new topology. Organizationally this means we have a 'general' scenario in this project already and my intention is to make a new scenario to differentially test Datadog Agent and ADP. There will be several PRs in a chain to reach a satisfying spot with that work. There's no functional change in this PR, just some code movement. <!-- Please provide a brief summary about what this PR does. This should help the reviewers give feedback faster and with higher quality. --> ## Change Type - [ ] Bug fix - [ ] New feature - [ ] Non-functional (chore, refactoring, docs) - [ ] Performance ## How did you test this PR? <!-- Please how you tested these changes here --> ## References <!-- Please list any issues closed by this PR. --> <!-- - Closes: <issue link> --> <!-- Any other issues or PRs relevant to this PR? Feel free to list them here. -->
1 parent 12ed5a2 commit 2b0cad1

17 files changed

Lines changed: 67 additions & 35 deletions

Cargo.lock

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ members = [
3434
"lib/stringtheory",
3535
"test/antithesis/harness",
3636
"test/antithesis/intake",
37+
"test/antithesis/scenarios/general",
3738
]
3839
resolver = "2"
3940

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,7 @@ endif
751751

752752
##@ Antithesis
753753

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

757757
.PHONY: check-antithesis-tools

test/antithesis/AGENTS.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Antithesis runs — do not run `snouty launch` directly.
1010

1111
**snouty launch**
1212

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

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

2828
**Directory layout**
2929

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

4143
**scratchbook**
4244

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

49-
**test templates** (`deploy/workload/test/`)
51+
**test templates** (`scenarios/general/workload/test/`)
5052

5153
This directory contains test templates. A test template is a directory
5254
containing test command executable files. Each test command must have a valid

test/antithesis/harness/src/bin/eventually_adp_alive.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ mod unix_check {
3333
adp_api_addr: String,
3434
#[arg(
3535
long = "dsd-socket",
36-
env = "DSD_SOCKET",
36+
env = "ADP_DOGSTATSD_SOCKET",
3737
default_value = "/var/run/datadog/dsd.socket"
3838
)]
3939
dsd_socket: PathBuf,

test/antithesis/harness/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
//! Shared helpers for the Antithesis harness, used by the `src/bin/*` test
2-
//! commands.
1+
//! Shared helpers for Antithesis test commands.
32
43
#[cfg(unix)]
54
pub mod driver;
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[package]
2+
name = "antithesis-scenario-general"
3+
version = "0.1.0"
4+
edition = { workspace = true }
5+
license = { workspace = true }
6+
repository = { workspace = true }
7+
publish = false
8+
9+
[lints]
10+
workspace = true
11+
12+
[dependencies]
13+
antithesis_sdk = { workspace = true, features = ["full", "rand_v0_10"] }
14+
anyhow = { workspace = true, features = ["std"] }
15+
clap = { workspace = true, features = ["derive", "env", "error-context", "help", "std", "usage"] }
16+
harness = { path = "../../harness" }
17+
ryu = { workspace = true }
18+
serde_json = { workspace = true }

test/antithesis/deploy/Dockerfile renamed to test/antithesis/scenarios/general/Dockerfile

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,11 @@ COPY . /tools
7676
RUN --mount=type=cache,target=/tools/target,id=antithesis-tools-target \
7777
--mount=type=cache,target=/root/.cargo/registry,id=cargo-registry \
7878
--mount=type=cache,target=/root/.cargo/git,id=cargo-git \
79-
cargo build --release \
80-
--bin antithesis-intake \
81-
--bin parallel_driver_send_dogstatsd --bin parallel_driver_sketchburst \
82-
--bin eventually_adp_alive \
83-
--bin first_sample_config && \
79+
cargo build --release --package antithesis-intake --bin antithesis-intake && \
80+
cargo build --release --package harness \
81+
--bin first_sample_config \
82+
--bin eventually_adp_alive && \
83+
cargo build --release --package antithesis-scenario-general --bins && \
8484
cp /tools/target/release/antithesis-intake /usr/local/bin/antithesis-intake && \
8585
cp /tools/target/release/parallel_driver_send_dogstatsd /usr/local/bin/parallel_driver_send_dogstatsd && \
8686
cp /tools/target/release/parallel_driver_sketchburst /usr/local/bin/parallel_driver_sketchburst && \
@@ -101,9 +101,9 @@ RUN mkdir -p /symbols && ln -s /usr/local/bin/agent-data-plane /symbols/agent-da
101101
# main.rs requires a config file at the default path. Ship a minimal standalone config as a
102102
# fallback. The boot wrapper overwrites it with the per-timeline config that first_sample_config
103103
# samples onto the shared `agent-config` volume.
104-
COPY test/antithesis/deploy/adp/datadog.yaml /etc/datadog-agent/datadog.yaml
104+
COPY test/antithesis/scenarios/general/adp/datadog.yaml /etc/datadog-agent/datadog.yaml
105105
# Boot wrapper waits for the config sentinel, copies the config into place, then execs ADP.
106-
COPY --chmod=755 test/antithesis/deploy/adp/entrypoint.sh /entrypoint.sh
106+
COPY --chmod=755 test/antithesis/scenarios/general/adp/entrypoint.sh /entrypoint.sh
107107
# ADP's control-plane secure API requires an IPC TLS cert (a single PEM holding both certificate and
108108
# private key) that the Core Agent normally generates. In standalone mode there is no Core Agent, so
109109
# generate a self-signed cert+key. An empty auth_token satisfies the IPC auth config at startup.
@@ -137,12 +137,12 @@ RUN test -d /usr/share/ca-certificates || ( \
137137
apt-get install --no-install-recommends -y ca-certificates && \
138138
rm -rf /var/lib/apt/lists/* )
139139
# Antithesis setup-complete helper and test templates (helper files + the "main" template dir).
140-
COPY --chmod=755 test/antithesis/deploy/workload/setup-complete.sh /opt/antithesis/setup-complete.sh
141-
COPY test/antithesis/deploy/workload/test/ /opt/antithesis/test/
140+
COPY --chmod=755 test/antithesis/scenarios/general/workload/setup-complete.sh /opt/antithesis/setup-complete.sh
141+
COPY test/antithesis/scenarios/general/workload/test/ /opt/antithesis/test/
142142
# Inject the compiled test-command binaries into the "main" test template.
143143
COPY --from=tools-builder --chmod=755 /usr/local/bin/first_sample_config /opt/antithesis/test/v1/main/first_sample_config
144144
COPY --from=tools-builder --chmod=755 /usr/local/bin/parallel_driver_send_dogstatsd /opt/antithesis/test/v1/main/parallel_driver_send_dogstatsd
145145
COPY --from=tools-builder --chmod=755 /usr/local/bin/parallel_driver_sketchburst /opt/antithesis/test/v1/main/parallel_driver_sketchburst
146146
COPY --from=tools-builder --chmod=755 /usr/local/bin/eventually_adp_alive /opt/antithesis/test/v1/main/eventually_adp_alive
147-
COPY --chmod=755 test/antithesis/deploy/workload/entrypoint.sh /entrypoint.sh
147+
COPY --chmod=755 test/antithesis/scenarios/general/workload/entrypoint.sh /entrypoint.sh
148148
ENTRYPOINT ["/entrypoint.sh"]
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)