This repository has been archived by the owner on Jan 6, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
run.sh
executable file
·50 lines (38 loc) · 1.58 KB
/
run.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/usr/bin/env bash
set -e
PIVOTAL_SOURCE=pgadmin-repo
tar -xf pgadmin-repo-tarball/*.tgz
chown -R postgres:postgres /var/lib/postgresql/data
/opt/bin/postgres_start.sh
trap /opt/bin/postgres_stop.sh exit
# Pass in the config file
cp pgadmin-ci/config_local.py $PIVOTAL_SOURCE/web/config_local.py
#cp pgadmin-ci/test_config.json $PIVOTAL_SOURCE/web/regression/test_config.json
sed -e "s/{{db_name}}/PostgreSQL/" \
-e "s/{{db_comment}}/Concourse default postgres/" \
-e "s/{{db_host}}/localhost/" \
-e "s/{{db_username}}/postgres/" \
-e "s/{{db_password}}//" \
-e "s/{{db_port}}/5432/" \
-e "s/{{db_version}}/$PG_MAJOR/" \
pgadmin-ci/test_config.template.json \
> $PIVOTAL_SOURCE/web/regression/test_config.json
# Replace the first line of the file with the missing import
sed -i '/__future__/a from selenium.webdriver.common.desired_capabilities import DesiredCapabilities' $PIVOTAL_SOURCE/web/regression/runtests.py
sed -i "s/Chrome()/Remote\(command_executor='http:\/\/127.0.0.1:4444\/wd\/hub', desired_capabilities=DesiredCapabilities.CHROME\)/" $PIVOTAL_SOURCE/web/regression/runtests.py
mkdir logs
/opt/bin/start_selenium.sh &
# the shell we're in is probably not a login shell in concourse
source ~/.bash_profile
pyenv activate $PYENV_ENV
## Install project requirements
pip install -r $PIVOTAL_SOURCE/requirements.txt
pip install -r $PIVOTAL_SOURCE/web/regression/requirements.txt
cd $PIVOTAL_SOURCE/web
yarn install --no-progress
export PYTHONPATH=`pwd`
if [[ -n $(which pytest) ]]; then
pytest -q pgadmin regression/feature_tests
else
python regression/runtests.py
fi