Skip to content

Commit 8230d92

Browse files
fix: skip plugin-dependent tests and add OCI download target
Add #[ignore] annotations to 14 tests across solution_deployment_test.rs and solution_template_roundtrip_test.rs that require cdylib plugins (mock source, log reaction, scriptfile bootstrap). This matches the existing pattern used in hot_reload_test.rs and iot_template_e2e_test.rs, ensuring `cargo test` passes without a local drasi-core checkout. Add `make download-test-plugins` Makefile target that downloads pre-built test plugins from the OCI registry using the server's `plugin install` CLI. Update `make test-all` to auto-detect whether ../drasi-core exists, falling back to downloading from the registry. Also update Cargo.lock and Cargo.toml to use crates.io dependencies instead of local path overrides. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 365fdac commit 8230d92

6 files changed

Lines changed: 106 additions & 33 deletions

File tree

CLAUDE.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,13 @@ Plugins (sources, reactions, bootstrap providers) are loaded at runtime as cdyli
2929
- Build all plugins from local drasi-core (release): `make build-local-plugins`
3030
- Build all plugins from local drasi-core (debug): `make build-local-plugins-debug`
3131
- Build test-only plugins (mock, log, scriptfile): `make build-local-test-plugins`
32+
- Download test plugins from OCI registry (no drasi-core needed): `make download-test-plugins`
3233

3334
**Local directory plugin sources:** The `pluginRegistry` config field (and `--registry` CLI flag) accepts local filesystem paths in addition to OCI registry URLs. When a path is detected (e.g., `/path/to/plugins`, `./plugins`, `../drasi-core/target/debug/plugins`, `file:///opt/plugins`), the system scans the directory for plugin binaries instead of contacting an OCI registry. This is useful for development workflows where plugins are built locally. Detection is cross-platform: Unix absolute paths, relative paths (`./`, `../`), home-relative (`~/`), `file://` URIs, Windows drive letters, and UNC paths are all recognized as local directories.
3435

3536
### Testing
3637
- Run all tests: `cargo test`
38+
- Run all tests including plugin-dependent: `make test-all`
3739
- Run unit tests only: `cargo test --lib`
3840
- Run specific test: `cargo test test_name`
3941
- Run integration tests: `./tests/run_working_tests.sh`

Cargo.lock

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

Cargo.toml

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ members = [".", "xtask"]
1717

1818
[package]
1919
name = "drasi-server"
20-
version = "0.1.0"
20+
version = "0.2.0"
2121
edition = "2021"
2222
authors = ["Drasi Project"]
2323
description = "Standalone Drasi server for data change processing"
@@ -35,7 +35,7 @@ path = "src/main.rs"
3535

