Skip to content

Commit 4d7c5e5

Browse files
eugene-dengsvc-squareup-copybara
authored andcommitted
# [misk] refactor: deprecate wisp ConcurrentMockTracer and migrate
shadow modules to misk version ## Summary Deprecate wisp `ConcurrentMockTracer` and migrate shadow modules to use misk version as part of misk-wisp deduplication effort. This change follows the established pattern of consolidating functionality under misk while maintaining backward compatibility during the transition period. ## Changes Made ### Core Changes - **Wisp ConcurrentMockTracer Deprecation**: Added `@Deprecated` annotation to `wisp.tracing.testing.ConcurrentMockTracer` with proper `ReplaceWith` guidance pointing to `misk.testing.ConcurrentMockTracer` - **Shadow Module Migration**: Updated shadow modules to import and use `misk.testing.ConcurrentMockTracer` instead of the wisp version ## Testing - **Compilation Verified**: All affected modules compile successfully without errors - **Deprecation Warnings**: Wisp ConcurrentMockTracer now shows appropriate deprecation warnings with migration guidance - **Backward Compatibility**: Existing wisp tests continue to work while showing deprecation guidance - **Build Dependencies**: Verified that misk-testing dependencies are properly configured GitOrigin-RevId: a91ec605823cab94510003c955f61ecd5edfe8c7
1 parent 19ed12f commit 4d7c5e5

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

misk-testing/api/misk-testing.api

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,9 @@ public final class misk/services/FakeServiceModule : misk/inject/KAbstractModule
157157
public fun <init> ()V
158158
}
159159

160-
public final class misk/testing/ConcurrentMockTracer : io/opentracing/mock/MockTracer, misk/testing/TestFixture {
160+
public class misk/testing/ConcurrentMockTracer : io/opentracing/mock/MockTracer, misk/testing/TestFixture {
161161
public fun <init> ()V
162+
protected fun onSpanFinished (Lio/opentracing/mock/MockSpan;)V
162163
public fun reset ()V
163164
public final fun take ()Lio/opentracing/mock/MockSpan;
164165
public final fun take (Ljava/lang/String;)Lio/opentracing/mock/MockSpan;

misk-testing/src/main/kotlin/misk/testing/ConcurrentMockTracer.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,8 @@ import jakarta.inject.Singleton
1111
* Extends [MockTracer] for use in concurrent environments, such as a web server and test client.
1212
* Prefer this wherever you'd otherwise use [MockTracer].
1313
*/
14-
// TODO(keefer): Deprecate this (or forward the type via delegate) when wisp-tracing-test-fixtures
15-
// publication is fixed. wisp-tracing provides a preferred copy of this class.
1614
@Singleton
17-
class ConcurrentMockTracer @Inject constructor() : TestFixture, MockTracer() {
15+
open class ConcurrentMockTracer @Inject constructor() : TestFixture, MockTracer() {
1816
private val queue = LinkedBlockingDeque<MockSpan>()
1917

2018
override fun reset() {

wisp/wisp-tracing/src/testFixtures/kotlin/wisp/tracing/testing/ConcurrentMockTracer.kt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ import java.util.concurrent.TimeUnit
99
* Extends [MockTracer] for use in concurrent environments, such as a web server and test client.
1010
* Prefer this wherever you'd otherwise use [MockTracer].
1111
*/
12+
@Deprecated(
13+
message = "Duplicate implementations in Wisp are being migrated to the unified type in Misk.",
14+
replaceWith = ReplaceWith(
15+
expression = "ConcurrentMockTracer()",
16+
imports = ["misk.testing.ConcurrentMockTracer"]
17+
)
18+
)
1219
open class ConcurrentMockTracer : MockTracer() {
1320
private val queue = LinkedBlockingDeque<MockSpan>()
1421

0 commit comments

Comments
 (0)