forked from ding2/ding2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
66 lines (64 loc) · 3.89 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# Prepare a site-installation for testing
circle-setup:
# Build profile using drush make
drush make ding2.make --no-core --contrib-destination=. -y
# Install theme dependencies
cd themes/ddbasic && npm install
# Process theme files.
# If there are any changes then fail the build. The result of processing
# should be committed along with the source changes.
cd themes/ddbasic && node_modules/.bin/gulp uglify sass
# Readable changes. Exclude minified CSS files compiled from SCSS. Changes
# in verbose version will probably also apply here.
git diff --exit-code -- . ':(exclude)themes/ddbasic/css/*.min.css'
# Do a complete diff in short form as well for good measure. This will
# catch changes in excluded files.
git diff --stat --exit-code
# Built an entire Drupal site with core, contrib and custom
# code First we build Drupal core only. Instead of using the
# profile specified in the make file we use the one we have
# just build. This way we do not have to update drupal.make
# for each build.
drush make drupal.make --projects=drupal -y $(DRUPAL_SITE_PATH)
# Copy the current profile which has just been built into Drupal core
mkdir $(DRUPAL_SITE_PATH)/profiles/ding2
cp -R ./* $(DRUPAL_SITE_PATH)/profiles/ding2/
# Install the site using the ding2 profile
cd $(DRUPAL_SITE_PATH) && drush site-install ding2 --db-url=mysql://[email protected]/circle_test -y ding2_module_selection_form.providers_selection=connie
# Notices and warnings are seen as an error from simpletests point of view
# and is added to the xml-output as such. Idealy we would not have any
# notices or warnings, but in the current state of affairs we see quite a
# few, so in order to focus on actually getting some tests up and running
# we're disabling notices and warnings for now. In the future it would be a
# good idéa to revisit running with E_ALL.
echo "ini_set('error_reporting', E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED & ~E_WARNING);" | sudo tee --append $(DRUPAL_SITE_PATH)/sites/default/settings.php
# Run PHP7 Compatibility Checker - using tee to get non-rezero exit code (see https://github.com/sstalle/php7cc/issues/102)
php7cc --except=vendor --level=error --extensions=php,inc,module,install $(DRUPAL_SITE_PATH) | tee /dev/tty | grep -vq 'File: '
circle-run-behat-tests:
mkdir -p $(CIRCLE_TEST_REPORTS)/cucumber
# Set up test site.
cd $(DRUPAL_SITE_PATH)/profiles/ding2/tests/behat && make test-setup
# Make the files directory writable for the web server user.
cd $(DRUPAL_SITE_PATH)/sites/default && sudo chown www-data. files
# Run Behat tests.
export BEHAT_PARAMS='{"extensions" : {"Behat\\MinkExtension" : {"base_url" : "http://ding2.dev/" }}}' && \
cd $(DRUPAL_SITE_PATH)/profiles/ding2/tests/behat && \
export SCREENSHOT_DIR=$(CIRCLE_ARTIFACTS)/ && \
./bin/behat --tags 'cci' --tags '~wip' --format=junit --out=$(CIRCLE_TEST_REPORTS)/cucumber/junit.xml --format=pretty --out=std -p chrome
# Run ding2 unittests
circle-run-unit-tests:
cd $(DRUPAL_SITE_PATH)/profiles/ding2/modules/ding_test && composer install
cd $(DRUPAL_SITE_PATH) && drush pml
cd $(DRUPAL_SITE_PATH) && drush dis fbs alma -y
cd $(DRUPAL_SITE_PATH) && drush en connie ding_test -y
# Run all ding unit-tests
mkdir -p $(CIRCLE_TEST_REPORTS)/phpunit
# Circleci has a proxy for the php-executable which confuses run-tests.sh,
# so we have to specify the full path to the executable.
# Tests to be run are referenced as a comma-seperated list of group-names.
cd $(DRUPAL_SITE_PATH) && php scripts/run-tests.sh --php /opt/circleci/.phpenv/shims/php --xml $(CIRCLE_TEST_REPORTS)/phpunit \
"Ding! - Ting search unittest"
cd $(DRUPAL_SITE_PATH) && php scripts/run-tests.sh --php /opt/circleci/.phpenv/shims/php --xml $(CIRCLE_TEST_REPORTS)/phpunit \
"Opensearch"
cd $(DRUPAL_SITE_PATH) && php scripts/run-tests.sh --php /opt/circleci/.phpenv/shims/php --xml $(CIRCLE_TEST_REPORTS)/phpunit \
--class ConnieSearchSearchProviderImplementationTestCase