Closed adamyala closed 7 years ago
Below is a shell script I wrote that initializes the tests and runs them. Is there a preferred format you guys take shell scripts and pull requests in? I'd be happy to update the manual documentation as well.
#!/bin/sh
# NOTE: Replace the "user" in the absolute path with your own!
echo "Install phantomjs, testing reqs, and python-pytest" &&
sudo apt-get update &&
sudo apt-get install -y phantomjs &&
sudo pip install -r ~/haiwen/seafile-server-latest/seahub/test-requirements.txt &&
sudo apt-get install -y python-pytest &&
echo "Make symbolic links of thirdparty libraries" &&
for i in ~/haiwen/seafile-server-latest/seafile/lib64/python2.6/site-packages/* ; do ln -s "$i" ~/haiwen/seafile-server-latest/seahub/thirdpart/ ; done &&
echo "Make symbolic link for ccnet config file" &&
ln -s ~/haiwen/conf/ccnet.conf ~/haiwen/ccnet/ &&
echo "Replace directory location per the comments in the file" &&
sed -i -e 's/# export CCNET_CONF_DIR=\/your\/path\/to\/ccnet/export CCNET_CONF_DIR=\/home\/user\/haiwen\/ccnet\//g' ~/haiwen/seafile-server-latest/seahub/tests/seahubtests.sh &&
sed -i -e 's/# export SEAFILE_CONF_DIR=\/your\/path\/to\/seafile-data/export SEAFILE_CONF_DIR=\/home\/user\/haiwen\/seafile-data\//g' ~/haiwen/seafile-server-latest/seahub/tests/seahubtests.sh &&
echo "Restart/start seafile and seahub" &&
./haiwen/seafile-server-latest/seafile.sh restart &&
./haiwen/seafile-server-latest/seahub.sh restart &&
echo "Initialize test suite environment" &&
bash haiwen/seafile-server-latest/seahub/tests/seahubtests.sh init &&
echo "Run tests" &&
bash haiwen/seafile-server-latest/seahub/tests/seahubtests.sh test
NOTE: I originally made an issue here https://github.com/haiwen/seahub/issues/1188 I remade the issue here (the correct place) because I found a solution. Please advise on how you would like a pull request made to fix this.
I'm trying to run the seahub tests by taking the steps below.
First I run these commands per the guide on deploying to mysql
This completes with no errors.
When those steps are complete I install the python requirements detailed in
test_server/seafile-server-5.1.1/seahub/test-requirements.txt
usingpip install -r test-requirements.txt
. This completes with no errors.I then run
test_server/seafile-server-5.1.1/seahub/tests/install-deps.sh
usingsudo ./install-deps.sh
. This fails with the errormv: cannot stat '/etc/nginx/sites-enabled/default': No such file or directory
because I have no nginx default to backup. If I remove themv
line from the script, it completes with no errors.Per the comments in the code, I change two lines in
test_server/seafile-server-5.1.1/seahub/tests/seahubtests.sh
fromto
I then run
test_server/seafile-server-5.1.1/seahub/tests/seahubtests.sh
usingsudo ./seahubtests.sh init
. This gives me the stack trace error ofIs there a step I'm missing?