Skip to content

Commit

Permalink
Merge branch 'master' into update/slf4j-api-2.0.12
Browse files Browse the repository at this point in the history
  • Loading branch information
sksamuel authored Mar 11, 2024
2 parents 75ee6ae + abae1ed commit 4179852
Show file tree
Hide file tree
Showing 14 changed files with 30 additions and 28 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
java-version: 11

- name: Launch elastic docker
run: docker run -d -it -p 39227:9200 -p 39337:9300 -e "discovery.type=single-node" -v /home/runner/work/elastic4s/elastic4s/elastic4s-tests/src/test/resources/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml docker.elastic.co/elasticsearch/elasticsearch:8.5.3
run: docker run -d -it -p 39227:9200 -p 39337:9300 -e "discovery.type=single-node" -v /home/runner/work/elastic4s/elastic4s/elastic4s-tests/src/test/resources/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml docker.elastic.co/elasticsearch/elasticsearch:8.11.4

- name: run tests
run: sbt ++2.12.12 test
Expand Down Expand Up @@ -65,7 +65,7 @@ jobs:
java-version: 11

- name: Launch elastic docker
run: docker run -d -it -p 39227:9200 -p 39337:9300 -e "discovery.type=single-node" -v /home/runner/work/elastic4s/elastic4s/elastic4s-tests/src/test/resources/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml docker.elastic.co/elasticsearch/elasticsearch:8.5.3
run: docker run -d -it -p 39227:9200 -p 39337:9300 -e "discovery.type=single-node" -v /home/runner/work/elastic4s/elastic4s/elastic4s-tests/src/test/resources/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml docker.elastic.co/elasticsearch/elasticsearch:8.11.4

- name: run tests
run: sbt ++2.13.4 test
Expand Down Expand Up @@ -105,7 +105,7 @@ jobs:
java-version: 11

- name: Launch elastic docker
run: docker run -d -it -p 39227:9200 -p 39337:9300 -e "discovery.type=single-node" -v /home/runner/work/elastic4s/elastic4s/elastic4s-tests/src/test/resources/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml docker.elastic.co/elasticsearch/elasticsearch:8.5.3
run: docker run -d -it -p 39227:9200 -p 39337:9300 -e "discovery.type=single-node" -v /home/runner/work/elastic4s/elastic4s/elastic4s-tests/src/test/resources/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml docker.elastic.co/elasticsearch/elasticsearch:8.11.4

- name: run tests
run: sbt ++3.3.0 elastic4s-scala3/test
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
java-version: 11

- name: Launch elastic docker
run: docker run -d -it -p 39227:9200 -p 39337:9300 -e "discovery.type=single-node" -v /home/runner/work/elastic4s/elastic4s/elastic4s-tests/src/test/resources/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml docker.elastic.co/elasticsearch/elasticsearch:8.5.3
run: docker run -d -it -p 39227:9200 -p 39337:9300 -e "discovery.type=single-node" -v /home/runner/work/elastic4s/elastic4s/elastic4s-tests/src/test/resources/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml docker.elastic.co/elasticsearch/elasticsearch:8.11.4

- name: run tests
timeout-minutes: 30
Expand All @@ -42,7 +42,7 @@ jobs:
java-version: 11

- name: Launch elastic docker
run: docker run -d -it -p 39227:9200 -p 39337:9300 -e "discovery.type=single-node" -v /home/runner/work/elastic4s/elastic4s/elastic4s-tests/src/test/resources/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml docker.elastic.co/elasticsearch/elasticsearch:8.5.3
run: docker run -d -it -p 39227:9200 -p 39337:9300 -e "discovery.type=single-node" -v /home/runner/work/elastic4s/elastic4s/elastic4s-tests/src/test/resources/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml docker.elastic.co/elasticsearch/elasticsearch:8.11.4

- name: run tests
timeout-minutes: 30
Expand All @@ -62,7 +62,7 @@ jobs:
java-version: 11

- name: Launch elastic docker
run: docker run -d -it -p 39227:9200 -p 39337:9300 -e "discovery.type=single-node" -v /home/runner/work/elastic4s/elastic4s/elastic4s-tests/src/test/resources/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml docker.elastic.co/elasticsearch/elasticsearch:8.5.3
run: docker run -d -it -p 39227:9200 -p 39337:9300 -e "discovery.type=single-node" -v /home/runner/work/elastic4s/elastic4s/elastic4s-tests/src/test/resources/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml docker.elastic.co/elasticsearch/elasticsearch:8.11.4

