diff --git a/.github/workflows/acceptance-test.yml b/.github/workflows/acceptance-test.yml index e668148..db25fca 100644 --- a/.github/workflows/acceptance-test.yml +++ b/.github/workflows/acceptance-test.yml @@ -26,6 +26,7 @@ jobs: - uses: actions/setup-go@v2 with: go-version: ${{ matrix.go }} + id: go - uses: actions/cache@v2 with: path: | @@ -34,5 +35,9 @@ jobs: key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} restore-keys: | ${{ runner.os }}-go- + - name: modTidy + run: go mod tidy + - name: modVendor + run: go mod vendor - name: Run tests run: make testacc \ No newline at end of file diff --git a/Makefile b/Makefile index 2c76215..dbbb573 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ NAME=julieops BINARY=terraform-provider-${NAME} VERSION=0.3 OS_ARCH=darwin_amd64 -TESTARGS=-p 1 +TESTARGS= default: install diff --git a/julie/resource_kafka_connect_acl_test.go b/julie/resource_kafka_connect_acl_test.go index 0e0bc56..3c13710 100644 --- a/julie/resource_kafka_connect_acl_test.go +++ b/julie/resource_kafka_connect_acl_test.go @@ -10,7 +10,11 @@ import ( "testing" ) -func TestAccKafkaConnectAclCreate(t *testing.T) { +func TestAccKafkaConnectAclsManagement(t *testing.T) { + t.Run("Test Kafka Connect ACLs create", testAccKafkaConnectAclCreate) +} + +func testAccKafkaConnectAclCreate(t *testing.T) { ctx := context.Background() setup, close := julieTest.SetupDocker(ctx, julieTest.ContainersSetupConfig{}, t) defer close(ctx) diff --git a/julie/resource_kafka_connector_test.go b/julie/resource_kafka_connector_test.go index d52e549..c14837d 100644 --- a/julie/resource_kafka_connector_test.go +++ b/julie/resource_kafka_connector_test.go @@ -10,7 +10,11 @@ import ( "testing" ) -func TestAccKafkaConnectCreate(t *testing.T) { +func TestAccKafkaConnectorManagement(t *testing.T) { + t.Run("Test Kafka Connector create", testAccKafkaConnectCreate) +} + +func testAccKafkaConnectCreate(t *testing.T) { ctx := context.Background() setup, close := julieTest.SetupDocker(ctx, julieTest.ContainersSetupConfig{ EnableSchemaRegistry: true, EnableKafkaConnect: true, diff --git a/julie/resource_kafka_consumer_acl_test.go b/julie/resource_kafka_consumer_acl_test.go index be5708a..9cf9c2c 100644 --- a/julie/resource_kafka_consumer_acl_test.go +++ b/julie/resource_kafka_consumer_acl_test.go @@ -10,7 +10,11 @@ import ( "testing" ) -func TestAccKafkaAclCreate(t *testing.T) { +func TestAccKafkaAclsManagement(t *testing.T) { + t.Run("Test Kafka Consumers ACLs create", testAccKafkaAclCreate) +} + +func testAccKafkaAclCreate(t *testing.T) { ctx := context.Background() setup, close := julieTest.SetupDocker(ctx, julieTest.ContainersSetupConfig{}, t) defer close(ctx) diff --git a/julie/resource_kafka_streams_acl_test.go b/julie/resource_kafka_streams_acl_test.go index 5970511..81c89fb 100644 --- a/julie/resource_kafka_streams_acl_test.go +++ b/julie/resource_kafka_streams_acl_test.go @@ -10,7 +10,11 @@ import ( "testing" ) -func TestAccKafkaStreamsAclCreate(t *testing.T) { +func TestAccKafkaStreamsAclsManagement(t *testing.T) { + t.Run("Test Kafka Streams ACLs create", testAccKafkaStreamsAclCreate) +} + +func testAccKafkaStreamsAclCreate(t *testing.T) { ctx := context.Background() setup, close := julieTest.SetupDocker(ctx, julieTest.ContainersSetupConfig{}, t) diff --git a/julie/resource_kafka_topic_test.go b/julie/resource_kafka_topic_test.go index 8cd3888..f3c4590 100644 --- a/julie/resource_kafka_topic_test.go +++ b/julie/resource_kafka_topic_test.go @@ -10,7 +10,13 @@ import ( "testing" ) -func TestAccKafkaTopicCreateWithoutConfig(t *testing.T) { +func TestAccKafkaTopicManagement(t *testing.T) { + t.Run("Test Kafka Topics without Config", testKafkaTopicCreateWithoutConfig) + t.Run("Test Kafka Topics with Config", testKafkaTopicCreateWithConfig) + t.Run("Test Kafka Topics update", testKafkaTopicConfigUpdate) +} + +func testKafkaTopicCreateWithoutConfig(t *testing.T) { ctx := context.Background() setup, close := julieTest.SetupDocker(ctx, julieTest.ContainersSetupConfig{}, t) @@ -35,7 +41,7 @@ func TestAccKafkaTopicCreateWithoutConfig(t *testing.T) { }) } -func TestAccKafkaTopicCreateWithConfig(t *testing.T) { +func testKafkaTopicCreateWithConfig(t *testing.T) { ctx := context.Background() setup, close := julieTest.SetupDocker(ctx, julieTest.ContainersSetupConfig{}, t) defer close(ctx) @@ -59,7 +65,7 @@ func TestAccKafkaTopicCreateWithConfig(t *testing.T) { }) } -func TestAccKafkaTopicConfigUpdate(t *testing.T) { +func testKafkaTopicConfigUpdate(t *testing.T) { ctx := context.Background() setup, close := julieTest.SetupDocker(ctx, julieTest.ContainersSetupConfig{}, t) defer close(ctx) @@ -109,13 +115,6 @@ resource "julieops_kafka_topic" "test_config" { } ` -/*func cfg(bs string, extraCfg string) string { - var saslConfig = " \t sasl_username = \"kafka\" \n \t sasl_password = \"kafka\" \n \t sasl_mechanism = \"plain\" \n " - var str = "provider \"julieops\" { \n \t bootstrap_servers = \"%s\" \n %s } \n %s \n" - //log.Printf(str, bs, saslConfig, extraCfg) - return fmt.Sprintf(str, bs, saslConfig, extraCfg) -}*/ - func cfg(bs string, connect string, extraCfg string) string { var saslConfig = " \t sasl_username = \"kafka\" \n \t sasl_password = \"kafka\" \n \t sasl_mechanism = \"plain\" \n " var connectConfig = fmt.Sprintf("\t kafka_connects = \"%s\" \n", connect) diff --git a/julie/test/kafka_container.go b/julie/test/kafka_container.go index ad3c92a..9218e0c 100644 --- a/julie/test/kafka_container.go +++ b/julie/test/kafka_container.go @@ -159,7 +159,6 @@ func SetupKafkaEnv(ctx context.Context, zookeeperUri string, versionTag string, ExposedPorts: []string{"9092:9092"}, Env: env, BindMounts: mounts, - Name: "kafka", Hostname: "kafka", Networks: []string{ "julie_ops-cli", @@ -220,7 +219,6 @@ func SetupSchemaRegistry(ctx context.Context, config DockerContainerConfig) (*sc Image: "confluentinc/cp-schema-registry:" + config.VersionTag, ExposedPorts: []string{SchemaRegistryPortString + ":" + SchemaRegistryPortString}, Env: env, - Name: "schema-registry", Hostname: "schema-registry", Networks: []string{ "julie_ops-cli", @@ -284,7 +282,6 @@ func SetupKafkaConnect(ctx context.Context, config DockerContainerConfig) (*kafk ExposedPorts: []string{KafkaConnectPortString + ":" + KafkaConnectPortString}, Env: env, BindMounts: mounts, - Name: "kafka-connect", Hostname: "kafka-connect", Networks: []string{ "julie_ops-cli", diff --git a/julie/test/zookeeper_container.go b/julie/test/zookeeper_container.go index 5086bd0..d8bc2bd 100644 --- a/julie/test/zookeeper_container.go +++ b/julie/test/zookeeper_container.go @@ -40,7 +40,6 @@ func SetupZookeeperEnv(ctx context.Context, versionTag string, mountPath string) ExposedPorts: []string{"2181/tcp"}, Env: env, BindMounts: mounts, - Name: "zookeeper", Hostname: "zookeeper", Networks: []string{ "julie_ops-cli",