Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Run sonar-scanner got java.lang.NullPointerException error on error test result

オープン
#470 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
java, ruby, swift
領域
devtools, testing

調査の方向性

Start with run-sonar-swift.sh and the SonarQube XML report generation path in Slather; inspect how failed test cases are represented in the generated XML. Compare the report with and without the <failure> elements, then reproduce the scanner error using the supplied Xcode, Java, SonarQube, and Slather versions. Done when failed test reports can be scanned without the reported NullPointerException.

索引モデルが issue の本文から書いたものです。

説明

Has anyone had any experience with Swift integration with Sonarqube?

Xcode 12.2
Java 1.8.0_272 AdoptOpenJDK (64-bit)
Sonarqube 4.5.0.2216
Slather 2.6.0

I am modifying the slather command inside ./run-sonar-swift.sh :

slather coverage --sonarqube-xml --build-directory derivedData --output-directory sonar-reports --scheme <scheme> --workspace ios-<workspace>.xcworkspace <project>.xcodeproj

And run the script, but got this error :

17:15:13.766 ERROR: Error during SonarScanner execution
java.lang.NullPointerException
	at java.text.DecimalFormat.parse(DecimalFormat.java:2030)
	at java.text.NumberFormat.parse(NumberFormat.java:383)
	at org.sonar.api.utils.ParsingUtils.parseNumber(ParsingUtils.java:47)

This is the TEST-report.xml file :

<?xml version='1.0' encoding='UTF-8'?>
<testsuites name='X.xctest' tests='12' failures='2'>
  <testsuite name='X.ChatViewTests' tests='2' failures='2'>
    <testcase classname='X.ChatViewTests' name='testSucceed_allAction'>
      <failure message='XCTAssertTrue failed'>X/Cases/Bottom Navigation/ChatViewTests.swift:32</failure>
    </testcase>
    <testcase classname='X.ChatViewTests' name='testSucceed_allAction'>
      <failure message='Failed to get matching snapshot: No matches found for Descendants matching type WebView from input {('>X/Cases/Bottom Navigation/ChatViewTests.swift:34</failure>
    </testcase>
  </testsuite>
  <testsuite name='X.DashboardViewTests' tests='1' failures='0'>
    <testcase classname='X.DashboardViewTests' name='testSucceed_allAction' time='53.418'/>
  </testsuite>
</testsuites>

But when I remove the failure part, become like this :

<?xml version='1.0' encoding='UTF-8'?>
<testsuites name='X.xctest' tests='12' failures='2'>
  <testsuite name='X.DashboardViewTests' tests='1' failures='0'>
    <testcase classname='X.DashboardViewTests' name='testSucceed_allAction' time='53.418'/>
  </testsuite>
</testsuites>

It works. Anyone experienced this and any solutions? Thanks.

主要言語
Ruby
スター
1.6k
フォーク
239
平均マージ
1日 9時間
マージ済み PR(30日)
2

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

SlatherOrg/slather のほかの issue

SlatherOrg/slather の issue をすべて見る

似ている issue

Ruby の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。