Skip to content

Commit 66ecc81

Browse files
authored
Merge pull request #49 from genecommerce/test-frontend-static-version
Update tests to verify frontend is functional
2 parents ccb35f3 + 86bb84e commit 66ecc81

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

dev/test.sh

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,18 @@ CURRENT_TIMESTAMP=$(date +%s)
2020
ADMIN="adminuser$CURRENT_TIMESTAMP"
2121
PASSWORD='password123'
2222

23-
echo "Putting magento into production mode, static content has already been generated"
23+
echo "Putting magento into production mode, di:compile has already been generated"
2424
php bin/magento deploy:mode:set production -s
25+
php -d memory_limit=-1 bin/magento setup:static-content:deploy en_US --no-interaction -f --no-ansi --area=frontend
26+
27+
echo "Verifying frontend is functional"
28+
php bin/magento cache:disable full_page
29+
curl "$URL" -vvv > test.txt 2>&1
30+
grep -q '200 OK' test.txt
31+
grep --max-count=1 'static/version' test.txt
32+
grep -q 'All rights reserved.' test.txt
33+
echo "PASS"
34+
echo "";echo "";
2535

2636
echo "Stubbing in some test data"
2737
vendor/bin/n98-magerun2 --version
@@ -132,6 +142,15 @@ fi
132142
echo "PASS"
133143
echo "";echo "";
134144

145+
echo "Verifying frontend is still functional after key generation"
146+
php bin/magento cache:flush
147+
curl "$URL?test1" -vvv > test.txt 2>&1
148+
grep -q '200 OK' test.txt
149+
grep --max-count=1 'static/version' test.txt
150+
grep -q 'All rights reserved.' test.txt
151+
echo "PASS"
152+
echo "";echo "";
153+
135154
echo "Running reencrypt-unhandled-core-config-data"
136155
php bin/magento gene:encryption-key-manager:reencrypt-unhandled-core-config-data --force > test.txt
137156
cat test.txt
@@ -262,6 +281,15 @@ else
262281
fi
263282
echo "";echo "";
264283

284+
echo "Verifying frontend is still functional after all the tests"
285+
php bin/magento cache:flush
286+
curl "$URL?test2" -vvv > test.txt 2>&1
287+
grep -q '200 OK' test.txt
288+
grep --max-count=1 'static/version' test.txt
289+
grep -q 'All rights reserved.' test.txt
290+
echo "PASS"
291+
echo "";echo "";
292+
265293
echo "A peek at an example log"
266294
grep 'gene encryption manager' var/log/system.log | tail -1
267295

0 commit comments

Comments
 (0)