Skip to content

Commit

Permalink
Merge branch 'release/1.1.4'
Browse files Browse the repository at this point in the history
Release/1.1.4
  • Loading branch information
MdNadimHossain committed Aug 18, 2022
2 parents 882ac4e + 7adedd0 commit d29b762
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 9 deletions.
26 changes: 26 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,35 @@ jobs:
INSTALL_SUGGEST: 1
BEHAT_PROFILE: "--profile=suggest"

phpunit_tests:
<<: *job-build
steps:
- attach_workspace:
at: /workspace
- checkout
- run: if [ -f "./dev-tools.sh" ] && [ ! "$DEV_TOOLS" ]; then ./dev-tools.sh; fi
- setup_remote_docker:
docker_layer_caching: true
- run: .circleci/build.sh
- run:
name: Run phpunit tests and generate coverage
command: |
.circleci/phpunit_tests.sh
.circleci/phpunit_coverage.sh
- run:
name: Copy test results
command: |
.circleci/phpunit_results.sh
when: always
- store_artifacts:
path: /tmp/phpunit
- store_test_results:
path: /tmp/phpunit

workflows:
version: 2
main:
jobs:
- build
- build_suggest
- phpunit_tests
7 changes: 7 additions & 0 deletions .circleci/phpunit_coverage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash
##
# Generate coverage report
#
set -e
echo "==> Generate coverage report"
ahoy cli "phpdbg -qrr vendor/bin/phpunit ./dpc-sdp --coverage-html /app/phpunit/coverage-report"
6 changes: 6 additions & 0 deletions .circleci/phpunit_results.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash
##
# Moves phpunit results from inside container to outside.
#
set -e
docker cp $(docker-compose ps -q cli):/app/phpunit/ /tmp/
9 changes: 9 additions & 0 deletions .circleci/phpunit_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash
##
# Run phpunit tests in CI.
#
set -e

ahoy cli "mkdir -p /app/phpunit"
echo "==> Run phpunit tests"
ahoy cli "vendor/bin/phpunit ./dpc-sdp --log-junit /app/phpunit/junit.xml"
3 changes: 0 additions & 3 deletions .circleci/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,3 @@ ahoy lint
echo "==> Run Behat tests"
mkdir -p /tmp/artifacts/behat
ahoy test-behat || ahoy test-behat -- --rerun

echo "==> Run Unit tests"
ahoy cli "/app/vendor/bin/phpunit"
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"license": "GPL-2.0-or-later",
"type": "drupal-module",
"require": {
"dpc-sdp/tide_core": "^3.0.0"
"dpc-sdp/tide_core": "^3.1.0"
},
"suggest": {
"dpc-sdp/tide_media:^3.0.0": "Media and related configuration for Tide Drupal 8 distribution"
Expand Down
6 changes: 1 addition & 5 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="docroot/core/tests/bootstrap.php" colors="true" beStrictAboutTestsThatDoNotTestAnything="true" beStrictAboutOutputDuringTests="true" beStrictAboutChangesToGlobalState="true" printerClass="\Drupal\Tests\Listeners\HtmlOutputPrinter" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage>
<include>
<directory>./includes</directory>
<directory>./lib</directory>
<directory>./modules</directory>
<directory>../modules</directory>
<directory>../sites</directory>
<directory>./dpc-sdp</directory>
</include>
<exclude>
<directory>./modules/*/src/Tests</directory>
Expand Down

0 comments on commit d29b762

Please sign in to comment.