Site testing process & automation
Created by: el00ruobuob
This thread is to discuss site testing & automation of this testing.
I have, on behalf of @rehrar, started to test myself the PRs, let's see if we can do better.
Environment (ESXi-absed VMs):
- A dedicated Ubuntu Server 18.04 to run the build on.
- 4 clients:
- Ubuntu 18.04
- CentOS 7
- Windows 7
- Windows 10
On the server, i made a script to start testing a PR based on it's number:
#!/bin/bash
if [ -z $1 ]
then
echo 'Pull Request not specified'
exit 1
elseif ! [[ $1 =~ ^[0-9]+$ ]]
echo 'Pull Request should be a number'
exit 1
fi
dirPR=PR$1
dirExist=`find . -name $dirPR | wc -l`
echo "Getting Pull Request informations"
PRpage=`curl https://github.com/monero-project/monero-site/pull/$1`
PRtitle=`<<<$PRpage grep title | head -1 | sed s/"<title>"//g | sed s/"<\/title>"//g`
echo $PRtitle
if [ $dirExist == "1" ]
then
echo "Directory exist for Pull Request" $1
cd $dirPR
echo "Clearing local changes and fetching again"
git fetch origin master
git reset --hard FETCH_HEAD
git clean -df
git pull -f --no-edit
echo "Fetch succeeded"
else
echo "No directory, getting Pull Request"
PRsource=`<<<$PRpage grep "class=\"commit-ref" | grep title | tail -1 | sed s/\"/" "/g | awk '{print $3}'`
repo=`<<<$PRsource sed s/\:/" "/g | awk '{print $1}'`
branch=`<<<$PRsource sed s/\:/" "/g | awk '{print $2}'`
echo "Going to fetch" $branch "from repository" $repo
git clone -b $branch https://github.com/$repo $dirPR
cd $dirPR
fi
rubyPS=`ps aux | grep ruby | grep -v grep`
rubyRunning=`<<<$rubyPS wc -l`
if [ $rubyRunning == "1" ]
then
echo "Ruby is already running, killing..."
rubyPID=`<<<$rubyPS awk '{print $2}'`
kill -9 $rubyPID
echo "Killed. Let's Rock'n'Roll!"
else
echo "Ruby is not here. Let's Rock'n'Roll!"
fi
jekyll serve --host vsrv-ubuntu-getmonero --port 80 -I --detach
local=(`ls _i18n/ | grep -e ^..$ | grep -v en`)
for i in "${local[@]}"
do
cp -R _i18n/$i/resources/user-guides/png _site/$i/resources/user-guides/
done
echo "Getmonero stagged for Pull Request" $PRtitle
echo "Please connect to getmonero.<my_domain> and try!"
exit 0
Which i called this way: ./gitter.sh #PRnum
Then, i connect on my 4 VMs to check for all the browsers:
Edge | IE 11 | Chrome | Firefox | Opera | Vivaldi | |
---|---|---|---|---|---|---|
Windows 7 | - | OK | OK | OK | OK | OK |
Windows 10 | OK | OK | OK | OK | OK | OK |
Ubuntu 18.04 | - | - | OK | OK | OK | OK |
CentOS 7 | - | - | - | OK | OK | OK |
Only Firefox is perfect out of the box. All others are showing a lot of carriage return around the <language_name> box: Firefox: