Skip to content

Commit

Permalink
Merge pull request #779 from uktrade/update_readme
Browse files Browse the repository at this point in the history
Update readme
  • Loading branch information
dgnball authored Jun 23, 2021
2 parents 1cb1a0b + 4b03651 commit d30c2e3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 20 deletions.
24 changes: 9 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ Service for handling backend calls in LITE.
- Set up your local config file:

- `cp local.env .env` - you will want to set this up with valid values, ask another developer or get them from Vault.
If you want to run in Docker then uncomment the appropriate line in `.env` refering to DATABASE_URL
If you want to run in Docker then uncomment the appropriate line in `.env` referring to DATABASE_URL.
- In `.env`, also fill in the email field for INTERNAL_USERS and EXPORTER_USERS with valid values.
- If running locally (using pipenv), make sure to change the DATABASE_URL to use the port exposed by docker-compose
which is 5462 (double check by viewing the docker-compose file)

- Initialise submodules

Expand All @@ -28,7 +31,7 @@ Service for handling backend calls in LITE.

- `docker network create lite` - shared network to allow API and frontend to communicate
- `docker-compose build` - build the container image
- `docker-compose start db` - to bring up the db to allow the migrate to succeed
- `docker-compose up -d db` - to bring up the db to allow the migrate to succeed

- Run the migrations
- `./bin/migrate.sh` - Perform the Django migrations
Expand All @@ -37,7 +40,7 @@ Service for handling backend calls in LITE.
- `docker-compose up` - to start the API's django server
- Go to the index page (e.g. `http://localhost:8100`)
- At this point you might want to seed your database with some static
- run `docker-compose run ./manage.py seedall`
- run `docker-compose run api ./manage.py seedall`

## Add a single user:

Expand Down Expand Up @@ -82,8 +85,9 @@ To regenerate the diagrams run `pipenv run ./manage.py create_er_diagrams`

## Running Tests

- `pipenv run ./manage.py test` will run all tests
- `pipenv run ./manage.py test cases` will run the `cases` module tests
- `pipenv run ./manage.py test` will run all tests (takes over 30 minutes)
- `pipenv run ./manage.py test --parallel` will run all tests in parallel
- `pipenv run ./manage.py test api/cases` will run the `cases` module tests

## Running Code Coverage

Expand All @@ -106,13 +110,3 @@ To regenerate the diagrams run `pipenv run ./manage.py create_er_diagrams`
## Running Bandit

`pipenv run bandit -r .`

## Running API tests

`pipenv run ./manage.py test`

with option `--parallel` to run them in parallel

To run a specific folder:

`pipenv run ./manage.py test <folder_name>`
6 changes: 1 addition & 5 deletions local.env
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ UPLOAD_DOCUMENT_ENDPOINT_ENABLED=False
DJANGO_SECRET_KEY=DJANGO_SECRET_KEY

HAWK_AUTHENTICATION_ENABLED=False
HAWK_LITE_DATA_WORKSPACE_KEY=dummy_value
LITE_EXPORTER_HAWK_KEY=LITE_EXPORTER_HAWK_KEY
LITE_INTERNAL_HAWK_KEY=LITE_INTERNAL_HAWK_KEY
LITE_E2E_HAWK_KEY=LITE_E2E_HAWK_KEY
Expand Down Expand Up @@ -74,9 +75,4 @@ SIGNING_REASON=SIGNING_REASON

PERMISSIONS_FINDER_URL='' # required for accessing exporter lite content, can be empty string

# seed data
LITE_API_DEMO_FLAGS_CSV="field\nteam1\nteam2"
LITE_API_DEMO_QUEUES_CSV="field\nteam1\nteam2"
LITE_API_DEMO_TEAMS_CSV="field\nteam1\nteam2"

ELASTICSEARCH_HOST=http://localost:9200

0 comments on commit d30c2e3

Please sign in to comment.