From 6ece362be73aca1f15d0eff05e3d41542cea7814 Mon Sep 17 00:00:00 2001 From: Zack Goodwin Date: Mon, 29 Apr 2024 15:51:51 -0400 Subject: [PATCH 1/2] PROC-1464: Add ability to log to CED via test name input --- .../main/java/com/indeed/proctor/consumer/AbstractGroups.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/proctor-consumer/src/main/java/com/indeed/proctor/consumer/AbstractGroups.java b/proctor-consumer/src/main/java/com/indeed/proctor/consumer/AbstractGroups.java index 68f3be266..4f5ee835a 100644 --- a/proctor-consumer/src/main/java/com/indeed/proctor/consumer/AbstractGroups.java +++ b/proctor-consumer/src/main/java/com/indeed/proctor/consumer/AbstractGroups.java @@ -187,6 +187,9 @@ public final void markTestsUsed(final Collection testNames) { if (testUsageObserver != null) { testUsageObserver.markUsedForToggling(testNames); } + if (exposureLogger != null) { + testNames.forEach(testName -> exposureLogger.logExposureInfo(proctorResult, testName)); + } } /** From 1f41e3d355e1c04acb0010dc75a8e20117238b5a Mon Sep 17 00:00:00 2001 From: Zack Goodwin Date: Mon, 29 Apr 2024 16:31:00 -0400 Subject: [PATCH 2/2] PROC-1464: Add ability to log to CED via a single test name input --- .../indeed/proctor/consumer/AbstractGroups.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/proctor-consumer/src/main/java/com/indeed/proctor/consumer/AbstractGroups.java b/proctor-consumer/src/main/java/com/indeed/proctor/consumer/AbstractGroups.java index 4f5ee835a..31b6260a9 100644 --- a/proctor-consumer/src/main/java/com/indeed/proctor/consumer/AbstractGroups.java +++ b/proctor-consumer/src/main/java/com/indeed/proctor/consumer/AbstractGroups.java @@ -192,6 +192,20 @@ public final void markTestsUsed(final Collection testNames) { } } + /** + * mark a test to additionally be included in getAsUsedTestsProctorResult(), even when no + * corresponding method has been called. for usecases where exposure happens without calls to + * generated methods calling getValue() + */ + public final void markTestUsed(final String testName) { + if (testUsageObserver != null) { + testUsageObserver.markUsedForToggling(testName); + } + if (exposureLogger != null) { + exposureLogger.logExposureInfo(proctorResult, testName); + } + } + /** * @return the bucket that has been determined by the current proctorResult, or override bucket * if valid, or empty if testname not valid