Skip to content

Commit a4ec24f

Browse files
shumin1027shumin
authored andcommitted
add redis sink and source
Signed-off-by: shumin <[email protected]>
1 parent a11f69c commit a4ec24f

File tree

17 files changed

+1571
-11
lines changed

17 files changed

+1571
-11
lines changed

.github/workflows/integration-test.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,24 @@ jobs:
313313
- run: make slim-builds
314314
- run: make test-integration-splunk
315315

316+
test-integration-redis:
317+
name: Integration - Linux, Redis
318+
runs-on: ubuntu-20.04
319+
steps:
320+
- uses: actions/checkout@v2
321+
- run: make ci-sweep
322+
- uses: actions/cache@v2
323+
with:
324+
path: |
325+
~/.cargo/registry
326+
~/.cargo/git
327+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
328+
- run: sudo bash scripts/environment/bootstrap-ubuntu-20.04.sh
329+
- run: bash scripts/environment/prepare.sh
330+
- run: echo "::add-matcher::.github/matchers/rust.json"
331+
- run: make slim-builds
332+
- run: make test-integration-redis
333+
316334
master-failure:
317335
name: master-failure
318336
if: failure() && github.ref == 'refs/heads/master'
@@ -329,6 +347,7 @@ jobs:
329347
- test-integration-loki
330348
- test-integration-pulsar
331349
- test-integration-splunk
350+
- test-integration-redis
332351
runs-on: ubuntu-20.04
333352
steps:
334353
- name: Discord notification

Cargo.lock

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

Cargo.toml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ typetag = "0.1.6"
222222
url = "2.2.0"
223223
uuid = { version = "0.8", features = ["serde", "v4"], optional = true }
224224
warp = { version = "0.2.5", default-features = false, optional = true }
225+
redis = { version = "0.20.0", features = ["connection-manager","async-std-comp"], optional = true }
225226

226227
# For WASM
227228
async-stream = "0.3.0"
@@ -361,6 +362,7 @@ sources-metrics = [
361362
"sources-prometheus",
362363
"sources-statsd",
363364
"sources-vector",
365+
"sources-redis",
364366
]
365367

366368
sources-apache_metrics = []
@@ -394,6 +396,7 @@ sources-utils-tls = []
394396
sources-utils-udp = ["socket2"]
395397
sources-utils-unix = []
396398
sources-vector = ["listenfd", "sources-utils-tcp-keepalive", "sources-utils-tcp-socket", "sources-utils-tls"]
399+
sources-redis = ["redis"]
397400

398401
# Transforms
399402
transforms = ["transforms-logs", "transforms-metrics"]
@@ -512,7 +515,8 @@ sinks-metrics = [
512515
"sinks-prometheus",
513516
"sinks-sematext",
514517
"sinks-statsd",
515-
"sinks-vector"
518+
"sinks-vector",
519+
"sinks-redis",
516520
]
517521

518522
sinks-aws_cloudwatch_logs = ["rusoto", "rusoto_logs"]
@@ -547,6 +551,7 @@ sinks-splunk_hec = ["bytesize"]
547551
sinks-statsd = ["sinks-utils-udp", "tokio-util/udp"]
548552
sinks-utils-udp = ["socket2"]
549553
sinks-vector = ["sinks-utils-udp"]
554+
sinks-redis = ["redis"]
550555

551556
# Identifies that the build is a nightly build
552557
nightly = []
@@ -571,6 +576,7 @@ all-integration-tests = [
571576
"prometheus-integration-tests",
572577
"pulsar-integration-tests",
573578
"splunk-integration-tests",
579+
"redis-integration-tests",
574580
]
575581

576582
aws-integration-tests = [
@@ -609,6 +615,7 @@ postgresql_metrics-integration-tests = ["sources-postgresql_metrics"]
609615
prometheus-integration-tests = ["bytesize", "sinks-prometheus", "sources-prometheus"]
610616
pulsar-integration-tests = ["sinks-pulsar"]
611617
splunk-integration-tests = ["sinks-splunk_hec", "warp"]
618+
redis-integration-tests = ["sources-redis", "sinks-redis"]
612619

613620
disable-resolv-conf = []
614621
shutdown-tests = ["rdkafka", "sinks-blackhole", "sinks-console", "sinks-prometheus", "sources", "transforms-log_to_metric", "transforms-lua", "unix"]

Makefile

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ test-behavior: ## Runs behaviorial test
299299

300300
.PHONY: test-integration
301301
test-integration: ## Runs all integration tests
302-
test-integration: test-integration-aws test-integration-clickhouse test-integration-docker-logs test-integration-elasticsearch
302+
test-integration: test-integration-aws test-integration-docker-logs test-integration-elasticsearch
303303
test-integration: test-integration-gcp test-integration-humio test-integration-influxdb test-integration-kafka
304304
test-integration: test-integration-loki test-integration-mongodb_metrics test-integration-nats
305305
test-integration: test-integration-nginx test-integration-postgresql_metrics test-integration-prometheus test-integration-pulsar
@@ -317,7 +317,7 @@ ifeq ($(AUTODESPAWN), true)
317317
@scripts/setup_integration_env.sh aws stop
318318
endif
319319

320-
.PHONY: test-integration-clickhouse
320+
.PHONY:
321321
test-integration-clickhouse: ## Runs Clickhouse integration tests
322322
ifeq ($(AUTOSPAWN), true)
323323
@scripts/setup_integration_env.sh clickhouse stop
@@ -492,6 +492,18 @@ ifeq ($(AUTODESPAWN), true)
492492
@scripts/setup_integration_env.sh splunk stop
493493
endif
494494

495+
.PHONY: test-integration-redis
496+
test-integration-redis: ## Runs Redis integration tests
497+
ifeq ($(AUTOSPAWN), true)
498+
@scripts/setup_integration_env.sh redis stop
499+
@scripts/setup_integration_env.sh redis start
500+
sleep 10 # Many services are very slow... Give them a sec..
501+
endif
502+
${MAYBE_ENVIRONMENT_EXEC} cargo test --no-fail-fast --no-default-features --features redis-integration-tests --lib ::redis:: -- --nocapture
503+
ifeq ($(AUTODESPAWN), true)
504+
@scripts/setup_integration_env.sh redis stop
505+
endif
506+
495507
.PHONY: test-e2e-kubernetes
496508
test-e2e-kubernetes: ## Runs Kubernetes E2E tests (Sorry, no `ENVIRONMENT=true` support)
497509
@scripts/test-e2e-kubernetes.sh

0 commit comments

Comments
 (0)