- name: run tests
run: sbt ++3.3.0 elastic4s-scala3/test
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
java-version: 11

- name: Launch elastic docker
run: docker run -d -it -p 39227:9200 -p 39337:9300 -e "discovery.type=single-node" -v /home/runner/work/elastic4s/elastic4s/elastic4s-tests/src/test/resources/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml docker.elastic.co/elasticsearch/elasticsearch:8.5.3
run: docker run -d -it -p 39227:9200 -p 39337:9300 -e "discovery.type=single-node" -v /home/runner/work/elastic4s/elastic4s/elastic4s-tests/src/test/resources/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml docker.elastic.co/elasticsearch/elasticsearch:8.11.4

- name: Import GPG key
id: import_gpg
Expand Down
1 change: 1 addition & 0 deletions .java-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
11
8 changes: 4 additions & 4 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def ossrhUsername = sys.env.getOrElse("OSSRH_USERNAME", "")
def ossrhPassword = sys.env.getOrElse("OSSRH_PASSWORD", "")

val scala2Versions = Seq("2.12.17", "2.13.12")
val scalaAllVersions = scala2Versions :+ "3.3.1"
val scalaAllVersions = scala2Versions :+ "3.3.3"
lazy val commonScalaVersionSettings = Seq(
scalaVersion := "2.12.17",
crossScalaVersions := Nil
Expand Down Expand Up @@ -354,9 +354,9 @@ lazy val tests = (project in file("elastic4s-tests"))
"com.fasterxml.jackson.core" % "jackson-core" % JacksonVersion % "test",
"com.fasterxml.jackson.core" % "jackson-databind" % JacksonVersion % "test",
"com.fasterxml.jackson.module" %% "jackson-module-scala" % JacksonVersion % "test" exclude("org.scala-lang", "scala-library"),
"org.apache.logging.log4j" % "log4j-api" % "2.22.1" % "test",
"org.apache.logging.log4j" % "log4j-slf4j-impl" % "2.22.1" % "test",
"org.apache.logging.log4j" % "log4j-core" % "2.22.1" % "test"
"org.apache.logging.log4j" % "log4j-api" % "2.23.0" % "test",
"org.apache.logging.log4j" % "log4j-slf4j-impl" % "2.23.0" % "test",
"org.apache.logging.log4j" % "log4j-core" % "2.23.0" % "test"
),
Test / fork := false,
Test / parallelExecution := false,
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: '3.3'