3636
[dependencies]
3737
# Drasi core library (all middleware, using system libjq instead of bundled-jq)
38-
drasi-lib = { version = "0.4.1", features = [
38+
drasi-lib = { version = "0.4.2", features = [
3939
"middleware-jq",
4040
"middleware-decoder",
4141
"middleware-map",
@@ -49,24 +49,24 @@ drasi-lib = { version = "0.4.1", features = [
4949
drasi-core = "0.4.1"
5050

5151
# Core bootstrap providers (used by the application API)
52-
drasi-bootstrap-noop = "0.1.9"
53-
drasi-bootstrap-application = "0.1.10"
52+
drasi-bootstrap-noop = "0.1.10"
53+
drasi-bootstrap-application = "0.1.11"
5454

5555
# Core reaction (used by the application API)
56-
drasi-reaction-application = "0.2.9"
56+
drasi-reaction-application = "0.2.10"
5757

5858
# Index plugins
5959
drasi-index-rocksdb = "0.3.1"
60-
drasi-index-garnet = "0.1.7"
60+
drasi-index-garnet = "0.1.8"
6161

6262
# State store plugins
63-
drasi-state-store-redb = "0.1.7"
63+
drasi-state-store-redb = "0.1.8"
6464

6565
# Plugin SDK
66-
drasi-plugin-sdk = "0.4.2"
66+
drasi-plugin-sdk = "0.4.3"
6767

6868
# Host SDK for dynamic plugin loading
69-
drasi-host-sdk = { version = "0.4.2", features = ["registry", "fetcher", "watcher"] }
69+
drasi-host-sdk = { version = "0.4.3", features = ["registry", "fetcher", "watcher"] }
7070
oci-client = "0.16"
7171

7272
# Server-specific dependencies
@@ -148,14 +148,14 @@ large_enum_variant = "allow"
148148

149149

150150
# Local development: use path-based dependencies
151-
[patch.crates-io]
152-
drasi-core = { path = "../drasi-core/core" }
153-
drasi-lib = { path = "../drasi-core/lib" }
154-
drasi-bootstrap-noop = { path = "../drasi-core/components/bootstrappers/noop" }
155-
drasi-bootstrap-application = { path = "../drasi-core/components/bootstrappers/application" }
156-
drasi-reaction-application = { path = "../drasi-core/components/reactions/application" }
157-
drasi-index-rocksdb = { path = "../drasi-core/components/indexes/rocksdb" }
158-
drasi-index-garnet = { path = "../drasi-core/components/indexes/garnet" }
159-
drasi-state-store-redb = { path = "../drasi-core/components/state_stores/redb" }
160-
drasi-plugin-sdk = { path = "../drasi-core/components/plugin-sdk" }
161-
drasi-host-sdk = { path = "../drasi-core/components/host-sdk" }
151+
# [patch.crates-io]
152+
# drasi-core = { path = "../drasi-core/core" }
153+
# drasi-lib = { path = "../drasi-core/lib" }
154+
# drasi-bootstrap-noop = { path = "../drasi-core/components/bootstrappers/noop" }
155+
# drasi-bootstrap-application = { path = "../drasi-core/components/bootstrappers/application" }
156+
# drasi-reaction-application = { path = "../drasi-core/components/reactions/application" }
157+
# drasi-index-rocksdb = { path = "../drasi-core/components/indexes/rocksdb" }
158+
# drasi-index-garnet = { path = "../drasi-core/components/indexes/garnet" }
159+
# drasi-state-store-redb = { path = "../drasi-core/components/state_stores/redb" }
160+
# drasi-plugin-sdk = { path = "../drasi-core/components/plugin-sdk" }
161+
# drasi-host-sdk = { path = "../drasi-core/components/host-sdk" }

Makefile

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
doctor validate clean clippy test test-all test-smoke \
2020
fmt fmt-check help docker-build \
2121
submodule-update vscode-test dev-build clean-dev-build \
22-
build-ui clean-ui build-local-test-plugins \
22+
build-ui clean-ui build-local-test-plugins download-test-plugins \
2323
build-local-plugins build-local-plugins-debug
2424

2525
# Platform detection
@@ -90,6 +90,7 @@ help:
9090
@echo " make build-local-plugins - Build all plugins (release) from local drasi-core"
9191
@echo " make build-local-plugins-debug - Build all plugins (debug) from local drasi-core"
9292
@echo " make build-local-test-plugins - Build test-only plugins (mock, log, scriptfile)"
93+
@echo " make download-test-plugins - Download test plugins from OCI registry (no drasi-core needed)"
9394
@echo ""
9495
@echo "Code Quality:"
9596
@echo " make clippy - Run linter"
@@ -188,9 +189,18 @@ fmt-check:
188189
test:
189190
cargo test
190191

191-
# Run ALL tests: build test plugins, run cargo tests (including #[ignore]),
192+
# Run ALL tests: build/download test plugins, run cargo tests (including #[ignore]),
192193
# plugin smoke tests, and VSCode extension tests.
193-
test-all: build-local-plugins-debug
194+
# Prefers building from local drasi-core if available; falls back to downloading
195+
# pre-built plugins from the OCI registry.
196+
test-all:
197+
@if [ -d "../drasi-core" ]; then \
198+
echo "=== Building plugins from local drasi-core ==="; \
199+
$(MAKE) build-local-plugins-debug; \
200+
else \
201+
echo "=== drasi-core not found, downloading plugins from OCI registry ==="; \
202+
$(MAKE) download-test-plugins; \
203+
fi
194204
@echo "=== Building server binary ==="
195205
cargo build
196206
@echo "=== Running all cargo tests (including ignored/E2E) ==="
@@ -209,6 +219,19 @@ test-smoke:
209219
# Build cdylib test plugins (mock source, log reaction, http reaction, scriptfile bootstrap)
210220
# needed by solution deployment and E2E tests.
211221
# Plugins are built from ../drasi-core and copied to target/debug/plugins/.
222+
# Download pre-built test plugins from the OCI registry (no local drasi-core needed).
223+
# Uses the server's built-in `plugin install` CLI to fetch mock source, log reaction,
224+
# http reaction, and scriptfile bootstrap plugins.
225+
download-test-plugins:
226+
@echo "=== Downloading test plugins from OCI registry ==="
227+
@mkdir -p target/debug/plugins
228+
cargo run -- plugin install source/mock --plugins-dir target/debug/plugins
229+
cargo run -- plugin install reaction/log --plugins-dir target/debug/plugins
230+
cargo run -- plugin install reaction/http --plugins-dir target/debug/plugins
231+
cargo run -- plugin install bootstrap/scriptfile --plugins-dir target/debug/plugins
232+
@echo "=== Test plugins downloaded to target/debug/plugins/ ==="
233+
@ls -1 target/debug/plugins/$(PLUGIN_LIB_PREFIX)drasi_*.$(PLUGIN_LIB_EXT) 2>/dev/null || echo "Warning: No plugin files found"
234+
212235
build-local-test-plugins:
213236
@echo "=== Building cdylib test plugins from drasi-core ==="
214237
cd ../drasi-core && cargo build --lib -p drasi-source-mock --features drasi-source-mock/dynamic-plugin

0 commit comments

Comments
 (0)