-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrun_tests.sh
executable file
·63 lines (52 loc) · 2.01 KB
/
run_tests.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
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/usr/bin/env bash
# -*- coding: utf-8 -*-
#
# Copyright (C) 2020 CESNET.
#
# invenio-integration-tests is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
set -e
echo -e "\ninvenio-integration-tests/run_tests.sh"
export INVENIO_JSONSCHEMAS_HOST=repozitar.cesnet.cz
echo -e "\ninvenio shell, print(version.__version__):"
invenio shell --simple-prompt -c "from invenio import version; print (\"Invenio version:\", version.__version__)"
echo -e "\npsql version:"
psql --version
echo "invenio db init,create:"
invenio db init
invenio db create
# invenio >=3.3 only:
if [ "${REQUIREMENTS}" != "invenio3.2" ] ; then
echo "user create:"
invenio users create -a [email protected] --password 112233
fi
echo -e "\nelasticsearch GET:"
curl -sX GET "http://127.0.0.1:9200" || cat /tmp/local-es.log
echo "invenio index init,check:"
invenio index init
invenio index check
echo -e "\ninvenio run (testing REST):"
#export FLASK_ENV=development
export FLASK_RUN_HOST=127.0.0.1
export FLASK_RUN_PORT=5000
export INVENIO_SERVER_NAME=127.0.0.1:5000
export INVENIO_SEARCH_ELASTIC_HOSTS=127.0.0.1:9200
export APP_ALLOWED_HOSTS=127.0.0.1:5000
export INVENIO_RECORDS_REST_DEFAULT_CREATE_PERMISSION_FACTORY='invenio_records_rest.utils:allow_all'
export INVENIO_RECORDS_REST_DEFAULT_UPDATE_PERMISSION_FACTORY='invenio_records_rest.utils:allow_all'
export INVENIO_RECORDS_REST_DEFAULT_DELETE_PERMISSION_FACTORY='invenio_records_rest.utils:allow_all'
invenio run --cert ./ssl/test.crt --key ./ssl/test.key > invenio_run.log 2>&1 &
INVEPID=$!
trap "kill $INVEPID &>/dev/null; cat invenio_run.log" EXIT
sleep 8
echo -n "jq version:"; jq --version
./scripts/test_rest.sh
kill $INVEPID
trap - EXIT
echo -e "\ninvenio_run.log:"
cat invenio_run.log
echo -e "\nsave requirements"
REQFILE="upload/requirements-${REQUIREMENTS}.txt"
./scripts/poetry2reqs.py | sed 's/\x0D$//' | grep -v '^pywin32==' > $REQFILE
grep -F -e invenio= -e invenio-base -e invenio-search -e invenio-db $REQFILE
echo "Done."