services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:8.8.0
image: docker.elastic.co/elasticsearch/elasticsearch:8.11.4
environment:
discovery.type: single-node
network.host: 0.0.0.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ class SourceAsContentBuilderTest extends AnyFunSuite with Matchers {

test("source as content builder should handle bigdecimals") {
val map = Map("dec" -> BigDecimal("9223372036854776000"))
SourceAsContentBuilder(map).string shouldBe """{"dec":9.223372036854776E+18}"""
SourceAsContentBuilder(map).string shouldBe """{"dec":9223372036854776000}"""
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ case class IndexStatsRequest(indices: Indexes)

case class IndicesOptionsRequest(allowNoIndices: Boolean = false,
ignoreUnavailable: Boolean = false,
expandWildcardsOpen: Boolean = false,
expandWildcardsOpen: Boolean = true, // Default ES value
expandWildcardClosed: Boolean = false)

case class IndicesExistsRequest(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package com.sksamuel.elastic4s.requests.snapshots

import com.fasterxml.jackson.annotation.{JsonProperty, JsonSubTypes, JsonTypeInfo}
import com.sksamuel.elastic4s.ElasticError
import com.sksamuel.elastic4s.requests.common.Shards

import scala.concurrent.duration._

case class CreateRepositoryResponse(acknowledged: Boolean)
Expand All @@ -17,7 +19,7 @@ case class CreateSnapshotResponseAsync(accepted: Boolean) extends CreateSnapshot
case class CreateSnapshotResponseAwait(snapshot: Snapshot) extends CreateSnapshotResponse {
override def succeeded: Boolean = snapshot.state == "SUCCESS"
}
case class GetSnapshotResponse(snapshots: Seq[Snapshot])
case class GetSnapshotResponse(snapshots: Seq[Snapshot], failures : Map[String, ElasticError])
case class Snapshot(snapshot: String,
uuid: String,
@JsonProperty("version_id") versionId: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class PercentilesAggregationTest extends AnyFreeSpec with DockerTests with Match
}.await.result
resp.totalHits shouldBe 8
val agg = resp.aggs.percentiles("agg1")
agg.values shouldBe Map("99.0" -> 2717.0, "25.0" -> 894.0, "95.0" -> 2717.0, "50.0" -> 1707.5, "75.0" -> 2022.0, "1.0" -> 169.0, "5.0" -> 169.0)
agg.values shouldBe Map("99.0" -> 2671.92, "25.0" -> 955.5, "95.0" -> 2491.5999999999995, "50.0" -> 1707.5, "75.0" -> 1996.5, "1.0" -> 211.14, "5.0" -> 379.70000000000005)
}
"should allow setting which percentiles to return" in {
val resp = client.execute {
Expand All @@ -56,7 +56,7 @@ class PercentilesAggregationTest extends AnyFreeSpec with DockerTests with Match
}.await.result
resp.totalHits shouldBe 8
val agg = resp.aggs.percentiles("agg1")
agg.values shouldBe Map("50.0" -> 1707.5, "80.0" -> 2062.8)
agg.values shouldBe Map("50.0" -> 1707.5, "80.0" -> 2032.2)
}
"should support keyed=false" in {
val resp = client.execute {
Expand All @@ -66,7 +66,7 @@ class PercentilesAggregationTest extends AnyFreeSpec with DockerTests with Match
}.await.result
resp.totalHits shouldBe 8
val agg = resp.aggs.percentiles("agg1")
agg.values shouldBe Map("50.0" -> 1707.5, "80.0" -> 2062.8)
agg.values shouldBe Map("50.0" -> 1707.5, "80.0" -> 2032.2)
}
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package com.sksamuel.elastic4s.requests.snapshots

import java.util.UUID

import com.sksamuel.elastic4s.Index
import com.sksamuel.elastic4s.{Index, Response}
import com.sksamuel.elastic4s.testkit.DockerTests
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers
Expand Down Expand Up @@ -63,7 +62,7 @@ class SnapshotTest extends AnyFlatSpec with Matchers with DockerTests {
it should "error when the repo does not exist" in {
client.execute {
getSnapshot(snapshotName, "bbbbb")
}.await.error.`type` shouldBe "repository_missing_exception"
}.await.result.failures("bbbbb").`type` shouldBe "repository_missing_exception"
}

"restore snapshot" should "error when an index clashes" in {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@ class SearchTest extends AnyWordSpec with DockerTests with Matchers {
"count" -> 2
),
indexInto("chess").fields(
"name" -> "knight",
"aka" -> "horse",
"name" -> "knight",
"value" -> 3,
"count" -> 2
),
indexInto("chess").fields(
"name" -> "rook",
"aka" -> "castle",
"name" -> "rook",
"value" -> 5,
"count" -> 2
),
Expand Down
8 changes: 4 additions & 4 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ object Dependencies {
val AkkaHttpVersion = "10.2.10"
val AkkaVersion = "2.6.20"
val CatsEffect2Version = "2.5.5"
val CatsEffectVersion = "3.5.3"
val CatsEffectVersion = "3.5.4"
val CatsVersion = "2.0.0"
val CirceVersion = "0.14.6"
val CommonsIoVersion = "2.15.1"
val ElasticsearchVersion = "8.11.4"
val ExtsVersion = "1.61.1"
val JacksonVersion = "2.14.3"
val JacksonVersion = "2.16.0"
val Json4sVersion = "4.0.7"
val Log4jVersion = "2.15.0"
val MockitoVersion = "5.8.0"
val MockitoVersion = "5.11.0"
val MonixVersion = "3.4.1"
val PekkoHttpVersion = "1.0.0"
val PekkoVersion = "1.0.2"
Expand All @@ -26,7 +26,7 @@ object Dependencies {
val ScalatestVersion = "3.2.16"
val Slf4jVersion = "2.0.12"
val SprayJsonVersion = "1.3.6"
val SttpVersion = "3.9.2"
val SttpVersion = "3.9.4"
val ZIOJson1Version = "0.1.5"
val ZIO1Version = "1.0.18"
val ZIOVersion = "2.0.21"
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.6.2
sbt.version=1.9.9

0 comments on commit 4179852

Please sign in to comment.