Back to Repositories

Testing gRPC Client Integration Workflow in Conductor OSS

This test suite implements end-to-end integration testing for the Conductor workflow engine’s gRPC interface. It validates the communication and functionality between various Conductor clients including task, workflow, metadata, and event clients over gRPC protocol.

Test Coverage Overview

The test suite provides comprehensive coverage of Conductor’s gRPC client implementations.

Key areas tested include:
  • Task client operations and communication
  • Workflow client functionality
  • Metadata client interactions
  • Event client processing
  • End-to-end communication flow between components

Implementation Analysis

The testing approach utilizes JUnit framework with a focused setup for gRPC client testing. The implementation extends AbstractGrpcEndToEndTest class and initializes different client instances targeting localhost:8092.

Technical patterns include:
  • Client initialization in @Before setup
  • Separation of concerns across different client types
  • Standardized port configuration
  • Inheritance-based test organization

Technical Details

Testing tools and configuration:
  • JUnit testing framework
  • Conductor gRPC client libraries
  • Local gRPC server setup on port 8092
  • Dedicated client instances for Tasks, Workflows, Metadata, and Events
  • Abstract base class for common test functionality

Best Practices Demonstrated

The test implementation showcases several testing best practices in the gRPC integration context.

Notable practices include:
  • Clean separation of client responsibilities
  • Proper test initialization and setup
  • Consistent configuration management
  • Inheritance-based test organization
  • Clear client endpoint definition

conductor-oss/conductor

test-harness/src/test/java/com/netflix/conductor/test/integration/grpc/GrpcEndToEndTest.java

            
/*
 * Copyright 2022 Conductor Authors.
 * <p>
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
 * the License. You may obtain a copy of the License at
 * <p>
 * http://www.apache.org/licenses/LICENSE-2.0
 * <p>
 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
 * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations under the License.
 */
package com.netflix.conductor.test.integration.grpc;

import org.junit.Before;

import com.netflix.conductor.client.grpc.EventClient;
import com.netflix.conductor.client.grpc.MetadataClient;
import com.netflix.conductor.client.grpc.TaskClient;
import com.netflix.conductor.client.grpc.WorkflowClient;

public class GrpcEndToEndTest extends AbstractGrpcEndToEndTest {

    @Before
    public void init() {
        taskClient = new TaskClient("localhost", 8092);
        workflowClient = new WorkflowClient("localhost", 8092);
        metadataClient = new MetadataClient("localhost", 8092);
        eventClient = new EventClient("localhost", 8092);
    }
}