Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(reporters): Add three scan issues to report test assets #8552

Merged
merged 2 commits into from
Apr 25, 2024
Merged
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

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ repository:
- pattern: "**/*.java"
reason: "EXAMPLE_OF"
comment: "These are example files."
- pattern: "analyzer/src/funTest/assets/projects/synthetic/gradle/lib/excluded-file.dat"
reason: "DATA_FILE_OF"
scopes:
- pattern: "testCompile"
reason: "TEST_DEPENDENCY_OF"
Expand Down Expand Up @@ -479,6 +481,11 @@ scanner:
path: "project/file1.java"
start_line: 1
end_line: 1
issues:
- timestamp: "2024-04-22T10:36:10.661544294Z"
source: "FakeScanner"
message: "ERROR: Timeout after 300 seconds while scanning file 'project/file-within-excluded-project.dat'."
affected_path: "project/file-of-excluded-project.dat"
- provenance:
vcs_info:
type: "Git"
Expand Down Expand Up @@ -529,6 +536,14 @@ scanner:
\ Please make sure the published POM file includes the SCM connection, see:\
\ https://docs.gradle.org/current/userguide/publishing_maven.html#sec:modifying_the_generated_pom"
severity: "ERROR"
- timestamp: "2024-04-22T10:36:10.661544294Z"
source: "FakeScanner"
message: "ERROR: Timeout after 300 seconds while scanning file 'analyzer/src/funTest/assets/projects/synthetic/gradle/lib/included-file.dat'."
affected_path: "analyzer/src/funTest/assets/projects/synthetic/gradle/lib/included-file.dat"
- timestamp: "2024-04-22T10:36:10.661544294Z"
source: "FakeScanner"
message: "ERROR: Timeout after 300 seconds while scanning file 'analyzer/src/funTest/assets/projects/synthetic/gradle/lib/excluded-file.dat'."
affected_path: "analyzer/src/funTest/assets/projects/synthetic/gradle/lib/excluded-file.dat"
- provenance:
source_artifact:
url: "https://repo.maven.apache.org/maven2/com/h2database/h2/1.4.200/h2-1.4.200-sources.jar"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ repository:
- pattern: "**/*.java"
reason: "EXAMPLE_OF"
comment: "These are example files."
- pattern: "analyzer/src/funTest/assets/projects/synthetic/gradle/lib/excluded-file.dat"
reason: "DATA_FILE_OF"
scopes:
- pattern: "testCompile"
reason: "TEST_DEPENDENCY_OF"
Expand Down Expand Up @@ -479,6 +481,11 @@ scanner:
path: "project/file1.java"
start_line: 1
end_line: 1
issues:
- timestamp: "2024-04-22T10:36:10.661544294Z"
source: "FakeScanner"
message: "ERROR: Timeout after 300 seconds while scanning file 'project/file-within-excluded-project.dat'."
affected_path: "project/file-of-excluded-project.dat"
- provenance:
vcs_info:
type: "Git"
Expand Down Expand Up @@ -529,6 +536,14 @@ scanner:
\ Please make sure the published POM file includes the SCM connection, see:\
\ https://docs.gradle.org/current/userguide/publishing_maven.html#sec:modifying_the_generated_pom"
severity: "ERROR"
- timestamp: "2024-04-22T10:36:10.661544294Z"
source: "FakeScanner"
message: "ERROR: Timeout after 300 seconds while scanning file 'analyzer/src/funTest/assets/projects/synthetic/gradle/lib/included-file.dat'."
affected_path: "analyzer/src/funTest/assets/projects/synthetic/gradle/lib/included-file.dat"
- timestamp: "2024-04-22T10:36:10.661544294Z"
source: "FakeScanner"
message: "ERROR: Timeout after 300 seconds while scanning file 'analyzer/src/funTest/assets/projects/synthetic/gradle/lib/excluded-file.dat'."
affected_path: "analyzer/src/funTest/assets/projects/synthetic/gradle/lib/excluded-file.dat"
- provenance:
source_artifact:
url: "https://repo.maven.apache.org/maven2/com/h2database/h2/1.4.200/h2-1.4.200-sources.jar"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ repository:
- pattern: "**/*.java"
reason: "EXAMPLE_OF"
comment: "These are example files."
- pattern: "analyzer/src/funTest/assets/projects/synthetic/gradle/lib/excluded-file.dat"
reason: "DATA_FILE_OF"
scopes:
- pattern: "testCompile"
reason: "TEST_DEPENDENCY_OF"
Expand Down Expand Up @@ -479,6 +481,11 @@ scanner:
path: "project/file1.java"
start_line: 1
end_line: 1
issues:
- timestamp: "2024-04-22T10:36:10.661544294Z"
source: "FakeScanner"
message: "ERROR: Timeout after 300 seconds while scanning file 'project/file-within-excluded-project.dat'."
affected_path: "project/file-of-excluded-project.dat"
- provenance:
vcs_info:
type: "Git"
Expand Down Expand Up @@ -529,6 +536,14 @@ scanner:
\ Please make sure the published POM file includes the SCM connection, see:\
\ https://docs.gradle.org/current/userguide/publishing_maven.html#sec:modifying_the_generated_pom"
severity: "ERROR"
- timestamp: "2024-04-22T10:36:10.661544294Z"
source: "FakeScanner"
message: "ERROR: Timeout after 300 seconds while scanning file 'analyzer/src/funTest/assets/projects/synthetic/gradle/lib/included-file.dat'."
affected_path: "analyzer/src/funTest/assets/projects/synthetic/gradle/lib/included-file.dat"
- timestamp: "2024-04-22T10:36:10.661544294Z"
source: "FakeScanner"
message: "ERROR: Timeout after 300 seconds while scanning file 'analyzer/src/funTest/assets/projects/synthetic/gradle/lib/excluded-file.dat'."
affected_path: "analyzer/src/funTest/assets/projects/synthetic/gradle/lib/excluded-file.dat"
- provenance:
source_artifact:
url: "https://repo.maven.apache.org/maven2/com/h2database/h2/1.4.200/h2-1.4.200-sources.jar"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ <h2>Labels</h2>
<h2>Index</h2>
<ul>
<li><a href="#rule-violation-summary">Rule Violation Summary (1 errors, 1 warnings, 0 hints to resolve)</a></li>
<li><a href="#issue-summary">Issue Summary (1 errors, 0 warnings, 0 hints to resolve)</a></li>
<li><a href="#issue-summary">Issue Summary (3 errors, 0 warnings, 0 hints to resolve)</a></li>
<li><a href="#Gradle:org.ossreviewtoolkit:nested-fake-project:1.0.0">Gradle:org.ossreviewtoolkit:nested-fake-project:1.0.0
<div class="ort-reason">Excluded: EXAMPLE_OF - The project is an example.</div></a></li>
<li><a href="#Gradle:org.ossreviewtoolkit.gradle.example:lib:1.0.0">Gradle:org.ossreviewtoolkit.gradle.example:lib:1.0.0</a></li>
Expand Down Expand Up @@ -531,7 +531,7 @@ <h2 id="rule-violation-summary">Rule Violation Summary (1 errors, 1 warnings, 0
</tr>
</tbody>
</table>
<h2 id="issue-summary">Issue Summary (1 errors, 0 warnings, 0 hints to resolve)</h2>
<h2 id="issue-summary">Issue Summary (3 errors, 0 warnings, 0 hints to resolve)</h2>
<p>Issues from excluded components are not shown in this summary.</p>
<h3>Packages</h3>
<table class="ort-report-table">
Expand Down Expand Up @@ -563,6 +563,40 @@ <h3>Packages</h3>

<li><strong>Step 2</strong></li>

<li><em><strong>Step 3</strong></em>
<code>Some long issue resolution text to verify that overflow:scroll is working as expected.</code></li>
</ul>
</details>
<li>
<p>2024-04-22T10:36:10.661544294Z [ERROR]: FakeScanner - ERROR: Timeout after 300 seconds
while scanning file 'analyzer/src/funTest/assets/projects/synthetic/gradle/lib/included-file.dat'.</p>
<p></p>
</li>
<details>
<summary>How to fix</summary>
<ul>

<li><em>Step 1</em></li>

<li><strong>Step 2</strong></li>

<li><em><strong>Step 3</strong></em>
<code>Some long issue resolution text to verify that overflow:scroll is working as expected.</code></li>
</ul>
</details>
<li>
<p>2024-04-22T10:36:10.661544294Z [ERROR]: FakeScanner - ERROR: Timeout after 300 seconds
while scanning file 'analyzer/src/funTest/assets/projects/synthetic/gradle/lib/excluded-file.dat'.</p>
<p></p>
</li>
<details>
<summary>How to fix</summary>
<ul>

<li><em>Step 1</em></li>

<li><strong>Step 2</strong></li>

<li><em><strong>Step 3</strong></em>
<code>Some long issue resolution text to verify that overflow:scroll is working as expected.</code></li>
</ul>
Expand Down Expand Up @@ -612,7 +646,7 @@ <h3 class="ort-excluded">Packages</h3>
</tr>
</thead>
<tbody>
<tr class="ort-success " id="Gradle:org.ossreviewtoolkit:nested-fake-project:1.0.0-pkg-1">
<tr class="ort-error " id="Gradle:org.ossreviewtoolkit:nested-fake-project:1.0.0-pkg-1">
<td><a href="#Gradle:org.ossreviewtoolkit:nested-fake-project:1.0.0-pkg-1">1</a></td>
<td>Gradle:org.ossreviewtoolkit:nested-fake-project:1.0.0</td>
<td></td>
Expand All @@ -636,7 +670,12 @@ <h3 class="ort-excluded">Packages</h3>
<ul></ul>
</td>
<td>
<ul></ul>
<ul>
<li>
<p>2024-04-22T10:36:10.661544294Z [ERROR]: FakeScanner - ERROR: Timeout after 300 seconds
while scanning file 'project/file-within-excluded-project.dat'.</p>
</li>
</ul>
</td>
</tr>
</tbody>
Expand Down Expand Up @@ -704,6 +743,14 @@ <h3 class="">Packages</h3>
'Gradle:org.ossreviewtoolkit.gradle.example:lib:1.0.0'.<br>Caused by: DownloadException: No VCS URL provided for 'Gradle:org.ossreviewtoolkit.gradle.example:lib:1.0.0'.
Please make sure the published POM file includes the SCM connection, see: https://docs.gradle.org/current/userguide/publishing_maven.html#sec:modifying_the_generated_pom</p>
</li>
<li>
<p>2024-04-22T10:36:10.661544294Z [ERROR]: FakeScanner - ERROR: Timeout after 300 seconds
while scanning file 'analyzer/src/funTest/assets/projects/synthetic/gradle/lib/included-file.dat'.</p>
</li>
<li>
<p>2024-04-22T10:36:10.661544294Z [ERROR]: FakeScanner - ERROR: Timeout after 300 seconds
while scanning file 'analyzer/src/funTest/assets/projects/synthetic/gradle/lib/excluded-file.dat'.</p>
</li>
</ul>
</td>
</tr>
Expand Down Expand Up @@ -913,6 +960,8 @@ <h2 id="repository-configuration">Repository Configuration</h2>
- pattern: "**/*.java"
reason: "EXAMPLE_OF"
comment: "These are example files."
- pattern: "analyzer/src/funTest/assets/projects/synthetic/gradle/lib/excluded-file.dat"
reason: "DATA_FILE_OF"
scopes:
- pattern: "testCompile"
reason: "TEST_DEPENDENCY_OF"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class StaticHtmlReporterFunTest : WordSpec({
"successfully export to a static HTML page" {
val timeStampPattern = Regex("\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z")
val ortResult = readOrtResult("src/funTest/assets/reporter-test-input.yml")
val actualReport = generateReport(ortResult).replace(timeStampPattern, "<REPLACE_TIMESTAMP>")
val actualReport = generateReport(ortResult).replaceFirst(timeStampPattern, "<REPLACE_TIMESTAMP>")

val expectedReport = matchExpectedResult(
getAssetFile("static-html-reporter-test-expected-output.html"),
Expand Down
Loading