Skip to content

Commit 012b910

Browse files
committed
Return drush and solr tests
1 parent 237f414 commit 012b910

File tree

4 files changed

+121
-128
lines changed

4 files changed

+121
-128
lines changed

tests/10/tests.sh

Lines changed: 36 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,13 @@ DB_URL="${DB_DRIVER}://${DB_USER}:${DB_PASSWORD}@${DB_HOST}/${DB_NAME}"
2323
make init -f /usr/local/bin/actions.mk
2424

2525
composer require -n \
26-
drupal/redis
27-
# \
28-
# drupal/purge \
29-
# drupal/varnish_purge
26+
drupal/redis \
27+
drupal/purge \
28+
drupal/varnish_purge
3029

31-
#composer require -n \
32-
# drupal/search_api \
33-
# drupal/search_api_solr:~4
30+
composer require -n \
31+
drupal/search_api \
32+
drupal/search_api_solr:~4
3433

3534
cd ./web
3635

@@ -56,15 +55,14 @@ check_rq "File system" "Writable"
5655
check_rq "Configuration files" "Protected"
5756

5857
drush en -y \
59-
redis
60-
# \
61-
# purge \
62-
# purge_queuer_coretags \
63-
# purge_drush \
64-
# varnish_purger \
65-
# varnish_purge_tags
58+
redis \
59+
purge \
60+
purge_queuer_coretags \
61+
purge_drush \
62+
varnish_purger \
63+
varnish_purge_tags
6664

67-
#drush en -y search_api_solr_admin
65+
drush en -y search_api_solr_admin
6866

6967
chmod 755 "${PWD}/sites/default/settings.php"
7068
echo "include '${PWD}/sites/default/test.settings.php';" >>"${PWD}/sites/default/settings.php"
@@ -75,30 +73,30 @@ check_rq "Redis" "Connected"
7573
check_rq "Trusted Host Settings" "Enabled"
7674

7775
# Import solr server
78-
#drush cim --source=/var/www/html/solr --partial -y
79-
#drush solr-upload-conf solr 1
80-
#drush sapi-sl | grep -q enabled
76+
drush cim --source=/var/www/html/solr --partial -y
77+
drush solr-upload-conf solr
78+
drush sapi-sl | grep -q enabled
8179

8280
## Test varnish cache and purge
83-
#drush ppadd varnish
84-
#drush cr
81+
drush ppadd varnish
82+
drush cr
8583

8684
## Workaround for varnish purger import https://www.drupal.org/node/2856221
87-
#PURGER_ID=$(drush ppls --format=json | jq -r "keys[0]")
88-
#
89-
#mkdir -p /var/www/html/varnish
90-
## We copy mounted file because we can't edit mounted file (resource busy error).
91-
#cp /var/www/html/varnish-purger.yml /var/www/html/varnish/purger.yml
92-
#sed -i "s/PLUGIN_ID/${PURGER_ID}/g" /var/www/html/varnish/purger.yml
93-
#mv /var/www/html/varnish/purger.yml "/var/www/html/varnish/varnish_purger.settings.${PURGER_ID}.yml"
94-
#drush -y cim --source=/var/www/html/varnish --partial
95-
#drush -y config-set system.performance cache.page.max_age 43200
96-
#
97-
#curl -Is -H 'Host: drupal.localhost' varnish:6081 | grep -q "X-VC-Cache: MISS"
98-
#curl -Is -H 'Host: drupal.localhost' varnish:6081 | grep -q "X-VC-Cache: HIT"
99-
#
100-
#drush cc render
101-
#drush pqw
102-
#
103-
#curl -Is -H 'Host: drupal.localhost' varnish:6081 | grep -q "X-VC-Cache: MISS"
104-
#curl -Is -H 'Host: drupal.localhost' varnish:6081 | grep -q "X-VC-Cache: HIT"
85+
PURGER_ID=$(drush ppls --format=json | jq -r "keys[0]")
86+
87+
mkdir -p /var/www/html/varnish
88+
# We copy mounted file because we can't edit mounted file (resource busy error).
89+
cp /var/www/html/varnish-purger.yml /var/www/html/varnish/purger.yml
90+
sed -i "s/PLUGIN_ID/${PURGER_ID}/g" /var/www/html/varnish/purger.yml
91+
mv /var/www/html/varnish/purger.yml "/var/www/html/varnish/varnish_purger.settings.${PURGER_ID}.yml"
92+
drush -y cim --source=/var/www/html/varnish --partial
93+
drush -y config-set system.performance cache.page.max_age 43200
94+
95+
curl -Is -H 'Host: drupal.localhost' varnish:6081 | grep -q "X-VC-Cache: MISS"
96+
curl -Is -H 'Host: drupal.localhost' varnish:6081 | grep -q "X-VC-Cache: HIT"
97+
98+
drush cc render
99+
drush pqw
100+
101+
curl -Is -H 'Host: drupal.localhost' varnish:6081 | grep -q "X-VC-Cache: MISS"
102+
curl -Is -H 'Host: drupal.localhost' varnish:6081 | grep -q "X-VC-Cache: HIT"

