Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add codeclimate reporter #3845

Merged
merged 31 commits into from
Oct 28, 2022
Merged
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
20 changes: 17 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ commands:
ddev restart
ddev status
ddev dkan-init --force
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
mkdir -p test_results

prepare_site:
parameters:
Expand All @@ -57,7 +60,6 @@ commands:
# TODO: This hacks around the specific Cypress version requirement for DKAN. Find a better way.
name: Cypressify ddev
command: |
mkdir -p test_results
mv .ddev/misc/docker-compose.cypress.yaml .ddev/docker-compose.cypress.yaml
ddev restart
- when:
Expand Down Expand Up @@ -119,7 +121,6 @@ jobs:
--log-junit ../test_results/phpunit_results.xml
- unless:
# Only collect coverage info for non-upgrade PHPUnit tests.
# TODO: Output structured coverage information for nifty reports.
condition: << parameters.upgrade >>
steps:
- run:
Expand All @@ -128,9 +129,22 @@ jobs:
XDEBUG_MODE: coverage
command: |
ddev xdebug on
$CIRCLE_WORKING_DIRECTORY/cc-test-reporter before-build
ddev dkan-test-phpunit \
--coverage-text \
--coverage-clover /var/www/html/docroot/modules/contrib/dkan/clover.xml \
--log-junit ../test_results/phpunit_results.xml
TEST_RESULT=$?
if [ -f docroot/modules/contrib/dkan/clover.xml ]; then
echo "Coverage file: docroot/modules/contrib/dkan/clover.xml"
else
echo "Coverage file not created: $CIRCLE_WORKING_DIRECTORY/docroot/modules/contrib/dkan/clover.xml"
fi
cd docroot/modules/contrib/dkan
$CIRCLE_WORKING_DIRECTORY/cc-test-reporter after-build \
--coverage-input-type clover \
--prefix /var/www/html/dkan \
--exit-code $TEST_RESULT
exit $TEST_RESULT
- store_test_results:
path: test_results

Expand Down