move everything to subfolder to merge into react-sdk
This commit is contained in:
parent
6cb9ef7e65
commit
ca86969f92
47 changed files with 0 additions and 0 deletions
2
test/end-to-end-tests/riot/.gitignore
vendored
Normal file
2
test/end-to-end-tests/riot/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
riot-web
|
||||
riot.pid
|
33
test/end-to-end-tests/riot/config-template/config.json
Normal file
33
test/end-to-end-tests/riot/config-template/config.json
Normal file
|
@ -0,0 +1,33 @@
|
|||
{
|
||||
"default_hs_url": "http://localhost:5005",
|
||||
"default_is_url": "https://vector.im",
|
||||
"disable_custom_urls": false,
|
||||
"disable_guests": false,
|
||||
"disable_login_language_selector": false,
|
||||
"disable_3pid_login": false,
|
||||
"brand": "Riot",
|
||||
"integrations_ui_url": "https://scalar.vector.im/",
|
||||
"integrations_rest_url": "https://scalar.vector.im/api",
|
||||
"bug_report_endpoint_url": "https://riot.im/bugreports/submit",
|
||||
"features": {
|
||||
"feature_groups": "labs",
|
||||
"feature_pinning": "labs"
|
||||
},
|
||||
"default_federate": true,
|
||||
"welcomePageUrl": "home.html",
|
||||
"default_theme": "light",
|
||||
"roomDirectory": {
|
||||
"servers": [
|
||||
"localhost:5005"
|
||||
]
|
||||
},
|
||||
"piwik": {
|
||||
"url": "https://piwik.riot.im/",
|
||||
"whitelistedHSUrls": ["http://localhost:5005"],
|
||||
"whitelistedISUrls": ["https://vector.im", "https://matrix.org"],
|
||||
"siteId": 1
|
||||
},
|
||||
"enable_presence_by_hs_url": {
|
||||
"https://matrix.org": false
|
||||
}
|
||||
}
|
35
test/end-to-end-tests/riot/install.sh
Executable file
35
test/end-to-end-tests/riot/install.sh
Executable file
|
@ -0,0 +1,35 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
RIOT_BRANCH=develop
|
||||
|
||||
BASE_DIR=$(cd $(dirname $0) && pwd)
|
||||
cd $BASE_DIR
|
||||
# Install ComplexHttpServer (a drop in replacement for Python's SimpleHttpServer
|
||||
# but with support for multiple threads) into a virtualenv.
|
||||
(
|
||||
virtualenv -p python3 env
|
||||
source env/bin/activate
|
||||
|
||||
# Having been bitten by pip SSL fail too many times, I don't trust the existing pip
|
||||
# to be able to --upgrade itself, so grab a new one fresh from source.
|
||||
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
|
||||
python get-pip.py
|
||||
rm get-pip.py
|
||||
|
||||
pip install ComplexHttpServer
|
||||
|
||||
deactivate
|
||||
)
|
||||
|
||||
if [ -d $BASE_DIR/riot-web ]; then
|
||||
echo "riot is already installed"
|
||||
exit
|
||||
fi
|
||||
|
||||
curl -L https://github.com/vector-im/riot-web/archive/${RIOT_BRANCH}.zip --output riot.zip
|
||||
unzip -q riot.zip
|
||||
rm riot.zip
|
||||
mv riot-web-${RIOT_BRANCH} riot-web
|
||||
cd riot-web
|
||||
yarn install
|
||||
yarn run build
|
54
test/end-to-end-tests/riot/start.sh
Executable file
54
test/end-to-end-tests/riot/start.sh
Executable file
|
@ -0,0 +1,54 @@
|
|||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
PORT=5000
|
||||
BASE_DIR=$(cd $(dirname $0) && pwd)
|
||||
PIDFILE=$BASE_DIR/riot.pid
|
||||
CONFIG_BACKUP=config.e2etests_backup.json
|
||||
|
||||
if [ -f $PIDFILE ]; then
|
||||
exit
|
||||
fi
|
||||
|
||||
cd $BASE_DIR/
|
||||
echo -n "starting riot on http://localhost:$PORT ... "
|
||||
pushd riot-web/webapp/ > /dev/null
|
||||
|
||||
# backup config file before we copy template
|
||||
if [ -f config.json ]; then
|
||||
mv config.json $CONFIG_BACKUP
|
||||
fi
|
||||
cp $BASE_DIR/config-template/config.json .
|
||||
|
||||
LOGFILE=$(mktemp)
|
||||
# run web server in the background, showing output on error
|
||||
(
|
||||
source $BASE_DIR/env/bin/activate
|
||||
python -m ComplexHTTPServer $PORT > $LOGFILE 2>&1 &
|
||||
PID=$!
|
||||
echo $PID > $PIDFILE
|
||||
# wait so subshell does not exit
|
||||
# otherwise sleep below would not work
|
||||
wait $PID; RESULT=$?
|
||||
|
||||
# NOT expected SIGTERM (128 + 15)
|
||||
# from stop.sh?
|
||||
if [ $RESULT -ne 143 ]; then
|
||||
echo "failed"
|
||||
cat $LOGFILE
|
||||
rm $PIDFILE 2> /dev/null
|
||||
fi
|
||||
rm $LOGFILE
|
||||
exit $RESULT
|
||||
)&
|
||||
# to be able to return the exit code for immediate errors (like address already in use)
|
||||
# we wait for a short amount of time in the background and exit when the first
|
||||
# child process exits
|
||||
sleep 0.5 &
|
||||
# wait the first child process to exit (python or sleep)
|
||||
wait -n; RESULT=$?
|
||||
# return exit code of first child to exit
|
||||
if [ $RESULT -eq 0 ]; then
|
||||
echo "running"
|
||||
fi
|
||||
exit $RESULT
|
22
test/end-to-end-tests/riot/stop.sh
Executable file
22
test/end-to-end-tests/riot/stop.sh
Executable file
|
@ -0,0 +1,22 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
BASE_DIR=$(cd $(dirname $0) && pwd)
|
||||
PIDFILE=riot.pid
|
||||
CONFIG_BACKUP=config.e2etests_backup.json
|
||||
|
||||
cd $BASE_DIR
|
||||
|
||||
if [ -f $PIDFILE ]; then
|
||||
echo "stopping riot server ..."
|
||||
PID=$(cat $PIDFILE)
|
||||
rm $PIDFILE
|
||||
kill $PID
|
||||
|
||||
# revert config file
|
||||
cd riot-web/webapp
|
||||
rm config.json
|
||||
if [ -f $CONFIG_BACKUP ]; then
|
||||
mv $CONFIG_BACKUP config.json
|
||||
fi
|
||||
fi
|
Loading…
Add table
Add a link
Reference in a new issue