Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix build #4865

Merged
merged 1 commit into from
Jul 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import com.segment.analytics.Analytics;
import com.segment.analytics.messages.IdentifyMessage;
import com.segment.analytics.messages.TrackMessage;
import io.airbyte.config.Configs.WorkerEnvironment;
import java.util.Map;
import java.util.UUID;
import java.util.function.Supplier;
Expand All @@ -55,7 +56,7 @@ class SegmentTrackingClientTest {
void setup() {
analytics = mock(Analytics.class);
roleSupplier = mock(Supplier.class);
segmentTrackingClient = new SegmentTrackingClient(() -> identity, null, analytics);
segmentTrackingClient = new SegmentTrackingClient(() -> identity, WorkerEnvironment.DOCKER, null, analytics);
}

@SuppressWarnings("OptionalGetWithoutIsPresent")
Expand All @@ -70,6 +71,7 @@ void testIdentify() {
verify(analytics).enqueue(mockBuilder.capture());
final IdentifyMessage actual = mockBuilder.getValue().build();
final Map<String, Object> expectedTraits = ImmutableMap.<String, Object>builder()
.put("deployment_env", WorkerEnvironment.DOCKER)
.put("airbyte_version", AIRBYTE_VERSION)
.put("email", identity.getEmail().get())
.put("anonymized", identity.isAnonymousDataCollection())
Expand All @@ -82,7 +84,7 @@ void testIdentify() {

@Test
void testIdentifyWithRole() {
segmentTrackingClient = new SegmentTrackingClient(() -> identity, "role", analytics);
segmentTrackingClient = new SegmentTrackingClient(() -> identity, WorkerEnvironment.DOCKER, "role", analytics);
// equals is not defined on MessageBuilder, so we need to use ArgumentCaptor to inspect each field
// manually.
ArgumentCaptor<IdentifyMessage.Builder> mockBuilder = ArgumentCaptor.forClass(IdentifyMessage.Builder.class);
Expand All @@ -93,6 +95,7 @@ void testIdentifyWithRole() {
verify(analytics).enqueue(mockBuilder.capture());
final IdentifyMessage actual = mockBuilder.getValue().build();
final Map<String, Object> expectedTraits = ImmutableMap.<String, Object>builder()
.put("deployment_env", WorkerEnvironment.DOCKER)
.put("airbyte_version", AIRBYTE_VERSION)
.put("email", identity.getEmail().get())
.put("anonymized", identity.isAnonymousDataCollection())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ public static void runServer(final Set<ContainerRequestFilter> requestFilters,

TrackingClientSingleton.initialize(
configs.getTrackingStrategy(),
WorkerEnvironment.DOCKER,
configs.getAirbyteRole(),
configs.getAirbyteVersion(),
configRepository);
Expand Down