Skip to content

Commit

Permalink
Added simple tests for connector config
Browse files Browse the repository at this point in the history
  • Loading branch information
simlay committed Jul 7, 2022
1 parent 469f9ed commit 059e947
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Platform Version 0.9.31 - UNRELEASED
* Move stream publishers to connection-level context ([#2452](https://github.com/infinyon/fluvio/pull/2452))
* Add `fluvio connector describe <connector-name>` ([#2464](https://github.com/infinyon/fluvio/pull/2464))
* Add `fluvio connector config <connector-name>` ([#2464](https://github.com/infinyon/fluvio/pull/2464))

## Platform Version 0.9.30 - 2022-06-29
* Improve CLI error output when log_dir isn't writable ([#2425](https://github.com/infinyon/fluvio/pull/2425))
Expand Down
42 changes: 42 additions & 0 deletions tests/cli/smoke_tests/connector-describe.bats
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/usr/bin/env bats

TEST_HELPER_DIR="$BATS_TEST_DIRNAME/../test_helper"
export TEST_HELPER_DIR

load "$TEST_HELPER_DIR"/tools_check.bash
load "$TEST_HELPER_DIR"/fluvio_dev.bash
load "$TEST_HELPER_DIR"/bats-support/load.bash
load "$TEST_HELPER_DIR"/bats-assert/load.bash

setup_file() {
CONNECTOR_CONFIG="$TEST_HELPER_DIR/connectors/test-connector-config.yaml"
export CONNECTOR_CONFIG
INVALID_CONFIG=$(mktemp)
export INVALID_CONFIG
CONNECTOR_NAME="my-test-connector"
export CONNECTOR_NAME
CONNECTOR_TOPIC="my-test-topic"
export CONNECTOR_TOPIC
}

teardown_file() {
# Delete connector's topic
run timeout 15s "$FLUVIO_BIN" topic delete "$CONNECTOR_TOPIC"
run timeout 15s "$FLUVIO_BIN" connector delete "$CONNECTOR_NAME"
}

# Create connector
@test "Create test connector and get test connector config" {
run timeout 15s "$FLUVIO_BIN" connector create --config "$CONNECTOR_CONFIG"
assert_success
run timeout 15s "$FLUVIO_BIN" connector config "$CONNECTOR_NAME"
assert_success
assert_output "
---
version: latest
name: my-test-connector
type: test-connector
topic: my-test-connector-topic
create_topic: true
"
}
5 changes: 2 additions & 3 deletions tests/cli/test_helper/connectors/test-connector-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
version: v1
version: latest
name: my-test-connector
type: test-connector
topic: my-test-connector-topic
create_topic: true
direction: source
create_topic: true

0 comments on commit 059e947

Please sign in to comment.