Skip to content

Commit

Permalink
feat(plugin): Add pie chart of whether on ci
Browse files Browse the repository at this point in the history
  • Loading branch information
PeyaPeyaPeyang committed Dec 30, 2024
1 parent 4e9ceaa commit 2bd520a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import lombok.SneakyThrows;
import org.bstats.MetricsBase;
import org.bstats.bukkit.Metrics;
import org.bstats.charts.SimplePie;
import org.bstats.charts.SingleLineChart;
import org.jetbrains.annotations.NotNull;
import org.kunlab.scenamatica.Scenamatica;
Expand Down Expand Up @@ -50,6 +51,13 @@ private ScenamaticaMetrics(Scenamatica scenamatica)
this.totalTests = 0;

this.addCustomChart(new SingleLineChart("tests_ran", () -> this.totalTests));
this.addCustomChart(new SimplePie("ci", ScenamaticaMetrics::getCIState));
}

private static String getCIState()
{
String ci = System.getenv("CI");
return ci == null ? "no" : "yes";
}

public static ScenamaticaMetrics init(Scenamatica scenamatica)
Expand Down
1 change: 1 addition & 0 deletions docs/docs/README.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ Scenamatica HQ と Scenamatica は, これら関連企業・団体とは一切
Scenamatica では, 追加で以下の情報を収集しています。

+ テストの実行数
+ CI 環境であるかどうか

:::info
テスト・シナリオの内容や, その実行結果に関する情報は収集されません。
Expand Down

0 comments on commit 2bd520a

Please sign in to comment.