Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -397,16 +397,13 @@ jobs:
fi

- run:
name: Check code coverage threshold
name: Extract code coverage
command: |
[ "${CIRCLE_NODE_TOTAL:-1}" -gt 1 ] && [ "${CIRCLE_NODE_INDEX:-0}" -ne 0 ] && exit 0
RATE=$(grep -om1 'line-rate="[0-9.]*"' /tmp/artifacts/coverage/phpunit/cobertura.xml | tr -cd '0-9.')
PERCENT=$(awk "BEGIN {printf \"%.2f\", $RATE*100}")
echo "Coverage: $PERCENT% (threshold: ${VORTEX_CI_CODE_COVERAGE_THRESHOLD:-90}%)"
if [ "${PERCENT//./}" -lt "$((${VORTEX_CI_CODE_COVERAGE_THRESHOLD:-90}*100))" ]; then
echo "FAIL: coverage too low"
exit 1
fi
echo "export COVERAGE_PERCENT=${PERCENT}" >> "${BASH_ENV}"

- run:
name: Post coverage summary as PR comment
Expand All @@ -433,6 +430,15 @@ jobs:
if [ -n "${CODECOV_TOKEN}" ] && [ -d /tmp/artifacts/coverage ] && ! echo "${CIRCLE_BRANCH}" | grep -q '^deps/'; then
codecov -Z -s /tmp/artifacts/coverage;
fi

- run:
name: Check code coverage threshold
command: |
[ "${CIRCLE_NODE_TOTAL:-1}" -gt 1 ] && [ "${CIRCLE_NODE_INDEX:-0}" -ne 0 ] && exit 0
if [ "${COVERAGE_PERCENT//.}" -lt "$((${VORTEX_CI_CODE_COVERAGE_THRESHOLD:-90}*100))" ]; then
echo "FAIL: coverage ${COVERAGE_PERCENT}% is below threshold ${VORTEX_CI_CODE_COVERAGE_THRESHOLD:-90}%"
exit 1
fi
Comment on lines +434 to +441

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Handle unset COVERAGE_PERCENT gracefully.

If the cobertura.xml file is missing or malformed, COVERAGE_PERCENT will be empty, causing the integer comparison on line 438 to fail with a shell error. Consider adding a guard:

🛡️ Proposed fix
       - run:
           name: Check code coverage threshold
           command: |
             [ "${CIRCLE_NODE_TOTAL:-1}" -gt 1 ] && [ "${CIRCLE_NODE_INDEX:-0}" -ne 0 ] && exit 0
