diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a6758b4a..d85b0631 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -65,8 +65,10 @@ jobs: report_paths: 'target/**test-reports/TEST-*.xml' github_token: ${{ secrets.GITHUB_TOKEN }} - - name: Check the test coverage is above the minimum criteria - run: sbt coverageAggregate + - name: Check the test coverage is above the minimum criteria and upload coveage data to Coveralls + run: sbt coverageAggregate coveralls + env: + COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} # https://www.scala-sbt.org/1.x/docs/GitHub-Actions-with-sbt.html#Caching - name: Clean files for caching diff --git a/README.md b/README.md index 9a6724af..28bdd702 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ akka-entity-replication === [![CI](https://github.com/lerna-stack/akka-entity-replication/workflows/CI/badge.svg?branch=master)](https://github.com/lerna-stack/akka-entity-replication/actions?query=workflow%3ACI+branch%3Amaster) +[![Coverage Status](https://coveralls.io/repos/github/lerna-stack/akka-entity-replication/badge.svg)](https://coveralls.io/github/lerna-stack/akka-entity-replication) ## Introduction diff --git a/project/plugins.sbt b/project/plugins.sbt index 8e149320..ac78c7fa 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -6,7 +6,9 @@ addSbtPlugin("com.typesafe.sbt" % "sbt-multi-jvm" % "0.4.0") addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.25") -addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.6.1") +addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.8.2") + +addSbtPlugin("org.scoverage" % "sbt-coveralls" % "1.3.1") addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "1.4.1") diff --git a/src/main/scala/lerna/akka/entityreplication/raft/RaftMemberData.scala b/src/main/scala/lerna/akka/entityreplication/raft/RaftMemberData.scala index 35c644ee..e5bd41e7 100644 --- a/src/main/scala/lerna/akka/entityreplication/raft/RaftMemberData.scala +++ b/src/main/scala/lerna/akka/entityreplication/raft/RaftMemberData.scala @@ -374,6 +374,11 @@ private[entityreplication] trait RaftMemberData to <= lastApplied, s"Cannot select the entries (${from}-${to}) unless RaftActor have applied the entries to the entities (lastApplied: ${lastApplied})", ) + if (1 == 2) { + println("uncovered") + } else { + println("covered") + } replicatedLog.sliceEntries(from, to).filter(_.event.entityId.contains(entityId)) }