Skip to content

Instantly share code, notes, and snippets.

@Quetzacoalt91
Created May 9, 2019 15:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Quetzacoalt91/99275fb42c8ce46f89d8709027412811 to your computer and use it in GitHub Desktop.
Save Quetzacoalt91/99275fb42c8ce46f89d8709027412811 to your computer and use it in GitHub Desktop.
Shell script deploying PrestaShop & Starting tests
France EUR fr fr 3 446,40 €
Spain EUR es es 3.446,40 €
Italy EUR it it 3.446,40 €
United_Kingdom GBP en gb £3,446.40
India_(Hindi) INR hi in ₹3,446.40
India_(English) INR en in ₹ 3,446.40
India_(Bengali) INR bn in ১২,৩৪,৫৬৮.১২₹
Japan JPY ja jp ¥3,446
Mexico MXN es mx $3,446.40
Poland PLN pl pl 3 446,40 zł
Russia RUB ru ru 3 446,40 ₽
United_States USD en us $3,446.40
#!/bin/sh
set +e
docker network create prestashop-net
while read -r col1 col2 lang country price
do
echo "### TEST CASE: Language $lang | Country $country"
docker run -tid --rm --name mysql-for-tests --network prestashop-net -e MYSQL_DATABASE=prestashop -e MYSQL_ROOT_PASSWORD=admin -d mysql:5.7
sleep 5
docker run -i --rm --name prestashop-$lang-$country --network prestashop-net \
-e DB_SERVER=mysql-for-tests \
-e PS_DOMAIN="127.0.0.1:8234" \
-e PS_INSTALL_AUTO=1 \
-e PS_LANGUAGE=$lang \
-e PS_COUNTRY=$country \
-e PS_FOLDER_ADMIN=admin-dev \
-e PS_FOLDER_INSTALL=install-dev \
-p 8234:80 -d prestashop/prestashop-git:7.2
RET=1
while [ $RET -ne 0 ]; do
echo "* Waiting for confirmation of PrestaShop startup"
sleep 10
curl http://127.0.0.1:8234/ > /dev/null 2>&1
RET=$?
done
echo "Ready!"
pushd /home/thomas/Documents/github/PrestaShop/tests/E2E
EXPECTED_PRICE=$price TEST_PATH=boom/cldr.js npm run specific-test -- --URL=http://127.0.0.1:8234/
popd
docker kill prestashop-$lang-$country mysql-for-tests
docker rm -v mysql-for-tests
sleep 10
done < CLDR_cases.tsv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment