Skip to content

Commit 199a348

Browse files
committed
Extract akka/pekko dependencies to project
To minimize duplication: - Introduce neutral aliases for Akka actor dependencies - Pull in akka or pekko dependencies based on a build parameter - Publish pekko variants of all modules - Add pekko based permutations to integration test matrix
1 parent 32bbf54 commit 199a348

File tree

36 files changed

+252
-59
lines changed

36 files changed

+252
-59
lines changed

.circleci/config.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ commands:
3737
scala_version:
3838
type: string
3939
default: "2.13.8"
40+
actor_module:
41+
type: string
42+
default: "akka"
4043
shaded:
4144
type: boolean
4245
default: true
@@ -258,6 +261,9 @@ jobs:
258261
scala_version:
259262
type: string
260263
default: "2.13.8"
264+
actor_module:
265+
type: string
266+
default: "akka"
261267
shaded:
262268
type: boolean
263269
default: true
@@ -276,6 +282,7 @@ jobs:
276282
- build_n_tests:
277283
jdk_version: << parameters.jdk_version >>
278284
scala_version: << parameters.scala_version >>
285+
actor_module: << parameters.actor_module >>
279286
shaded: << parameters.shaded >>
280287
category: UNIT_TESTS
281288

@@ -296,6 +303,9 @@ jobs:
296303
akka_version:
297304
type: string
298305
default: "2.5.23"
306+
actor_module:
307+
type: string
308+
default: "akka"
299309
shaded:
300310
type: boolean
301311
default: true
@@ -316,6 +326,7 @@ jobs:
316326

317327
environment:
318328
AKKA_VERSION: << parameters.akka_version >>
329+
ACTOR_MODULE: << parameters.actor_module >>
319330
MONGO_PROFILE: << parameters.mongo_profile >>
320331
MONGO_VER: << parameters.mongo_version >>
321332
OS_NAME: linux
@@ -333,6 +344,7 @@ jobs:
333344
echo "Shaded? << parameters.shaded >>"
334345
echo "Compressor: << parameters.compressor>>"
335346
echo "Akka: version=$AKKA_VERSION"
347+
echo "Actor module: $ACTOR_MODULE"
336348
337349
- setup_integration:
338350
mongo_version: $MONGO_VER
@@ -345,6 +357,7 @@ jobs:
345357
jdk_version: openjdk<< parameters.openjdk_version >>
346358
scala_version: << parameters.scala_version >>
347359
shaded: << parameters.shaded >>
360+
actor_module: << parameters.actor_module >>
348361
compressor: << parameters.compressor >>
349362

350363
- collect_test_reports
@@ -414,6 +427,15 @@ workflows:
414427
jdk_version: openjdk10
415428
scala_version: 2.12.18
416429

430+
- unit_test_suite:
431+
name: unit_linux_openjdk10_scala212_pekko
432+
e:
433+
name: openjdk
434+
version: 10
435+
jdk_version: openjdk10
436+
scala_version: 2.12.18
437+
actor_module: pekko
438+
417439
- integration_test_suite:
418440
name: mongo3_openjdk8_scala211_akka23
419441
openjdk_version: 8
@@ -435,6 +457,12 @@ workflows:
435457
mongo_profile: x509
436458
scala_version: 2.13.8
437459

460+
- integration_test_suite:
461+
name: mongo5_openjdk10_scala213_pekko_x509
462+
mongo_version: 5
463+
scala_version: 2.13.8
464+
actor_module: pekko
465+
438466
- integration_test_suite:
439467
name: mongo6_openjdk11_scala31_akka26
440468
scala_version: '3.2.2'
@@ -443,6 +471,14 @@ workflows:
443471
mongo_version: 6
444472
compressor: zstd
445473

