> For the complete CircleCI developer hub index, see [llms.txt](https://circleci.com/developer/llms.txt)

# qltysh/qlty-orb

Effortlessly publish your code coverage reports to Qlty Cloud with minimal configuration. This Orb simplifies the process of collecting coverage results and sending them to Qlty Cloud.


## Commands

### coverage_complete

Mark coverage collection as complete in Qlty Cloud.
Use this command after all coverage files have been uploaded.

Note: For Alpine-based executors, ensure that `coreutils` and `curl` are installed.


| Parameter | Type | Default | Description |
|---|---|---|---|
| `skip_errors` | boolean | true | Ensure any errors do not cause CI pipeline to fail. |
| `tag` | string |  | The name of the tag to use for the coverage report. |
| `token` | env_var_name | QLTY_COVERAGE_TOKEN | The Qlty code coverage token provided through your
Qlty's project settings. The orb will look for the
QLTY_COVERAGE_TOKEN environment variable by default.
 |
| `verbose` | boolean | false | Enable extra logging. |
| `working_directory` | string | . | The directory where to run the Qlty CLI. |

### coverage_publish

Effortlessly publish your code coverage reports to Qlty Cloud
with minimal configuration.

Note: For Alpine-based executors, ensure that `coreutils` and `curl` are installed.


| Parameter | Type | Default | Description |
|---|---|---|---|
| `add_prefix` | string |  | The prefix to add to file paths in coverage payloads,
to make them match the project's directory structure.
 |
| `dry_run` | boolean | false | Create the coverage files but don't upload anything to cloud. |
| `files` | string |  | Path to the code coverage report files to upload. |
| `format` | enum |  | The format of the coverage report to transform. If not
specified, the format will be inferred from the file
extension or contents [possible values: simplecov, clover,
cobertura, coverprofile, lcov, jacoco, qlty].
 |
| `incomplete` | boolean | false | Mark the coverage data as incomplete. |
| `skip_errors` | boolean | true | Ensure any errors do not cause CI pipeline to fail. |
| `skip_missing_files` | boolean | false | Skip coverage data of files that don't exist on the file system.
 |
| `strip_prefix` | string |  | The prefix to remove from absolute paths in coverage
payloads, to make them relative to the project root.
This is usually the directory in which the tests were
run. Defaults to current working directory.
 |
| `tag` | string |  | The name of the tag to use for the coverage report. |
| `token` | env_var_name | QLTY_COVERAGE_TOKEN | The Qlty code coverage token provided through your
Qlty's project settings. The orb will look for the
QLTY_COVERAGE_TOKEN environment variable by default.
 |
| `total_parts_count` | integer | 1 | The total number of parts qlty cloud should expect to receive |
| `upload_name` | string |  | The name to identify this coverage upload. |
| `validate` | boolean | true | Validate the coverage data. |
| `validate_file_threshold` | integer | 90 | Custom threshold percentage for validation (0-100). Only applies when validate is used. |
| `verbose` | boolean | false | Enable extra logging. |
| `working_directory` | string | . | The directory where to run the Qlty CLI. |

## Examples

### complete

Mark coverage collection as complete in Qlty Cloud. This example demonstrates how to mark coverage collection as complete after uploading all coverage files.


```yaml
version: '2.1'
orbs:
  qlty-orb: qltysh/qlty-orb@0.1.0
jobs:
  upload_coverage:
    docker:
      - image: cimg/node
    steps:
      - checkout
      - run: npm install
      - run: npm test
      - qlty-orb/coverage_publish:
          files: coverage/lcov.info
          incomplete: true
          tag: units
      - qlty-orb/coverage_complete:
          tag: units
workflows:
  upload_and_complete_coverage:
    jobs:
      - upload_coverage
```

### example

Seamlessly publish your code coverage reports to Qlty Cloud with this Orb. Follow the example configuration below to integrate coverage reporting into your CI pipeline. For marking coverage collection as complete, see the "complete" example.


```yaml
version: '2.1'
orbs:
  qlty-orb: qltysh/qlty-orb@0.1.0
jobs:
  run_tests_and_publish_coverage:
    docker:
      - image: cimg/node
    steps:
      - checkout
      - run: npm install
      - run: npm test
      - qlty-orb/coverage_publish:
          files: coverage/lcov.info, coverage/lcov_2.info
workflows:
  test_and_publish_coverage:
    jobs:
      - run_tests_and_publish_coverage
```