New Ticket

TICKET_CREATE privileges are required to perform this operation. You don't have the required permissions



Login Close

File README.md

bh_core_experimental

Last change on this file was 3854c5d, checked in by Gary Martin <gjm@…>, 5 months ago

Improving README.md accuracy; adjusting Pipfile

git-svn-id: https://svn.apache.org/repos/asf/bloodhound/branches/bh_core_experimental@1832975 13f79535-47bb-0310-9956-ffa450edef68

  • Property mode set to 100644
File size: 2.5 KB

Line 
1# New Bloodhound
2
3## Requirements
4
5Bloodhound uses pipenv for development process.
6
7If you have pip installed already, installation can be a simple as
8
9```
10pip install --user pipenv
11```
12
13For more information on installing and usage of pipenv, see
14https://docs.pipenv.org/.
15
16Once pipenv is installed, the remaining job of installing should be as simple
17as
18
19```
20pipenv install
21```
22
23If this doesn't work, it should be done from the same directory as the
24`Pipenv` file.
25
26Additionally, to run tests described later, you'll also need to install the
27development dependencies:
28
29```
30pipenv install --dev
31```
32
33Though possibly annoying, the commands in this file will assume the use of
34`pipenv` but not that the pipenv shell has been activated.
35
36## Setup
37
38The basic setup steps to get running are:
39
40```
41pipenv run python manage.py makemigrations trackers
42pipenv run python manage.py migrate
43```
44
45The above will do the basic database setup.
46
47Note that currently models are in flux and, for the moment, no support should
48be expected for migrations as models change. This will change when basic
49models gain stability.
50
51## Running the development server:
52
53```
54pipenv run python manage.py runserver
55```
56
57## Unit Tests
58
59Unit tests are currently being written with the standard unittest framework.
60This may be replaced with pytest.
61
62The tests may be run with the following command:
63
64```
65pipenv run python manage.py test
66```
67
68Fixtures for tests when required can be generated with:
69
70```
71pipenv run python manage.py dumpdata trackers --format=yaml --indent=2 > trackers/fixtures/[fixture-name].yaml
72```
73
74## Integration Tests
75
76Selenium tests currently require that Firefox is installed and `geckodriver` is
77also on the path. One way to do this is (example for 64bit linux distributions):
78
79```
80BIN_LOCATION="$HOME/.local/bin"
81PLATFORM_EXT="linux64.tar.gz"
82TMP_DIR=/tmp
83LATEST=$(wget -O - https://github.com/mozilla/geckodriver/releases/latest 2>&1 | awk 'match($0, /geckodriver-(v.*)-'"$PLATFORM_EXT"'/, a) {print a[1]; exit}')
84wget -N -P "$TMP_DIR" "https://github.com/mozilla/geckodriver/releases/download/$LATEST/geckodriver-$LATEST-$PLATFORM_EXT"
85tar -x geckodriver -zf "$TMP_DIR/geckodriver-$LATEST-$PLATFORM_EXT" -O > "$BIN_LOCATION"/geckodriver
86chmod +x "$BIN_LOCATION"/geckodriver
87```
88
89If `$BIN_LOCATION` is on the system path, and the development server is
90running, it should be possible to run the integration tests.
91
92```
93pipenv run python functional_tests.py
94```
95
96There are currently not many tests - those that are there are in place to test
97the setup above and assume that there will be useful tests in due course.

Note See TracBrowser for help on using the repository browser.