Skip to content

Check Run Reporter's client library, CLI, and CI integrations.

License

Notifications You must be signed in to change notification settings

check-run-reporter/integrations

Repository files navigation

Check Run Reporter CI Integrations (check-run-reporter/integrations)

standard-readme compliant

Check Run Reporter's client library, CLI, and CI integrations.

This is a monorepo (sort of) for Check Run Reporter's client library, CLI, and CI integrations. Instead of maintaining separate test suites (if any tests at all) for each plugin, this repo contains the core TypeScript code as well as CI plugin integration code. As part of the build and release process, each plugin is pushed to the appropriate repository for consumption.

Install

For the various CI integrations, check the READMEs in their respective repos.

For the CLI, download the latest releas. Binaries are available for Linux, macOS, and Windows.

Usage

For the various CI integrations, check the READMEs in their respective repos.

For the CLI, get the most up-to-date documentation by running crr --help.

Examples

Upload test reports produced by jest-junit

JEST_JUNIT_OUTPUT_DIR='reports/junit' \
JEST_JUNIT_ANCESTOR_SEPARATOR='' \
JEST_JUNIT_CLASSNAME='{classname}' \
JEST_JUNIT_INCLUDE_CONSOLE_OUTPUT=true \
JEST_JUNIT_OUTPUT_NAME='jest.xml' \
JEST_JUNIT_SUITE_NAME='Some Label' \
JEST_JUNIT_TITLE='{title}' \
jest --ci --reporters=jest-junit

crr submit \
  --label='Some Label' \
  --report='reports/junit/**/*.xml' \
  --token='<your token>' \
  --sha="$(git rev-parse HEAD)"

Distribute tests across multiple test runners

If you're on the Persistent plan, you can use Check Run Reporter to efficiently distribute your tests across multiple test runners.

crr split prints the names of all the test files that should be run by this node. Specify the --nodeCount and --nodeIndex options to tell Check Run Reporter how many nodes there are and which node this is. Use the --tests option to identify all candidate test files. Any tests that Check Run Reporter has seen before will be evenly distributed while new test will be spread round-robin.

JEST_JUNIT_OUTPUT_DIR='reports/junit' \
JEST_JUNIT_ANCESTOR_SEPARATOR='' \
JEST_JUNIT_CLASSNAME='{classname}' \
JEST_JUNIT_INCLUDE_CONSOLE_OUTPUT=true \
JEST_JUNIT_OUTPUT_NAME='jest.xml' \
JEST_JUNIT_SUITE_NAME='Some Label' \
JEST_JUNIT_TITLE='{title}' \

npx jest $(crr split \
  --label='Unit Tests' \
  --nodeCount=3 \
  --nodeIndex=1 \
  --tests='src/**/*.spec.ts' \
  --token=$CHECK_RUN_REPORTER_TOKEN)

crr submit \
  --label='Some Label' \
  --nodeCount=3 \
  --nodeIndex=1 \
  --report='reports/junit/**/*.xml' \
  --token='<your token>' \
  --sha="$(git rev-parse HEAD)"

Maintainers

Ian Remmel

Contributing

We welcome pull requests, but for anything more than a minor tweak, please create an issue so we can discuss whether the change is the right direction for the project.

License

MIT © Ian Remmel, LLC 2019-2021