# slz_job_executor lambda
Starts SF for scheduled UoWs
## Lambda input
```json
{
    "time": "2021-08-26T03:05:31Z",
    "optional_config": {}
}
```
## Lambda Output
In case of successful lambda execution the following output will be provided:
```json
{
    "meta": {
        "status": "OK",
        "sf_names": ["name1", "name2"]

    }
}
```

If any kind of exception occurred, the response will look like the following:
```json
{
    "meta": {
        "status": "FAILURE",
        "message": <exception message>
    }
}
```

## Running tests

There are two type of tests here.
1. Tests where connection to test DB not required
```shell script
make docker/test
```
2. Tests where connection to test DB required
With a following command it will set up a database container, update it with migrations and start tests.
```shell script
make docker/integration
```
This command starts container with PostgreSQL database, applies migrations to it and invokes
tests. After everything is done temporary containers are removed automatically.

## Local testing

- Prepare CloudWatch event
- Put it into the `events/`
- Execute lambda:

```
    python <project_name> -e <environment> -p events/<event>.json
```
