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

Move integration tests into a separate project #7

Merged
merged 2 commits into from
Sep 29, 2023
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
16 changes: 13 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -73,18 +73,28 @@ val `oolong-mongo` = (project in file("oolong-mongo"))
.settings(
libraryDependencies ++= Seq(
("org.mongodb.scala" %% "mongo-scala-driver" % "4.6.1" % Test).cross(CrossVersion.for3Use2_13),
"com.dimafeng" %% "testcontainers-scala-scalatest" % "0.40.8" % Test,
"com.dimafeng" %% "testcontainers-scala-mongodb" % "0.40.8" % Test,
"org.scalatest" %% "scalatest" % "3.2.12" % Test,
"org.slf4j" % "slf4j-api" % "1.7.36" % Test,
"org.slf4j" % "slf4j-simple" % "1.7.36" % Test,
),
Test / fork := true
)

val `oolong-mongo-it` = (project in file("oolong-mongo-it"))
.settings(Settings.common)
.dependsOn(`oolong-mongo` % "test->test;compile->compile")
.settings(
libraryDependencies ++= Seq(
"com.dimafeng" %% "testcontainers-scala-scalatest" % "0.40.8" % Test,
"com.dimafeng" %% "testcontainers-scala-mongodb" % "0.40.8" % Test,
),
Test / fork := true,
publish / skip := true
)

val root = (project in file("."))
.settings(Settings.common)
.aggregate(`oolong-bson`, `oolong-core`, `oolong-mongo`)
.aggregate(`oolong-bson`, `oolong-core`, `oolong-mongo`, `oolong-mongo-it`)
.settings(
pullRemoteCache := {},
pushRemoteCache := {},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,30 +1,21 @@
package oolong.mongo

import java.util.concurrent.atomic.AtomicReference
import scala.collection.mutable.ArrayBuffer
import scala.concurrent.Await
import scala.concurrent.ExecutionContext
import scala.concurrent.Future
import scala.concurrent.duration.*
import scala.util.Failure
import scala.util.Random
import scala.util.Success

import com.dimafeng.testcontainers.ForAllTestContainer
import com.dimafeng.testcontainers.MongoDBContainer
import oolong.bson.*
import oolong.bson.given
import com.dimafeng.testcontainers.{ForAllTestContainer, MongoDBContainer}
import oolong.bson.{*, given}
import oolong.dsl.*
import oolong.mongo.MongoType
import org.mongodb.scala.MongoClient
import org.mongodb.scala.ObservableFuture
import org.mongodb.scala.bson.BsonDocument
import org.mongodb.scala.bson.BsonInt32
import org.mongodb.scala.bson.BsonString
import org.mongodb.scala.bson.{BsonDocument, BsonInt32, BsonString}
import org.mongodb.scala.{MongoClient, ObservableFuture}
import org.scalatest.BeforeAndAfterAll
import org.scalatest.compatible.Assertion
import org.scalatest.flatspec.AsyncFlatSpec

import java.util.concurrent.atomic.AtomicReference
import scala.collection.mutable.ArrayBuffer
import scala.concurrent.{Await, ExecutionContext, Future}
import scala.concurrent.duration.*
import scala.util.{Failure, Random, Success}

class OolongMongoSpec extends AsyncFlatSpec with ForAllTestContainer with BeforeAndAfterAll {

override val container: MongoDBContainer = MongoDBContainer()
Expand Down