From da20644027decfd915176a6d2c5d8cd5736a5537 Mon Sep 17 00:00:00 2001 From: Kazuki Negoro Date: Thu, 25 Nov 2021 17:01:39 +0900 Subject: [PATCH 1/4] =?UTF-8?q?=F0=9F=91=B7chore:=20Upload=20coverage=20da?= =?UTF-8?q?ta=20to=20Coveralls=20with=20CI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 6 ++++-- project/plugins.sbt | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) 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/project/plugins.sbt b/project/plugins.sbt index 8e149320..621d853f 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -8,6 +8,8 @@ addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.25") addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.6.1") +addSbtPlugin("org.scoverage" % "sbt-coveralls" % "1.3.1") + addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "1.4.1") addSbtPlugin("com.typesafe.sbt" % "sbt-ghpages" % "0.6.3") From 0df4ca6c415135239c243a14eeedf2fd71edf925 Mon Sep 17 00:00:00 2001 From: Kazuki Negoro Date: Thu, 25 Nov 2021 17:17:18 +0900 Subject: [PATCH 2/4] =?UTF-8?q?=F0=9F=93=9Adoc:=20Add=20a=20badge=20that?= =?UTF-8?q?=20notices=20coverage=20status?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 1 + 1 file changed, 1 insertion(+) 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 From 079f9d119a1c395eb381060cc56b77b6736847d0 Mon Sep 17 00:00:00 2001 From: Kazuki Negoro Date: Thu, 25 Nov 2021 16:58:10 +0900 Subject: [PATCH 3/4] =?UTF-8?q?=F0=9F=91=B7chore:=20Bump=20up=20sbt-scover?= =?UTF-8?q?age=20version=20to=201.8.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- project/plugins.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/plugins.sbt b/project/plugins.sbt index 621d853f..ac78c7fa 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -6,7 +6,7 @@ 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") From 4a45ca949d7aeb3df04240bac6b5cd486aae5652 Mon Sep 17 00:00:00 2001 From: Kazuki Negoro Date: Tue, 22 Mar 2022 14:10:50 +0900 Subject: [PATCH 4/4] test --- .../lerna/akka/entityreplication/raft/RaftMemberData.scala | 5 +++++ 1 file changed, 5 insertions(+) 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)) }