test-reporter icon indicating copy to clipboard operation
test-reporter copied to clipboard

cc-test-reporter false error message if id unset

Open pieterza opened this issue 6 years ago • 0 comments

cc-test-reporter wrongly reports file not found when both -r and -i specified, and -r given an empty var/value. It should report a missing reporter id instead.

./cc-test-reporter upload-coverage -r ${EMPTY} -i coverage/codeclimate.total.json
Error: open coverage/codeclimate.json: no such file or directory
Usage:
  cc-test-reporter upload-coverage [flags]

Flags:
  -s, --batch-size int    batch size for source files (default 500)
  -e, --endpoint string   endpoint to upload coverage information to (default "https://api.codeclimate.com/v1/test_reports")
  -r, --id string         reporter identifier (default "1")
  -i, --input string      input path (default "coverage/codeclimate.json")
      --insecure          send coverage insecurely (without HTTPS)

Global Flags:
  -d, --debug   run in debug mode

Versus:

 ./cc-test-reporter upload-coverage -r foobar  -i coverage/codeclimate.total.json
Error: response from https://api.codeclimate.com/v1/test_reports.
HTTP 401: You are not authorized for this action
Usage:
  cc-test-reporter upload-coverage [flags]

Flags:
  -s, --batch-size int    batch size for source files (default 500)
  -e, --endpoint string   endpoint to upload coverage information to (default "https://api.codeclimate.com/v1/test_reports")
  -r, --id string         reporter identifier (default "1")
  -i, --input string      input path (default "coverage/codeclimate.json")
      --insecure          send coverage insecurely (without HTTPS)

Global Flags:
  -d, --debug   run in debug mode

pieterza avatar Aug 29 '19 18:08 pieterza