tests/11/test.settings.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@
44
? 'sites/all/modules/contrib'
55
: 'sites/all/modules';
66

7-
//$settings['redis.connection']['host'] = 'valkey';
8-
//$settings['redis.connection']['port'] = '6379';
9-
//$settings['redis.connection']['password'] = 'bad-password';
10-
//$settings['redis.connection']['base'] = 0;
11-
//$settings['redis.connection']['interface'] = 'PhpRedis';
12-
//$settings['cache']['default'] = 'cache.backend.redis';
13-
//$settings['cache']['bins']['bootstrap'] = 'cache.backend.chainedfast';
14-
//$settings['cache']['bins']['discovery'] = 'cache.backend.chainedfast';
15-
//$settings['cache']['bins']['config'] = 'cache.backend.chainedfast';
16-
//
17-
//$settings['container_yamls'][] = $contrib_path . '/redis/example.services.yml';
7+
$settings['redis.connection']['host'] = 'valkey';
8+
$settings['redis.connection']['port'] = '6379';
9+
$settings['redis.connection']['password'] = 'bad-password';
10+
$settings['redis.connection']['base'] = 0;
11+
$settings['redis.connection']['interface'] = 'PhpRedis';
12+
$settings['cache']['default'] = 'cache.backend.redis';
13+
$settings['cache']['bins']['bootstrap'] = 'cache.backend.chainedfast';
14+
$settings['cache']['bins']['discovery'] = 'cache.backend.chainedfast';
15+
$settings['cache']['bins']['config'] = 'cache.backend.chainedfast';
16+
17+
$settings['container_yamls'][] = $contrib_path . '/redis/example.services.yml';
1818

