Skip to content

Commit

Permalink
Add debug parameter to enable set -x-style debugging (#48)
Browse files Browse the repository at this point in the history
* Add debug parameter to enable set -x-style debugging throughout entire script, including setup steps. 
* The new debug option will replace the verbose param, which is now deprecated. 
* Until fully deprecated, both debug and verbose do the same two (2) things. They: 
  * Enable set-x style debugging in the script; and 
  & Add the --debug flag to all coverage-reporter commands to enable verbose output from the Coveralls API.
  • Loading branch information
afinetooth authored Oct 18, 2024
1 parent 489a556 commit 2d6de2e
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
10 changes: 5 additions & 5 deletions .circleci/test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,22 @@ jobs:
- checkout
- coveralls/upload:
dry_run: true
verbose: true
debug: true
measure: true
- coveralls/upload:
dry_run: true
verbose: true
debug: true
measure: true
coverage_reporter_version: latest
- coveralls/upload:
verbose: true
debug: true
parallel: true
coverage_file: test/main.c.gcov
coverage_reporter_version: v0.6.9
fail_on_error: false
- coveralls/upload:
dry_run: true
verbose: true
debug: true
coverage_reporter_version: invalid-version
fail_on_error: false
- run:
Expand All @@ -56,7 +56,7 @@ jobs:
fi
- coveralls/upload:
dry_run: true
verbose: true
debug: true
parallel_finished: true
workflows:
test-deploy:
Expand Down
8 changes: 7 additions & 1 deletion src/@orb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,12 @@ commands:
type: string
default: ''
verbose:
description: Set to true for verbose output from the Coveralls API push.
description: >
Set to true for debug output. Deprecated, use debug instead.
type: boolean
default: false
debug:
description: Set to true for debug output. Replaces verbose.
type: boolean
default: false
dry_run:
Expand Down Expand Up @@ -123,6 +128,7 @@ commands:
COVERALLS_BASE_PATH: << parameters.base_path >>
COVERALLS_REPO_TOKEN_ENV: << parameters.token >>
COVERALLS_VERBOSE: << parameters.verbose >>
COVERALLS_DEBUG: << parameters.debug >>
COVERALLS_COVERAGE_FILE: << parameters.coverage_file >>
COVERALLS_COVERAGE_FILES: << parameters.coverage_files >>
COVERALLS_CARRYFORWARD_FLAGS: << parameters.carryforward >>
Expand Down
8 changes: 7 additions & 1 deletion src/scripts/coveralls.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#!/bin/bash

# Enable set -x debugging if COVERALLS_DEBUG or COVERALLS_VERBOSE (deprecated) is set to "1"
if [ "${COVERALLS_DEBUG}" == "1" ] || [ "${COVERALLS_VERBOSE}" == "1" ]; then
set -x
fi

# Determine which version of coverage-reporter to download
if [ -z "$COVERALLS_REPORTER_VERSION" ] || [ "$COVERALLS_REPORTER_VERSION" == "latest" ]; then
asset_path="latest/download"
Expand Down Expand Up @@ -28,8 +33,9 @@ fi
echo "Installed coverage reporter version:"
./coveralls --version || echo "Failed to retrieve version"

# Pass the --debug flag to coverage-reporter if COVERALLS_DEBUG or COVERALLS_VERBOSE (deprecated) is set to "1"
echo "Parsing args"
if [ "${COVERALLS_VERBOSE}" == "1" ]; then
if [ "${COVERALLS_DEBUG}" == "1" ] || [ "${COVERALLS_VERBOSE}" == "1" ]; then
args="${args} --debug"
fi

Expand Down

0 comments on commit 2d6de2e

Please sign in to comment.