Skip to content

Commit 46bae36

Browse files
committed
coverage-reporter/
1 parent db6abd8 commit 46bae36

File tree

6 files changed

+30
-42
lines changed

6 files changed

+30
-42
lines changed

docusaurus/docs/coverage-reporter/_order.ts

Lines changed: 0 additions & 7 deletions
This file was deleted.

docusaurus/docs/coverage-reporter/alternative-ways-of-running-coverage-reporter.md renamed to docusaurus/docs/coverage-reporter/alternative-ways-of-running-coverage-reporter.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ The following sections list the alternative ways of running or installing Codacy
1010
**If you're using Codacy Self-hosted** make sure that you use a Codacy Coverage Reporter version compatible with your Codacy instance.
1111
:::
1212

13-
## Bash script (recommended) {#bash-script}
13+
## Bash script (recommended) \{#bash-script\}
1414
The recommended way to run the Codacy Coverage Reporter is by using the [self-contained bash script `get.sh`](https://github.com/codacy/codacy-coverage-reporter/blob/master/get.sh) that automatically downloads and runs the most recent version of the Codacy Coverage Reporter:
1515

1616
- On Ubuntu, run:

docusaurus/docs/coverage-reporter/index.md renamed to docusaurus/docs/coverage-reporter/index.mdx

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Complete these main steps to set up coverage for your repository:
2424

2525
The next sections include detailed instructions on how to complete each step of the setup process.
2626

27-
## 1. Generating coverage reports
27+
## 1. Generating coverage reports \{#generating-coverage\}
2828
Before setting up Codacy to display code coverage metrics for your repository you must have tests and use tools to generate coverage reports for the source code files in your repository.
2929

3030
Consider the following when generating coverage reports for your repository:
@@ -129,15 +129,15 @@ If you're generating a report format that Codacy doesn't support yet, [contribut
129129
- [<span class="skip-vale">danielpalme/ReportGenerator</span>](https://github.com/danielpalme/ReportGenerator): convert between different report formats
130130

131131
:::caution
132-
Make sure that you [specify the language](uploading-coverage-in-advanced-scenarios.md#unsupported-languages) when uploading coverage for an unsupported language.
132+
Make sure that you [specify the language](./uploading-coverage-in-advanced-scenarios.md#unsupported-languages) when uploading coverage for an unsupported language.
133133
:::
134134

135135
As a last resort, you can also send the coverage data directly by calling one of the following Codacy API endpoints:
136136

137137
- [<span class="skip-vale">saveCoverage</span>](https://api.codacy.com/swagger#savecoverage)
138138
- [saveCoverageWithAccountToken](https://api.codacy.com/swagger#savecoveragewithaccounttoken)
139139

140-
## 2. Uploading coverage data to Codacy
140+
## 2. Uploading coverage data to Codacy \{#uploading-coverage\}
141141
After having coverage reports set up for your repository, you must use the Codacy Coverage Reporter to upload them to Codacy. The recommended way to do this is by using a CI/CD platform that automatically runs tests, generates coverage, and then uses the Codacy Coverage Reporter to upload the coverage report information to Codacy.
142142

143143
:::caution
@@ -149,20 +149,20 @@ Please note that Codacy needs to receive coverage data for:
149149
:::
150150

151151
:::note[Alternative ways of running the Codacy Coverage Reporter]
152-
Codacy makes available [alternative ways to run the Codacy Coverage Reporter](alternative-ways-of-running-coverage-reporter.md), such as by installing the binary manually or by using Docker, a GitHub Action, or a CircleCI Orb.
152+
Codacy makes available [alternative ways to run the Codacy Coverage Reporter](./alternative-ways-of-running-coverage-reporter), such as by installing the binary manually or by using Docker, a GitHub Action, or a CircleCI Orb.
153153

154-
However, the instructions on this page assume that you'll run the recommended [self-contained bash script `get.sh`](alternative-ways-of-running-coverage-reporter.md#bash-script) to automatically download and run the most recent version of the Codacy Coverage Reporter.
154+
However, the instructions on this page assume that you'll run the recommended [self-contained bash script `get.sh`](./alternative-ways-of-running-coverage-reporter#bash-script) to automatically download and run the most recent version of the Codacy Coverage Reporter.
155155

156156
:::
157157

158158
1. Set up an API token to allow Codacy Coverage Reporter to authenticate on Codacy:
159-
- **If you're setting up coverage for one repository**, [obtain a repository API token](../codacy-api/api-tokens.md#repository-api-tokens) and set the following environment variable to specify your repository API token:
159+
- **If you're setting up coverage for one repository**, [obtain a repository API token](../codacy-api/api-tokens#repository-api-tokens) and set the following environment variable to specify your repository API token:
160160

161161
```bash
162162
export CODACY_PROJECT_TOKEN=<your repository API token>
163163
```
164164

165-
- **If you're setting up and automating coverage for multiple repositories**, [obtain an account API Token](../codacy-api/api-tokens.md#account-api-tokens) and set the following environment variables:
165+
- **If you're setting up and automating coverage for multiple repositories**, [obtain an account API Token](../codacy-api/api-tokens#account-api-tokens) and set the following environment variables:
166166

167167
- **CODACY_API_TOKEN:** Your account API token.
168168

@@ -206,7 +206,7 @@ However, the instructions on this page assume that you'll run the recommended [s
206206
Be sure to also check the [instructions for more advanced scenarios](uploading-coverage-in-advanced-scenarios.md) while uploading the coverage data to Codacy, such as when running parallel tests, using monorepos, or testing source code in multiple or unsupported languages.
207207
:::
208208

209-
## 3. Validating that the coverage setup is complete
209+
## 3. Validating that the coverage setup is complete \{#validating-coverage\}
210210
Codacy displays the code coverage in each branch, as well as the evolution of code coverage between commits and the code coverage variation introduced by pull requests.
211211

212212
Because of this, to ensure that all code coverage metrics are available on Codacy, you must have successfully uploaded coverage data and analyzed:
@@ -237,7 +237,7 @@ Follow these instructions to validate that your coverage setup is working correc
237237

238238
If there are commits with a status different from **Processed**, please follow the troubleshooting instructions for the corresponding error status and click the button **Test integration** to display any new coverage reports uploaded to Codacy.
239239

240-
### Commit not found
240+
### Commit not found \{#status-commit-not-found\}
241241
Codacy doesn't have information about the commit associated with the coverage data.
242242

243243
<table>
@@ -272,7 +272,7 @@ Follow these instructions to validate that your coverage setup is working correc
272272
</tbody>
273273
</table>
274274

275-
### Branch not enabled
275+
### Branch not enabled \{#status-branch-not-enabled\}
276276
The commit associated with the coverage data doesn't belong to any branch that Codacy is analyzing.
277277

278278
<table>
@@ -307,7 +307,7 @@ Follow these instructions to validate that your coverage setup is working correc
307307
</tbody>
308308
</table>
309309

310-
### Commit not analyzed
310+
### Commit not analyzed \{#status-commit-not-analyzed\}
311311
Due to technical limitations, Codacy only reports coverage for a commit after successfully completing the static code analysis of that commit.
312312

313313
<table>
@@ -335,7 +335,7 @@ Follow these instructions to validate that your coverage setup is working correc
335335
Codacy didn't analyze the commit on a private repository because the committer doesn't belong to the Codacy organization.
336336
</td>
337337
<td>
338-
Make sure that you <a href="../organizations/managing-people/#adding-people">add all committers to your Codacy organization</a>.
338+
Make sure that you <a href="../organizations/managing-people#adding-people">add all committers to your Codacy organization</a>.
339339
</td>
340340
</tr>
341341
<tr>
@@ -365,7 +365,7 @@ Follow these instructions to validate that your coverage setup is working correc
365365
</tbody>
366366
</table>
367367

368-
### Final report not sent
368+
### Final report not sent \{#status-final-report-not-sent\}
369369
Codacy is waiting to receive more coverage data before reporting the coverage for a commit.
370370

371371
<table>
@@ -391,7 +391,7 @@ Follow these instructions to validate that your coverage setup is working correc
391391
</tbody>
392392
</table>
393393

394-
### Pending
394+
### Pending \{#status-pending\}
395395
Codacy is waiting to receive valid coverage data for the files in your repository.
396396

397397
<table>
@@ -448,7 +448,7 @@ Follow these instructions to validate that your coverage setup is working correc
448448

449449
![Commits that must have received coverage data](images/coverage-pr-commits.png)
450450

451-
Click **View logs** on a pull request detail page to see the SHA-1 hashes of the commits that are missing coverage data. If you have many open pull requests, you can also use a script to [identify if any pull requests are missing coverage data](../codacy-api/examples/identifying-commits-without-coverage-data.md).
451+
Click **View logs** on a pull request detail page to see the SHA-1 hashes of the commits that are missing coverage data. If you have many open pull requests, you can also use a script to [identify if any pull requests are missing coverage data](../codacy-api/examples/identifying-commits-without-coverage-data).
452452

453453
![Logs showing the pull request commits that are missing coverage data](images/coverage-codacy-ui-logs.png)
454454

@@ -466,5 +466,5 @@ If you need help setting up coverage on your repository please contact us at [su
466466

467467
## See also
468468

469-
- [Identifying commits without coverage data](../codacy-api/examples/identifying-commits-without-coverage-data.md)
470-
- [Why does Codacy show unexpected coverage changes?](../faq/code-analysis/why-does-codacy-show-unexpected-coverage-changes.md)
469+
- [Identifying commits without coverage data](../codacy-api/examples/identifying-commits-without-coverage-data)
470+
- [Why does Codacy show unexpected coverage changes?](../faq/code-analysis/why-does-codacy-show-unexpected-coverage-changes)

docusaurus/docs/coverage-reporter/troubleshooting-coverage-cli-issues.md renamed to docusaurus/docs/coverage-reporter/troubleshooting-coverage-cli-issues.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ The sections below provide instructions or workarounds to overcome common issues
1919

2020
## Can't guess any report due to no matching
2121

22-
Codacy Coverage Reporter automatically searches for coverage reports matching the [file name conventions for supported formats](index.md#generating-coverage).
22+
Codacy Coverage Reporter automatically searches for coverage reports matching the [file name conventions for supported formats](./index.md#generating-coverage).
2323

2424
However, if Codacy Coverage Reporter doesn't find your coverage report, you can explicitly define the report file name with the flag `-r`. For example:
2525

2626
```bash
2727
bash <(curl -Ls https://coverage.codacy.com/get.sh) report -r <coverage report file name>
2828
```
2929

30-
## Can't validate checksum {#checksum}
30+
## Can't validate checksum \{#checksum\}
3131
Starting on version [13.0.0](https://github.com/codacy/codacy-coverage-reporter/releases/tag/13.0.0) the `get.sh` script automatically validates the checksum of the downloaded Codacy Coverage Reporter binary. This requires having either the `sha512sum` or `shasum` command on the operating system where you're running the script.
3232

3333
If you're getting this error while uploading your coverage data to Codacy, install the correct version of `sha512sum` or `shasum` for the operating system that you're using.
@@ -38,7 +38,7 @@ You can also skip validating the checksum of the binary by defining the followin
3838
export CODACY_REPORTER_SKIP_CHECKSUM=true
3939
```
4040

41-
## Commit SHA-1 hash detection {#commit-detection}
41+
## Commit SHA-1 hash detection \{#commit-detection\}
4242
The Codacy Coverage Reporter automatically detects the SHA-1 hash of the current commit to associate with the coverage data when you're using one of the following CI/CD platforms:
4343

4444
- <span class="skip-vale">Appveyor</span>
@@ -99,7 +99,7 @@ If you get a `com.fasterxml.jackson.core.JsonParseException` error while uploadi
9999

100100
There are some ways you can solve this:
101101

102-
- Split your coverage reports into smaller files and [upload them to Codacy one at a time](../uploading-coverage-in-advanced-scenarios/#multiple-reports).
102+
- Split your coverage reports into smaller files and [upload them to Codacy one at a time](./uploading-coverage-in-advanced-scenarios#multiple-reports).
103103

104104
- **If you're using dotCover to generate coverage reports for your C# projects**, you should [exclude <span class="skip-vale">xUnit</span> files](https://www.jetbrains.com/help/dotcover/Running_Coverage_Analysis_from_the_Command_LIne.html#filters_cmd) from the coverage analysis as follows:
105105

@@ -128,7 +128,7 @@ Make sure that your coverage report isn't empty and that it includes coverage da
128128
If you upload multiple coverage reports and at least one contains valid data, the Codacy Coverage Reporter uploads the valid reports and ignores the invalid ones.
129129
:::
130130

131-
## Report generated an empty result while uploading C# coverage data {#detailedxml}
131+
## Report generated an empty result while uploading C# coverage data \{#detailedxml\}
132132
If you're using <span class="skip-vale">dotCover</span> to generate coverage reports for your C# projects, you must use the <span class="skip-vale">dotCover</span> detailedXML report format as follows:
133133

134134
```bash

docusaurus/docs/coverage-reporter/uploading-coverage-in-advanced-scenarios.md renamed to docusaurus/docs/coverage-reporter/uploading-coverage-in-advanced-scenarios.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ description: Instructions on how to use the Codacy Coverage Reporter to upload c
66

77
The following sections include instructions on how to use the Codacy Coverage Reporter to upload coverage data in more advanced scenarios.
88

9-
## Uploading multiple coverage reports for the same language {#multiple-reports}
9+
## Uploading multiple coverage reports for the same language \{#multiple-reports\}
1010
If your test suite is split into different modules or runs in parallel, you must upload multiple coverage reports for the same language either at once or in sequence.
1111

1212
Alternatively, consider merging multiple coverage reports before uploading them to Codacy. Most coverage tools support merging or aggregating coverage data. For example, use the [merge mojo for JaCoCo](http://www.eclemma.org/jacoco/trunk/doc/merge-mojo.html).
@@ -15,7 +15,7 @@ Alternatively, consider merging multiple coverage reports before uploading them
1515
If one or more coverage reports mark a line as covered multiple times, Codacy counts it as a single covered line when calculating coverage.
1616
:::
1717

18-
### Uploading all reports at once {#multiple-reports-once}
18+
### Uploading all reports at once \{#multiple-reports-once\}
1919
Upload multiple partial coverage reports with a single command by specifying each report with the flag `-r`. For example:
2020

2121
```bash
@@ -30,7 +30,7 @@ bash <(curl -Ls https://coverage.codacy.com/get.sh) report \
3030
-l Java $(find . -name 'jacoco*.xml' | sed 's,^, -r ,' | xargs echo)
3131
```
3232

33-
### Uploading reports in sequence {#multiple-reports-sequence}
33+
### Uploading reports in sequence \{#multiple-reports-sequence\}
3434
Upload multiple partial coverage reports in sequence:
3535

3636
1. Upload each report <span class="skip-vale">separately</span> with the flag `--partial`.
@@ -49,7 +49,7 @@ bash <(curl -Ls https://coverage.codacy.com/get.sh) report \
4949
bash <(curl -Ls https://coverage.codacy.com/get.sh) final
5050
```
5151

52-
## Uploading the same coverage report for multiple languages {#multiple-languages}
52+
## Uploading the same coverage report for multiple languages \{#multiple-languages\}
5353
If your test suite generates a single coverage report for more than one language, you must upload the same coverage report for each language.
5454

5555
To do this, upload the same report multiple times, specifying each different language with the flag `-l`. For example:
@@ -62,7 +62,7 @@ bash <(curl -Ls https://coverage.codacy.com/get.sh) report \
6262
bash <(curl -Ls https://coverage.codacy.com/get.sh) final
6363
```
6464

65-
## Uploading coverage for Golang {#golang}
65+
## Uploading coverage for Golang \{#golang\}
6666
Codacy can't automatically detect Golang coverage report files because they don't have specific file names.
6767

6868
If you're uploading a Golang coverage report, you must also specify the report type:
@@ -73,7 +73,7 @@ bash <(curl -Ls https://coverage.codacy.com/get.sh) report \
7373
--force-coverage-parser go -r unit.coverage.out
7474
```
7575

76-
## Uploading coverage for unsupported languages {#unsupported-languages}
76+
## Uploading coverage for unsupported languages \{#unsupported-languages\}
7777
If your language isn't in the [list of supported languages](index.md#generating-coverage), you can still send coverage to Codacy.
7878

7979
To do this, provide the correct language with the flag `-l`, together with `--force-language`. For example:

docusaurus/sidebars.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,7 @@ const sidebars: SidebarsConfig = {
7272
},
7373
{
7474
type: 'category',
75-
label: 'Coverage reporter',
76-
items: coverageReporterOrder,
77-
},
78-
{
79-
type: 'category',
80-
label: 'FAQ',
75+
label: 'Troubleshooting & FAQs',
8176
items: faqOrder,
8277
},
8378
'special-thanks',

0 commit comments

Comments
 (0)