474+
- integration_test_suite:
475+
name: mongo6_openjdk11_scala31_pekko
476+
scala_version: '3.2.2'
477+
actor_module: pekko
478+
openjdk_version: 11
479+
mongo_version: 6
480+
compressor: zstd
481+
446482
- integration_test_suite:
447483
name: mongo5_openjdk10_scala212_akka25_invalidssl
448484
mongo_version: 5
@@ -512,6 +548,9 @@ workflows:
512548
- mongo4_openjdk10_scala211_akka25_mutualssl
513549
- mongo5_openjdk11_scala211_akka25_rs
514550
- mongo5_openjdk10_scala211_akka25_x509
551+
- unit_linux_openjdk10_scala212_pekko
552+
- mongo5_openjdk10_scala213_pekko_x509
553+
- mongo6_openjdk11_scala31_pekko
515554

516555
- trigger_dependent_builds:
517556
filters:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Then go to the `ReactiveMongo` directory and launch the SBT build console:
3131
```
3232
$ cd ReactiveMongo
3333
$ sbt
34-
> +publish-local
34+
> +publishLocal
3535
```
3636

3737
*Running tests:*
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package reactivemongo.actors
2+
3+
package object actor {
4+
type ActorSystem = akka.actor.ActorSystem
5+
val ActorSystem = akka.actor.ActorSystem
6+
7+
type ActorRef = akka.actor.ActorRef
8+
type Actor = akka.actor.Actor
9+
val Actor = akka.actor.Actor
10+
11+
type Props = akka.actor.Props
12+
val Props = akka.actor.Props
13+
type Terminated = akka.actor.Terminated
14+
type Cancellable = akka.actor.Cancellable
15+
16+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package reactivemongo.actors.pattern
2+
3+
import akka.pattern.{
4+
AskSupport,
5+
FutureTimeoutSupport,
6+
GracefulStopSupport,
7+
PipeToSupport,
8+
RetrySupport
9+
}
10+
11+
package object ask
12+
extends PipeToSupport
13+
with AskSupport
14+
with GracefulStopSupport
15+
with FutureTimeoutSupport
16+
with RetrySupport
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package reactivemongo.actors
2+
3+
import akka.pattern.FutureTimeoutSupport
4+
5+
package object pattern extends FutureTimeoutSupport
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package reactivemongo.actors
2+
3+
import akka.util.{
4+
ByteString => PekkoByteString,
5+
Timeout => PekkoTimeout
6+
}
7+
8+
package object util {
9+
type Timeout = PekkoTimeout
10+
val Timeout = PekkoTimeout
11+
12+
type ByteString = PekkoByteString
13+
val ByteString = PekkoByteString
14+
15+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package reactivemongo.actors
2+
3+
import akka.actor.Actor
4+
import akka.testkit.{ TestActorRef => PekkoTestActorRef }
5+
6+
package object testkit {
7+
type TestActorRef[T <: Actor] = PekkoTestActorRef[T]
8+
val TestActorRef = PekkoTestActorRef
9+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package reactivemongo.actors
2+
3+
package object actor {
4+
type ActorSystem = org.apache.pekko.actor.ActorSystem
5+
val ActorSystem = org.apache.pekko.actor.ActorSystem
6+
7+
type ActorRef = org.apache.pekko.actor.ActorRef
8+
type Actor = org.apache.pekko.actor.Actor
9+
val Actor = org.apache.pekko.actor.Actor
10+
11+
type Props = org.apache.pekko.actor.Props
12+
val Props = org.apache.pekko.actor.Props
13+
type Terminated = org.apache.pekko.actor.Terminated
14+
type Cancellable = org.apache.pekko.actor.Cancellable
15+
16+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package reactivemongo.actors.pattern
2+
3+
import org.apache.pekko.pattern.{AskSupport, FutureTimeoutSupport, GracefulStopSupport, PipeToSupport, RetrySupport}
4+
5+
package object ask
6+
extends PipeToSupport
7+
with AskSupport
8+
with GracefulStopSupport
9+
with FutureTimeoutSupport
10+
with RetrySupport
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package reactivemongo.actors
2+
3+
import org.apache.pekko.pattern.FutureTimeoutSupport
4+
5+
package object pattern extends FutureTimeoutSupport

0 commit comments

Comments
 (0)