+            if [ -z "${COVERAGE_PERCENT:-}" ]; then
+              echo "FAIL: COVERAGE_PERCENT is not set (coverage report may be missing)"
+              exit 1
+            fi
             if [ "${COVERAGE_PERCENT//.}" -lt "$((${VORTEX_CI_CODE_COVERAGE_THRESHOLD:-90}*100))" ]; then
               echo "FAIL: coverage ${COVERAGE_PERCENT}% is below threshold ${VORTEX_CI_CODE_COVERAGE_THRESHOLD:-90}%"
               exit 1
             fi
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- run:
name: Check code coverage threshold
command: |
[ "${CIRCLE_NODE_TOTAL:-1}" -gt 1 ] && [ "${CIRCLE_NODE_INDEX:-0}" -ne 0 ] && exit 0
if [ "${COVERAGE_PERCENT//.}" -lt "$((${VORTEX_CI_CODE_COVERAGE_THRESHOLD:-90}*100))" ]; then
echo "FAIL: coverage ${COVERAGE_PERCENT}% is below threshold ${VORTEX_CI_CODE_COVERAGE_THRESHOLD:-90}%"
exit 1
fi
- run:
name: Check code coverage threshold
command: |
[ "${CIRCLE_NODE_TOTAL:-1}" -gt 1 ] && [ "${CIRCLE_NODE_INDEX:-0}" -ne 0 ] && exit 0
if [ -z "${COVERAGE_PERCENT:-}" ]; then
echo "FAIL: COVERAGE_PERCENT is not set (coverage report may be missing)"
exit 1
fi
if [ "${COVERAGE_PERCENT//.}" -lt "$((${VORTEX_CI_CODE_COVERAGE_THRESHOLD:-90}*100))" ]; then
echo "FAIL: coverage ${COVERAGE_PERCENT}% is below threshold ${VORTEX_CI_CODE_COVERAGE_THRESHOLD:-90}%"
exit 1
fi
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.circleci/config.yml around lines 434 - 441, The coverage check currently
assumes COVERAGE_PERCENT is set and does a numeric comparison, which breaks if
COVERAGE_PERCENT is empty; modify the check in the CI step that references
COVERAGE_PERCENT and VORTEX_CI_CODE_COVERAGE_THRESHOLD so it first verifies
COVERAGE_PERCENT is non-empty and numeric (or defaults it to 0) before
performing the integer comparison, and if empty/malformed emit a clear failure
message and exit non‑zero; update the existing conditional around the comparison
(the block using COVERAGE_PERCENT//. and VORTEX_CI_CODE_COVERAGE_THRESHOLD) to
include this guard so the script fails gracefully when cobertura.xml is missing
or malformed.

#;> TOOL_PHPUNIT

#;< TOOL_BEHAT
Expand Down
16 changes: 11 additions & 5 deletions .circleci/vortex-test-common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -263,16 +263,13 @@ jobs:
fi

- run:
name: Check code coverage threshold
name: Extract code coverage
command: |
[ "${CIRCLE_NODE_TOTAL:-1}" -gt 1 ] && [ "${CIRCLE_NODE_INDEX:-0}" -ne 0 ] && exit 0
RATE=$(grep -om1 'line-rate="[0-9.]*"' /tmp/artifacts/coverage/phpunit/cobertura.xml | tr -cd '0-9.')
PERCENT=$(awk "BEGIN {printf \"%.2f\", $RATE*100}")
echo "Coverage: $PERCENT% (threshold: ${VORTEX_CI_CODE_COVERAGE_THRESHOLD:-90}%)"
if [ "${PERCENT//./}" -lt "$((${VORTEX_CI_CODE_COVERAGE_THRESHOLD:-90}*100))" ]; then
echo "FAIL: coverage too low"
exit 1
fi
echo "export COVERAGE_PERCENT=${PERCENT}" >> "${BASH_ENV}"

- run:
name: Post coverage summary as PR comment
Expand All @@ -299,6 +296,15 @@ jobs:
if [ -n "${CODECOV_TOKEN}" ] && [ -d /tmp/artifacts/coverage ] && ! echo "${CIRCLE_BRANCH}" | grep -q '^deps/'; then
codecov -Z -s /tmp/artifacts/coverage;
fi

- run:
name: Check code coverage threshold
command: |
[ "${CIRCLE_NODE_TOTAL:-1}" -gt 1 ] && [ "${CIRCLE_NODE_INDEX:-0}" -ne 0 ] && exit 0
if [ "${COVERAGE_PERCENT//.}" -lt "$((${VORTEX_CI_CODE_COVERAGE_THRESHOLD:-90}*100))" ]; then
echo "FAIL: coverage ${COVERAGE_PERCENT}% is below threshold ${VORTEX_CI_CODE_COVERAGE_THRESHOLD:-90}%"
exit 1
fi
Comment on lines +300 to +307

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Handle unset COVERAGE_PERCENT gracefully.

If the cobertura.xml file is missing or malformed, COVERAGE_PERCENT will be empty, causing the integer comparison on line 304 to fail with a shell error. Add a guard to fail gracefully with a clear message.

🛡️ Proposed fix
       - run:
           name: Check code coverage threshold
           command: |
             [ "${CIRCLE_NODE_TOTAL:-1}" -gt 1 ] && [ "${CIRCLE_NODE_INDEX:-0}" -ne 0 ] && exit 0
+            if [ -z "${COVERAGE_PERCENT:-}" ]; then
+              echo "FAIL: COVERAGE_PERCENT is not set (coverage report may be missing)"
+              exit 1
+            fi
             if [ "${COVERAGE_PERCENT//.}" -lt "$((${VORTEX_CI_CODE_COVERAGE_THRESHOLD:-90}*100))" ]; then
               echo "FAIL: coverage ${COVERAGE_PERCENT}% is below threshold ${VORTEX_CI_CODE_COVERAGE_THRESHOLD:-90}%"
               exit 1
             fi
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- run:
name: Check code coverage threshold
command: |
[ "${CIRCLE_NODE_TOTAL:-1}" -gt 1 ] && [ "${CIRCLE_NODE_INDEX:-0}" -ne 0 ] && exit 0
if [ "${COVERAGE_PERCENT//.}" -lt "$((${VORTEX_CI_CODE_COVERAGE_THRESHOLD:-90}*100))" ]; then
echo "FAIL: coverage ${COVERAGE_PERCENT}% is below threshold ${VORTEX_CI_CODE_COVERAGE_THRESHOLD:-90}%"
exit 1
fi
- run:
name: Check code coverage threshold
command: |
[ "${CIRCLE_NODE_TOTAL:-1}" -gt 1 ] && [ "${CIRCLE_NODE_INDEX:-0}" -ne 0 ] && exit 0
if [ -z "${COVERAGE_PERCENT:-}" ]; then
echo "FAIL: COVERAGE_PERCENT is not set (coverage report may be missing)"
exit 1
fi
if [ "${COVERAGE_PERCENT//.}" -lt "$((${VORTEX_CI_CODE_COVERAGE_THRESHOLD:-90}*100))" ]; then
echo "FAIL: coverage ${COVERAGE_PERCENT}% is below threshold ${VORTEX_CI_CODE_COVERAGE_THRESHOLD:-90}%"
exit 1
fi
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.circleci/vortex-test-common.yml around lines 300 - 307, The script's
coverage check uses COVERAGE_PERCENT in an integer comparison but doesn't guard
against it being empty; update the "Check code coverage threshold" run step to
first validate COVERAGE_PERCENT (e.g., test -z or non-numeric) and, if missing
or malformed, print a clear failure like "FAIL: could not determine coverage
(cobertura missing or malformed)" and exit 1; otherwise proceed with the
existing comparison against VORTEX_CI_CODE_COVERAGE_THRESHOLD using the
normalized value (${COVERAGE_PERCENT//.}) so the integer arithmetic won't error
when coverage is absent.

#;> TOOL_PHPUNIT

#;< TOOL_BEHAT
Expand Down
17 changes: 12 additions & 5 deletions .github/workflows/build-test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -421,16 +421,13 @@ jobs:
docker compose cp cli:/app/.logs/. ".logs/"
fi

- name: Check code coverage threshold
- name: Extract code coverage
if: ${{ matrix.instance == 0 || strategy.job-total == 1 }}
run: |
RATE=$(grep -om1 'line-rate="[0-9.]*"' .logs/coverage/phpunit/cobertura.xml | tr -cd '0-9.')
PERCENT=$(awk "BEGIN {printf \"%.2f\", $RATE*100}")
echo "Coverage: $PERCENT% (threshold: $VORTEX_CI_CODE_COVERAGE_THRESHOLD%)" | tee -a "$GITHUB_STEP_SUMMARY"
if [ "${PERCENT//./}" -lt "$((VORTEX_CI_CODE_COVERAGE_THRESHOLD*100))" ]; then
echo "FAIL: coverage too low"
exit 1
fi
echo "COVERAGE_PERCENT=${PERCENT}" >> "$GITHUB_ENV"
{ echo "COVERAGE_CONTENT<<EOF"; sed '/./,$!d' .logs/coverage/phpunit/coverage.txt; echo "EOF"; } >> "$GITHUB_ENV"
env:
VORTEX_CI_CODE_COVERAGE_THRESHOLD: ${{ vars.VORTEX_CI_CODE_COVERAGE_THRESHOLD || '90' }}
Expand All @@ -454,6 +451,16 @@ jobs:
token: ${{ secrets.CODECOV_TOKEN }}
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

- name: Check code coverage threshold
if: ${{ matrix.instance == 0 || strategy.job-total == 1 }}
run: |
if [ "${COVERAGE_PERCENT//.}" -lt "$((VORTEX_CI_CODE_COVERAGE_THRESHOLD*100))" ]; then
echo "FAIL: coverage ${COVERAGE_PERCENT}% is below threshold ${VORTEX_CI_CODE_COVERAGE_THRESHOLD}%"
exit 1
fi
env:
VORTEX_CI_CODE_COVERAGE_THRESHOLD: ${{ vars.VORTEX_CI_CODE_COVERAGE_THRESHOLD || '90' }}
Comment on lines +455 to +463

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Handle unset COVERAGE_PERCENT gracefully.

Same as the CircleCI config: if COVERAGE_PERCENT is empty (e.g., cobertura.xml missing), the integer comparison on line 458 will fail with a shell error.

🛡️ Proposed fix
       - name: Check code coverage threshold
         if: ${{ matrix.instance == 0 || strategy.job-total == 1 }}
         run: |
+          if [ -z "${COVERAGE_PERCENT:-}" ]; then
+            echo "FAIL: COVERAGE_PERCENT is not set (coverage report may be missing)"
+            exit 1
+          fi
           if [ "${COVERAGE_PERCENT//.}" -lt "$((VORTEX_CI_CODE_COVERAGE_THRESHOLD*100))" ]; then
             echo "FAIL: coverage ${COVERAGE_PERCENT}% is below threshold ${VORTEX_CI_CODE_COVERAGE_THRESHOLD}%"
             exit 1
           fi
         env:
           VORTEX_CI_CODE_COVERAGE_THRESHOLD: ${{ vars.VORTEX_CI_CODE_COVERAGE_THRESHOLD || '90' }}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Check code coverage threshold
if: ${{ matrix.instance == 0 || strategy.job-total == 1 }}
run: |
if [ "${COVERAGE_PERCENT//.}" -lt "$((VORTEX_CI_CODE_COVERAGE_THRESHOLD*100))" ]; then
echo "FAIL: coverage ${COVERAGE_PERCENT}% is below threshold ${VORTEX_CI_CODE_COVERAGE_THRESHOLD}%"
exit 1
fi
env:
VORTEX_CI_CODE_COVERAGE_THRESHOLD: ${{ vars.VORTEX_CI_CODE_COVERAGE_THRESHOLD || '90' }}
- name: Check code coverage threshold
if: ${{ matrix.instance == 0 || strategy.job-total == 1 }}
run: |
if [ -z "${COVERAGE_PERCENT:-}" ]; then
echo "FAIL: COVERAGE_PERCENT is not set (coverage report may be missing)"
exit 1
fi
if [ "${COVERAGE_PERCENT//.}" -lt "$((VORTEX_CI_CODE_COVERAGE_THRESHOLD*100))" ]; then
echo "FAIL: coverage ${COVERAGE_PERCENT}% is below threshold ${VORTEX_CI_CODE_COVERAGE_THRESHOLD}%"
exit 1
fi
env:
VORTEX_CI_CODE_COVERAGE_THRESHOLD: ${{ vars.VORTEX_CI_CODE_COVERAGE_THRESHOLD || '90' }}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/build-test-deploy.yml around lines 455 - 463, The Check
code coverage threshold step fails when COVERAGE_PERCENT is empty; update the
shell logic in that step to handle an unset/empty COVERAGE_PERCENT before doing
the integer comparison with VORTEX_CI_CODE_COVERAGE_THRESHOLD: detect if
COVERAGE_PERCENT is empty or non-numeric (e.g., [ -z "$COVERAGE_PERCENT" ]), set
a safe default value (such as 0) or emit a clear message and fail gracefully,
then perform the existing numeric comparison using the sanitized value (the
expression that currently strips dots from COVERAGE_PERCENT should operate on
the validated/sanitized variable); reference the step name "Check code coverage
threshold" and the variables COVERAGE_PERCENT and
VORTEX_CI_CODE_COVERAGE_THRESHOLD when making the change.

#;> TOOL_PHPUNIT

#;< TOOL_BEHAT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -373,16 +373,13 @@ jobs:
docker compose cp cli:/app/.logs/. ".logs/"
fi

- name: Check code coverage threshold
- name: Extract code coverage
if: ${{ matrix.instance == 0 || strategy.job-total == 1 }}
run: |
RATE=$(grep -om1 'line-rate="[0-9.]*"' .logs/coverage/phpunit/cobertura.xml | tr -cd '0-9.')
PERCENT=$(awk "BEGIN {printf \"%.2f\", $RATE*100}")
echo "Coverage: $PERCENT% (threshold: $VORTEX_CI_CODE_COVERAGE_THRESHOLD%)" | tee -a "$GITHUB_STEP_SUMMARY"
if [ "${PERCENT//./}" -lt "$((VORTEX_CI_CODE_COVERAGE_THRESHOLD*100))" ]; then
echo "FAIL: coverage too low"
exit 1
fi
echo "COVERAGE_PERCENT=${PERCENT}" >> "$GITHUB_ENV"
{ echo "COVERAGE_CONTENT<<EOF"; sed '/./,$!d' .logs/coverage/phpunit/coverage.txt; echo "EOF"; } >> "$GITHUB_ENV"
env:
VORTEX_CI_CODE_COVERAGE_THRESHOLD: ${{ vars.VORTEX_CI_CODE_COVERAGE_THRESHOLD || '90' }}
Expand All @@ -407,6 +404,16 @@ jobs:
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

- name: Check code coverage threshold
if: ${{ matrix.instance == 0 || strategy.job-total == 1 }}
run: |
if [ "${COVERAGE_PERCENT//.}" -lt "$((VORTEX_CI_CODE_COVERAGE_THRESHOLD*100))" ]; then
echo "FAIL: coverage ${COVERAGE_PERCENT}% is below threshold ${VORTEX_CI_CODE_COVERAGE_THRESHOLD}%"
exit 1
fi
env:
VORTEX_CI_CODE_COVERAGE_THRESHOLD: ${{ vars.VORTEX_CI_CODE_COVERAGE_THRESHOLD || '90' }}

- name: Test with Behat
run: |
# shellcheck disable=SC2170
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -352,16 +352,13 @@ jobs:
fi

- run:
name: Check code coverage threshold
name: Extract code coverage
command: |
[ "${CIRCLE_NODE_TOTAL:-1}" -gt 1 ] && [ "${CIRCLE_NODE_INDEX:-0}" -ne 0 ] && exit 0
RATE=$(grep -om1 'line-rate="[0-9.]*"' /tmp/artifacts/coverage/phpunit/cobertura.xml | tr -cd '0-9.')
PERCENT=$(awk "BEGIN {printf \"%.2f\", $RATE*100}")
echo "Coverage: $PERCENT% (threshold: ${VORTEX_CI_CODE_COVERAGE_THRESHOLD:-90}%)"
if [ "${PERCENT//./}" -lt "$((${VORTEX_CI_CODE_COVERAGE_THRESHOLD:-90}*100))" ]; then
echo "FAIL: coverage too low"
exit 1
fi
echo "export COVERAGE_PERCENT=${PERCENT}" >> "${BASH_ENV}"

- run:
name: Post coverage summary as PR comment
Expand Down Expand Up @@ -389,6 +386,15 @@ jobs:
codecov -Z -s /tmp/artifacts/coverage;
fi

- run:
name: Check code coverage threshold
command: |
[ "${CIRCLE_NODE_TOTAL:-1}" -gt 1 ] && [ "${CIRCLE_NODE_INDEX:-0}" -ne 0 ] && exit 0
if [ "${COVERAGE_PERCENT//.}" -lt "$((${VORTEX_CI_CODE_COVERAGE_THRESHOLD:-90}*100))" ]; then
echo "FAIL: coverage ${COVERAGE_PERCENT}% is below threshold ${VORTEX_CI_CODE_COVERAGE_THRESHOLD:-90}%"
exit 1
fi

- run:
name: Test with Behat
command: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -352,16 +352,13 @@ jobs:
fi

- run:
name: Check code coverage threshold
name: Extract code coverage
command: |
[ "${CIRCLE_NODE_TOTAL:-1}" -gt 1 ] && [ "${CIRCLE_NODE_INDEX:-0}" -ne 0 ] && exit 0
RATE=$(grep -om1 'line-rate="[0-9.]*"' /tmp/artifacts/coverage/phpunit/cobertura.xml | tr -cd '0-9.')
PERCENT=$(awk "BEGIN {printf \"%.2f\", $RATE*100}")
echo "Coverage: $PERCENT% (threshold: ${VORTEX_CI_CODE_COVERAGE_THRESHOLD:-90}%)"
if [ "${PERCENT//./}" -lt "$((${VORTEX_CI_CODE_COVERAGE_THRESHOLD:-90}*100))" ]; then
echo "FAIL: coverage too low"
exit 1
fi
echo "export COVERAGE_PERCENT=${PERCENT}" >> "${BASH_ENV}"

- run:
name: Post coverage summary as PR comment
Expand Down Expand Up @@ -389,6 +386,15 @@ jobs:
codecov -Z -s /tmp/artifacts/coverage;
fi

- run:
name: Check code coverage threshold
command: |
[ "${CIRCLE_NODE_TOTAL:-1}" -gt 1 ] && [ "${CIRCLE_NODE_INDEX:-0}" -ne 0 ] && exit 0
if [ "${COVERAGE_PERCENT//.}" -lt "$((${VORTEX_CI_CODE_COVERAGE_THRESHOLD:-90}*100))" ]; then
echo "FAIL: coverage ${COVERAGE_PERCENT}% is below threshold ${VORTEX_CI_CODE_COVERAGE_THRESHOLD:-90}%"
exit 1
fi

- run:
name: Test with Behat
command: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -352,16 +352,13 @@ jobs:
fi

- run:
name: Check code coverage threshold
name: Extract code coverage
command: |
[ "${CIRCLE_NODE_TOTAL:-1}" -gt 1 ] && [ "${CIRCLE_NODE_INDEX:-0}" -ne 0 ] && exit 0
RATE=$(grep -om1 'line-rate="[0-9.]*"' /tmp/artifacts/coverage/phpunit/cobertura.xml | tr -cd '0-9.')
PERCENT=$(awk "BEGIN {printf \"%.2f\", $RATE*100}")
echo "Coverage: $PERCENT% (threshold: ${VORTEX_CI_CODE_COVERAGE_THRESHOLD:-90}%)"
if [ "${PERCENT//./}" -lt "$((${VORTEX_CI_CODE_COVERAGE_THRESHOLD:-90}*100))" ]; then
echo "FAIL: coverage too low"
exit 1
fi
echo "export COVERAGE_PERCENT=${PERCENT}" >> "${BASH_ENV}"

- run:
name: Post coverage summary as PR comment
Expand Down Expand Up @@ -389,6 +386,15 @@ jobs:
codecov -Z -s /tmp/artifacts/coverage;
fi

- run:
name: Check code coverage threshold
command: |
[ "${CIRCLE_NODE_TOTAL:-1}" -gt 1 ] && [ "${CIRCLE_NODE_INDEX:-0}" -ne 0 ] && exit 0
if [ "${COVERAGE_PERCENT//.}" -lt "$((${VORTEX_CI_CODE_COVERAGE_THRESHOLD:-90}*100))" ]; then
echo "FAIL: coverage ${COVERAGE_PERCENT}% is below threshold ${VORTEX_CI_CODE_COVERAGE_THRESHOLD:-90}%"
exit 1
fi

- run:
name: Test with Behat
command: |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@@ -452,79 +452,3 @@
@@ -459,79 +459,3 @@
timeout-minutes: 120 # Cancel the action after 15 minutes, regardless of whether a connection has been established.
with:
detached: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -352,16 +352,13 @@ jobs:
fi

- run:
name: Check code coverage threshold
name: Extract code coverage
command: |
[ "${CIRCLE_NODE_TOTAL:-1}" -gt 1 ] && [ "${CIRCLE_NODE_INDEX:-0}" -ne 0 ] && exit 0
RATE=$(grep -om1 'line-rate="[0-9.]*"' /tmp/artifacts/coverage/phpunit/cobertura.xml | tr -cd '0-9.')
PERCENT=$(awk "BEGIN {printf \"%.2f\", $RATE*100}")
echo "Coverage: $PERCENT% (threshold: ${VORTEX_CI_CODE_COVERAGE_THRESHOLD:-90}%)"
if [ "${PERCENT//./}" -lt "$((${VORTEX_CI_CODE_COVERAGE_THRESHOLD:-90}*100))" ]; then
echo "FAIL: coverage too low"
exit 1
fi
echo "export COVERAGE_PERCENT=${PERCENT}" >> "${BASH_ENV}"

- run:
name: Post coverage summary as PR comment
Expand Down Expand Up @@ -389,6 +386,15 @@ jobs:
codecov -Z -s /tmp/artifacts/coverage;
fi

- run:
name: Check code coverage threshold
command: |
[ "${CIRCLE_NODE_TOTAL:-1}" -gt 1 ] && [ "${CIRCLE_NODE_INDEX:-0}" -ne 0 ] && exit 0
if [ "${COVERAGE_PERCENT//.}" -lt "$((${VORTEX_CI_CODE_COVERAGE_THRESHOLD:-90}*100))" ]; then
echo "FAIL: coverage ${COVERAGE_PERCENT}% is below threshold ${VORTEX_CI_CODE_COVERAGE_THRESHOLD:-90}%"
exit 1
fi

- run:
name: Test with Behat
command: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -352,16 +352,13 @@ jobs:
fi

- run:
name: Check code coverage threshold
name: Extract code coverage
command: |
[ "${CIRCLE_NODE_TOTAL:-1}" -gt 1 ] && [ "${CIRCLE_NODE_INDEX:-0}" -ne 0 ] && exit 0
RATE=$(grep -om1 'line-rate="[0-9.]*"' /tmp/artifacts/coverage/phpunit/cobertura.xml | tr -cd '0-9.')
PERCENT=$(awk "BEGIN {printf \"%.2f\", $RATE*100}")
echo "Coverage: $PERCENT% (threshold: ${VORTEX_CI_CODE_COVERAGE_THRESHOLD:-90}%)"
if [ "${PERCENT//./}" -lt "$((${VORTEX_CI_CODE_COVERAGE_THRESHOLD:-90}*100))" ]; then
echo "FAIL: coverage too low"
exit 1
fi
echo "export COVERAGE_PERCENT=${PERCENT}" >> "${BASH_ENV}"

- run:
name: Post coverage summary as PR comment
Expand Down Expand Up @@ -389,6 +386,15 @@ jobs:
codecov -Z -s /tmp/artifacts/coverage;
fi

- run:
name: Check code coverage threshold
command: |
[ "${CIRCLE_NODE_TOTAL:-1}" -gt 1 ] && [ "${CIRCLE_NODE_INDEX:-0}" -ne 0 ] && exit 0
if [ "${COVERAGE_PERCENT//.}" -lt "$((${VORTEX_CI_CODE_COVERAGE_THRESHOLD:-90}*100))" ]; then
echo "FAIL: coverage ${COVERAGE_PERCENT}% is below threshold ${VORTEX_CI_CODE_COVERAGE_THRESHOLD:-90}%"
exit 1
fi

- run:
name: Test with Behat
command: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -361,16 +361,13 @@ jobs:
fi

- run:
name: Check code coverage threshold
name: Extract code coverage
command: |
[ "${CIRCLE_NODE_TOTAL:-1}" -gt 1 ] && [ "${CIRCLE_NODE_INDEX:-0}" -ne 0 ] && exit 0
RATE=$(grep -om1 'line-rate="[0-9.]*"' /tmp/artifacts/coverage/phpunit/cobertura.xml | tr -cd '0-9.')
PERCENT=$(awk "BEGIN {printf \"%.2f\", $RATE*100}")
echo "Coverage: $PERCENT% (threshold: ${VORTEX_CI_CODE_COVERAGE_THRESHOLD:-90}%)"
if [ "${PERCENT//./}" -lt "$((${VORTEX_CI_CODE_COVERAGE_THRESHOLD:-90}*100))" ]; then
echo "FAIL: coverage too low"
exit 1
fi
echo "export COVERAGE_PERCENT=${PERCENT}" >> "${BASH_ENV}"

- run:
name: Post coverage summary as PR comment
Expand Down Expand Up @@ -398,6 +395,15 @@ jobs:
codecov -Z -s /tmp/artifacts/coverage;
fi

- run:
name: Check code coverage threshold
command: |
[ "${CIRCLE_NODE_TOTAL:-1}" -gt 1 ] && [ "${CIRCLE_NODE_INDEX:-0}" -ne 0 ] && exit 0
if [ "${COVERAGE_PERCENT//.}" -lt "$((${VORTEX_CI_CODE_COVERAGE_THRESHOLD:-90}*100))" ]; then
echo "FAIL: coverage ${COVERAGE_PERCENT}% is below threshold ${VORTEX_CI_CODE_COVERAGE_THRESHOLD:-90}%"
exit 1
fi

- run:
name: Test with Behat
command: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@
- name: Login to container registry
run: ./scripts/vortex/login-container-registry.sh

@@ -456,7 +316,6 @@
@@ -463,7 +323,6 @@
deploy:
runs-on: ubuntu-latest
needs: [build, lint]
Expand Down
Loading
Loading