1919
$settings['trusted_host_patterns'] = array(
2020
'\\.localhost$', '\\.local$', '\\.loc$'

tests/11/tests.sh

Lines changed: 38 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,13 @@ DB_URL="${DB_DRIVER}://${DB_USER}:${DB_PASSWORD}@${DB_HOST}/${DB_NAME}"
2323
make init -f /usr/local/bin/actions.mk
2424

2525
composer require -n \
26-
drupal/redis
27-
# \
28-
# drupal/purge \
29-
# drupal/varnish_purge
26+
drupal/redis \
27+
drupal/purge \
28+
drupal/varnish_purge
3029

31-
#composer require -n \
32-
# drupal/search_api \
33-
# drupal/search_api_solr:~4
30+
composer require -n \
31+
drupal/search_api \
32+
drupal/search_api_solr:~4
3433

3534
cd ./web
3635

@@ -50,51 +49,49 @@ check_rq "PHP" "${PHP_VERSION}"
5049
check_rq "File system" "Writable"
5150
check_rq "Configuration files" "Protected"
5251

53-
## @todo: also uncomment in test.settings.php
54-
#drush en -y \
55-
# redis
56-
## \
57-
## purge \
58-
## purge_queuer_coretags \
59-
## purge_drush \
60-
## varnish_purger \
61-
## varnish_purge_tags
52+
drush en -y \
53+
redis \
54+
purge \
55+
purge_queuer_coretags \
56+
purge_drush \
57+
varnish_purger \
58+
varnish_purge_tags
6259

63-
#drush en -y search_api_solr_admin
60+
drush en -y search_api_solr_admin
6461

6562
chmod 755 "${PWD}/sites/default/settings.php"
6663
echo "include '${PWD}/sites/default/test.settings.php';" >>"${PWD}/sites/default/settings.php"
6764

6865
## Enable redis
6966
check_rq "Redis" "Connected"
7067

71-
#check_rq "Trusted Host Settings" "Enabled"
68+
check_rq "Trusted Host Settings" "Enabled"
7269

7370
# Import solr server
74-
#drush cim --source=/var/www/html/solr --partial -y
75-
#drush solr-upload-conf solr 1
76-
#drush sapi-sl | grep -q enabled
71+
drush cim --source=/var/www/html/solr --partial -y
72+
drush solr-upload-conf solr
73+
drush sapi-sl | grep -q enabled
7774

7875
## Test varnish cache and purge
79-
#drush ppadd varnish
80-
#drush cr
76+
drush ppadd varnish
77+
drush cr
8178

8279
## Workaround for varnish purger import https://www.drupal.org/node/2856221
83-
#PURGER_ID=$(drush ppls --format=json | jq -r "keys[0]")
84-
#
85-
#mkdir -p /var/www/html/varnish
86-
## We copy mounted file because we can't edit mounted file (resource busy error).
87-
#cp /var/www/html/varnish-purger.yml /var/www/html/varnish/purger.yml
88-
#sed -i "s/PLUGIN_ID/${PURGER_ID}/g" /var/www/html/varnish/purger.yml
89-
#mv /var/www/html/varnish/purger.yml "/var/www/html/varnish/varnish_purger.settings.${PURGER_ID}.yml"
90-
#drush -y cim --source=/var/www/html/varnish --partial
91-
#drush -y config-set system.performance cache.page.max_age 43200
92-
#
93-
#curl -Is -H 'Host: drupal.localhost' varnish:6081 | grep -q "X-VC-Cache: MISS"
94-
#curl -Is -H 'Host: drupal.localhost' varnish:6081 | grep -q "X-VC-Cache: HIT"
95-
#
96-
#drush cc render
97-
#drush pqw
98-
#
99-
#curl -Is -H 'Host: drupal.localhost' varnish:6081 | grep -q "X-VC-Cache: MISS"
100-
#curl -Is -H 'Host: drupal.localhost' varnish:6081 | grep -q "X-VC-Cache: HIT"
80+
PURGER_ID=$(drush ppls --format=json | jq -r "keys[0]")
81+
82+
mkdir -p /var/www/html/varnish
83+
# We copy mounted file because we can't edit mounted file (resource busy error).
84+
cp /var/www/html/varnish-purger.yml /var/www/html/varnish/purger.yml
85+
sed -i "s/PLUGIN_ID/${PURGER_ID}/g" /var/www/html/varnish/purger.yml
86+
mv /var/www/html/varnish/purger.yml "/var/www/html/varnish/varnish_purger.settings.${PURGER_ID}.yml"
87+
drush -y cim --source=/var/www/html/varnish --partial
88+
drush -y config-set system.performance cache.page.max_age 43200
89+
90+
curl -Is -H 'Host: drupal.localhost' varnish:6081 | grep -q "X-VC-Cache: MISS"
91+
curl -Is -H 'Host: drupal.localhost' varnish:6081 | grep -q "X-VC-Cache: HIT"
92+
93+
drush cc render
94+
drush pqw
95+
96+
curl -Is -H 'Host: drupal.localhost' varnish:6081 | grep -q "X-VC-Cache: MISS"
97+
curl -Is -H 'Host: drupal.localhost' varnish:6081 | grep -q "X-VC-Cache: HIT"

tests/cms/tests.sh

Lines changed: 36 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,13 @@ DB_URL="${DB_DRIVER}://${DB_USER}:${DB_PASSWORD}@${DB_HOST}/${DB_NAME}"
2323
make init -f /usr/local/bin/actions.mk
2424

2525
composer require -n \
26-
drupal/redis
27-
# \
28-
# drupal/purge \
29-
# drupal/varnish_purge
26+
drupal/redis \
27+
drupal/purge \
28+
drupal/varnish_purge
3029

31-
#composer require -n \
32-
# drupal/search_api \
33-
# drupal/search_api_solr:~4
30+
composer require -n \
31+
drupal/search_api \
32+
drupal/search_api_solr:~4
3433

3534
cd ./web
3635

@@ -51,15 +50,14 @@ check_rq "File system" "Writable"
5150
check_rq "Configuration files" "Protected"
5251

5352
drush en -y \
54-
redis
55-
## \
56-
## purge \
57-
## purge_queuer_coretags \
58-
## purge_drush \
59-
## varnish_purger \
60-
## varnish_purge_tags
53+
redis \
54+
purge \
55+
purge_queuer_coretags \
56+
purge_drush \
57+
varnish_purger \
58+
varnish_purge_tags
6159

62-
#drush en -y search_api_solr_admin
60+
drush en -y search_api_solr_admin
6361

6462
chmod 755 "${PWD}/sites/default/settings.php"
6563
echo "include '${PWD}/sites/default/test.settings.php';" >>"${PWD}/sites/default/settings.php"
@@ -70,30 +68,30 @@ check_rq "Redis" "Connected"
7068
check_rq "Trusted Host Settings" "Enabled"
7169

7270
# Import solr server
73-
#drush cim --source=/var/www/html/solr --partial -y
74-
#drush solr-upload-conf solr 1
75-
#drush sapi-sl | grep -q enabled
71+
drush cim --source=/var/www/html/solr --partial -y
72+
drush solr-upload-conf solr
73+
drush sapi-sl | grep -q enabled
7674

7775
## Test varnish cache and purge
78-
#drush ppadd varnish
79-
#drush cr
76+
drush ppadd varnish
77+
drush cr
8078

8179
## Workaround for varnish purger import https://www.drupal.org/node/2856221
82-
#PURGER_ID=$(drush ppls --format=json | jq -r "keys[0]")
83-
#
84-
#mkdir -p /var/www/html/varnish
85-
## We copy mounted file because we can't edit mounted file (resource busy error).
86-
#cp /var/www/html/varnish-purger.yml /var/www/html/varnish/purger.yml
87-
#sed -i "s/PLUGIN_ID/${PURGER_ID}/g" /var/www/html/varnish/purger.yml
88-
#mv /var/www/html/varnish/purger.yml "/var/www/html/varnish/varnish_purger.settings.${PURGER_ID}.yml"
89-
#drush -y cim --source=/var/www/html/varnish --partial
90-
#drush -y config-set system.performance cache.page.max_age 43200
91-
#
92-
#curl -Is -H 'Host: drupal.localhost' varnish:6081 | grep -q "X-VC-Cache: MISS"
93-
#curl -Is -H 'Host: drupal.localhost' varnish:6081 | grep -q "X-VC-Cache: HIT"
94-
#
95-
#drush cc render
96-
#drush pqw
97-
#
98-
#curl -Is -H 'Host: drupal.localhost' varnish:6081 | grep -q "X-VC-Cache: MISS"
99-
#curl -Is -H 'Host: drupal.localhost' varnish:6081 | grep -q "X-VC-Cache: HIT"
80+
PURGER_ID=$(drush ppls --format=json | jq -r "keys[0]")
81+
82+
mkdir -p /var/www/html/varnish
83+
# We copy mounted file because we can't edit mounted file (resource busy error).
84+
cp /var/www/html/varnish-purger.yml /var/www/html/varnish/purger.yml
85+
sed -i "s/PLUGIN_ID/${PURGER_ID}/g" /var/www/html/varnish/purger.yml
86+
mv /var/www/html/varnish/purger.yml "/var/www/html/varnish/varnish_purger.settings.${PURGER_ID}.yml"
87+
drush -y cim --source=/var/www/html/varnish --partial
88+
drush -y config-set system.performance cache.page.max_age 43200
89+
90+
curl -Is -H 'Host: drupal.localhost' varnish:6081 | grep -q "X-VC-Cache: MISS"
91+
curl -Is -H 'Host: drupal.localhost' varnish:6081 | grep -q "X-VC-Cache: HIT"
92+
93+
drush cc render
94+
drush pqw
95+
96+
curl -Is -H 'Host: drupal.localhost' varnish:6081 | grep -q "X-VC-Cache: MISS"
97+
curl -Is -H 'Host: drupal.localhost' varnish:6081 | grep -q "X-VC-Cache: HIT"

0 commit comments

Comments
 (0)