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
47 changes: 4 additions & 43 deletions .agents/skills/code-test/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ All test commands use cargo-nextest exclusively. If not available ask the user t
- [Run Unit Tests Only](#run-unit-tests-only)
- [Run Integration Tests](#run-integration-tests-requires-external-dependencies)
- [Run E2E Tests](#run-e2e-tests-requires-external-dependencies)
- [Run Ampup Tests](#run-ampup-tests-requires-external-dependencies)
- [Per-Crate Targeted Testing](#per-crate-targeted-testing)
- [Important Guidelines](#important-guidelines)
- [Cargo Nextest](#cargo-nextest)
Expand Down Expand Up @@ -90,7 +89,7 @@ Examples:
```bash
just test-unit [EXTRA_FLAGS]
```
Runs only unit tests using the `unit` nextest profile. Excludes integration tests (`it_*`), the top-level `tests` package, and the `ampup` package.
Runs only unit tests using the `unit` nextest profile. Excludes integration tests (`it_*`), the top-level `tests` package.

**Use this when**: You want fast feedback on pure logic changes. Unit tests have no external dependencies.

Expand All @@ -102,7 +101,7 @@ Examples:
```bash
just test-integration [EXTRA_FLAGS]
```
Runs integration tests (`it_*` tests across all crates) using the `integration` nextest profile. Excludes the top-level `tests` package and `ampup` package.
Runs integration tests (`it_*` tests across all crates) using the `integration` nextest profile. Excludes the top-level `tests` package.

**⚠️ WARNING**: Integration tests require external dependencies (databases, Firehose endpoints, etc.).

Expand All @@ -126,44 +125,6 @@ Examples:
- `just test-e2e` - run all e2e tests
- `just test-e2e test_name` - run specific e2e test

### Run Ampup Tests (REQUIRES EXTERNAL DEPENDENCIES)
```bash
just test-ampup [EXTRA_FLAGS]
```
Runs tests for the ampup package using the `ampup` nextest profile.

**⚠️ WARNING**: May require external dependencies.

Examples:
- `just test-ampup` - run ampup tests

### Per-Crate Targeted Testing

For targeted testing within a single crate, use `cargo nextest run` directly:

```bash
# Unit tests for a specific crate (skip in-tree integration tests)
cargo nextest run -p metadata-db -E 'not test(/::it_/)'

# Specific module's unit tests
cargo nextest run -p metadata-db -E 'test(/workers::tests::/)'

# In-tree integration tests for a crate
cargo nextest run -p metadata-db -E 'test(/::it_/)'

# Specific in-tree integration test suite
cargo nextest run -p metadata-db -E 'test(/::it_workers/)'

# Public API integration tests for a crate
cargo nextest run -p metadata-db -E 'kind(test)'

# Specific public API integration test file
cargo nextest run -p metadata-db -E 'test(it_api_workers)'

# Run a single test by name
cargo nextest run -p metadata-db -E 'test(=my_exact_test_name)'
```

## Important Guidelines

### Cargo Nextest
Expand All @@ -184,7 +145,7 @@ This test command is pre-approved and can be run without user permission:
1. **During local development**: Prefer targeted tests first; use `just test-local` only for broader confidence
2. **Before commits (local)**: Run the smallest relevant test scope; broaden only if the change is risky or cross-cutting
3. **In CI environments**: The CI system will run `just test` or other commands
4. **Local development**: Never run `just test`, `just test-integration`, `just test-e2e`, or `just test-ampup` locally. Those are for CI
4. **Local development**: Never run `just test`, `just test-integration` or `just test-e2e` locally. Those are for CI
5. **Codex sandbox**: Run tests only when warranted; prefer targeted scope. If running `just test-local`, request escalation (outside the sandbox)

### External Dependencies Required by Non-Local Tests
Expand Down Expand Up @@ -288,4 +249,4 @@ After required tests pass:
- E2E tests are in the top-level `tests/` package
- Some tests require external dependencies (databases, services)
- Test configurations are defined in `.config/nextest.toml`
- Nextest profiles: `default`, `unit`, `integration`, `e2e`, `local`, `ampup`
- Nextest profiles: `default`, `unit`, `integration`, `e2e`, `local`
10 changes: 3 additions & 7 deletions .config/nextest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,22 @@

# Unit tests: #[cfg(test)] tests in lib and bin targets (excluding it_* modules)
[profile.unit]
default-filter = '(kind(lib) + kind(bin)) - test(/::it_/) - package(tests) - package(ampup)'
default-filter = '(kind(lib) + kind(bin)) - test(/::it_/) - package(tests)'

# Integration tests: <crate>/tests/ directories and it_* modules in lib/bin sources
[profile.integration]
default-filter = '(kind(test) + test(/::it_/)) - package(tests) - package(ampup)'
default-filter = '(kind(test) + test(/::it_/)) - package(tests)'
retries = 1

# E2E tests: top-level tests/ package
[profile.e2e]
default-filter = 'package(tests)'
retries = 1

[profile.ampup]
default-filter = 'package(ampup)'

[profile.local]
# Local development: all tests except ampup, external deps, and flaky tests
# Local development: all tests except external deps, and flaky tests
default-filter = '''
all()
- package(ampup)
- test(tests::it_admin_api_datasets_stop_job::stop_already_stopped_job_is_idempotent)
- test(tests::it_admin_api_datasets_stop_job::stop_completed_job_is_idempotent)
- test(tests::it_admin_api_datasets_stop_job::stop_running_job_succeeds)
Expand Down
16 changes: 4 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,12 @@ jobs:
- name: Build binaries
run: |
export RUSTFLAGS="-C link-arg=-fuse-ld=mold ${RUSTFLAGS}"
cargo build --target ${{ matrix.target }} --release -v -p ampd -p ampctl -p ampup -p ampsync
cargo build --target ${{ matrix.target }} --release -v -p ampd -p ampctl -p ampsync
- name: Compress debug sections (Linux only)
if: contains(matrix.target, 'linux')
run: |
for binary in ampd ampctl ampup ampsync; do
for binary in ampd ampctl ampsync; do
path="target/${{ matrix.target }}/release/$binary"
size_before=$(stat -c%s "$path")
objcopy --compress-debug-sections=zlib-gnu "$path"
Expand All @@ -142,7 +142,6 @@ jobs:
path: |
target/${{ matrix.target }}/release/ampd
target/${{ matrix.target }}/release/ampctl
target/${{ matrix.target }}/release/ampup
target/${{ matrix.target }}/release/ampsync
compression-level: 0
retention-days: 30
Expand Down Expand Up @@ -173,7 +172,7 @@ jobs:
rustflags: ""

- name: Build binaries
run: cargo build --target ${{ matrix.target }} --release -v -p ampd -p ampctl -p ampup -p ampsync
run: cargo build --target ${{ matrix.target }} --release -v -p ampd -p ampctl -p ampsync

- name: Upload artifacts
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6
Expand All @@ -182,7 +181,6 @@ jobs:
path: |
target/${{ matrix.target }}/release/ampd
target/${{ matrix.target }}/release/ampctl
target/${{ matrix.target }}/release/ampup
target/${{ matrix.target }}/release/ampsync
compression-level: 0
retention-days: 30
Expand All @@ -196,7 +194,7 @@ jobs:
strategy:
fail-fast: false
matrix:
binary: [ampd, ampctl, ampup, ampsync]
binary: [ampd, ampctl, ampsync]
target: [x86_64-apple-darwin, aarch64-apple-darwin]

steps:
Expand Down Expand Up @@ -297,12 +295,6 @@ jobs:
cp artifacts/x86_64-apple-darwin-ampctl-notarized/ampctl release/ampctl-darwin-x86_64
cp artifacts/aarch64-apple-darwin-ampctl-notarized/ampctl release/ampctl-darwin-aarch64
# Copy and rename ampup binaries
cp artifacts/x86_64-unknown-linux-gnu/ampup release/ampup-linux-x86_64
cp artifacts/aarch64-unknown-linux-gnu/ampup release/ampup-linux-aarch64
cp artifacts/x86_64-apple-darwin-ampup-notarized/ampup release/ampup-darwin-x86_64
cp artifacts/aarch64-apple-darwin-ampup-notarized/ampup release/ampup-darwin-aarch64
# Copy and rename ampsync binaries
cp artifacts/x86_64-unknown-linux-gnu/ampsync release/ampsync-linux-x86_64
cp artifacts/aarch64-unknown-linux-gnu/ampsync release/ampsync-linux-aarch64
Expand Down
26 changes: 0 additions & 26 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -171,32 +171,6 @@ jobs:
SOLANA_MAINNET_RPC_AUTH_HEADER: ${{ secrets.SOLANA_MAINNET_RPC_AUTH_HEADER }}
SOLANA_MAINNET_RPC_AUTH_TOKEN: ${{ secrets.SOLANA_MAINNET_RPC_AUTH_TOKEN }}

test-ampup:
name: Ampup tests
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6

- uses: actions-rust-lang/setup-rust-toolchain@1780873c7b576612439a134613cc4cc74ce5538c # v1
with:
cache: true
rustflags: ""

- name: Setup just
uses: extractions/setup-just@e33e0265a09d6d736e2ee1e0eb685ef1de4669ff # v3

- name: Install cargo-nextest
uses: baptiste0928/cargo-install@b687c656bda5733207e629b50a22bf68974a0305 # v3
with:
crate: cargo-nextest
version: ^0.9

- name: Run ampup tests
run: just test-ampup --verbose
env:
GITHUB_TOKEN: ${{ github.token }}

rustfmt:
name: Check rustfmt style
runs-on: ubuntu-latest
Expand Down
37 changes: 0 additions & 37 deletions Cargo.lock

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

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ members = [
"crates/bin/ampcc",
"crates/bin/ampd",
"crates/bin/ampsync",
"crates/bin/ampup",
"crates/clients/flight",
"crates/config",
"crates/config/gen",
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ ampup build --pr 123
ampup build --branch develop
```

For more details and advanced options, see the [ampup README](crates/bin/ampup/README.md).
For more details and advanced options, see the [ampup README](https://github.com/edgeandnode/ampup?tab=readme-ov-file#ampup).

### Installation via Nix

Expand Down
31 changes: 0 additions & 31 deletions crates/bin/ampup/Cargo.toml

This file was deleted.

Loading