#!/bin/bash
set -e

function finish {
    echo "Cleaning up"
    cd $WORKINGDIR
    if [ -e ../temp.ini ]
        then cp temp.ini ../halite.ini;
    fi
}
trap finish EXIT

echo "Setting up"
WORKINGDIR=$PWD
if [ -e ../halite.ini ]
    then cp ../halite.ini temp.ini;
fi

echo "Worker tests"
cd worker
python3 testWorker.py

echo "Environment tests"
cd ../environment
python3 testenv.py 

#!/bin/bash
set -e

function finish {
    echo "Cleaning up"
    cd $WORKINGDIR
    if [ -e ../temp.ini ]
        then cp temp.ini ../halite.ini;
    fi
}
trap finish EXIT

echo "Setting up"
WORKINGDIR=$PWD
if [ -e ../halite.ini ]
    then cp ../halite.ini temp.ini;
fi
cp tests.ini ../halite.ini
python3 setupMysql.py || python setupMysql.py

echo "Website tests"
phpunit --stderr website/

echo "Worker tests"
cd worker
python3 testWorker.py

echo "Environment tests"
cd ../environment
python3 testenv.py 

Revert "Chown subdirs to non root user at copmile"
Revert "Chown subdirs to non root user at copmile"

This reverts commit 3eae59b69f716915914f9e48a615c71b9b93b4ec.
