Skip to content
Draft
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
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ jobs:
- name: Check the test coverage is above the minimum criteria
run: sbt +coverageReport

- name: Upload coverage 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
run: |
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# lerna-app-library

[![Coverage Status](https://coveralls.io/repos/github/lerna-stack/lerna-app-library/badge.svg?branch=main)](https://coveralls.io/github/lerna-stack/lerna-app-library?branch=main)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

結果を見る限り、命令網羅(C0)しか取得できていないように見える。

image
https://coveralls.io/github/lerna-stack/lerna-app-library

設定で、branch coverage の機能は有効化されている。

image
https://coveralls.io/github/lerna-stack/lerna-app-library/settings

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coveralls の API ドキュメントを確認すると、coverage という(行ごとのカバレッジを表現する?)フィールドの他に branches という(分岐のカバレッジを表現する?)フィールドがある模様。coverage は必須のフィールドだが、branches はオプショナルなフィールドとして定義されている。

OBJECTS: SOURCE FILE

API Reference | Coveralls Docs

しかし、sbt-coveralls の実装を確認すると coverage フィールドしか設定されていないように見える。

    gen.writeFieldName("coverage")
    gen.writeStartArray()
    report.lineCoverage.foreach {
      case Some(x) => gen.writeNumber(x)
      case _ => gen.writeNull()
    }

sbt-coveralls/CoverallPayloadWriter.scala at v1.3.1 · scoverage/sbt-coveralls

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

別のプロジェクトだが、分岐網羅のステータスが確認できているプロジェクトがあった。

sbt-coveralls が brances をサポートすると、lerna-app-library においても同様の表示ができるようになることが期待できる。

image


image

https://coveralls.io/builds/40221430

A library that is useful for building applications that run on Lerna Stack.

## Modules
Expand Down
2 changes: 2 additions & 0 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ addSbtPlugin("org.wartremover" % "sbt-wartremover-contrib" % "1.3.1")

addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.8.1")

addSbtPlugin("org.scoverage" % "sbt-coveralls" % "1.3.1")

// ScalaPB
addSbtPlugin("com.thesamet" % "sbt-protoc" % "1.0.2")
libraryDependencies += "com.thesamet.scalapb" %% "compilerplugin" % "0.11.3"
Expand Down