vatsaaa / tasks

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to run

Setup the development environment

Clone from repository

> mkdir projects
> cd projects
> git clone https://github.com/vatsaaa/tasks.git

Setup virtual environment

macOS/Linux

> cd tasks
> python3 -m venv .venv

Windows

> cd tasks
> python -m venv .venv

Get the code working

Activate the virtual environment and Install requirements

> ./.venv/bin/activate
> pip3 install -r requirements.txt

Run the app

> python3 app.py

Run celery

> pip3 install eventlet

celery -A taskqueue.tasks.celery_app worker --loglevel=DEBUG --pool=eventlet --purge

Test Successful running API

How to contribute to the project

Code

Add more functionality

Add definition to config/swagger.yml file

paths:
  /ping:
    get:
      summary: Health check url
      operationId: controllers.controllers.ping
      parameters:
        - in: query
          name: suffix
          required: false
          schema:
            type: string
          description: suffix is appended to response from the service 
      tags:
      - Health Check
      responses:
        200:
          description: ping( ) services responds to user's ping with pong and the time at which the srvice was invoked. e.g. 

Add corresponding code to controllers/controllers.py

def ping(suffix=None):
    resp_str = "User ping, tasks pong / " + dt.now().strftime("%Y-%m-%d, %H:%M:%S")
    resp = resp_str if suffix is None else resp_str + " / " + suffix
    return resp

Run and test from Swagger-UI

> python3 app.py
INFO:waitress:Serving on http://127.0.0.1:5454

Open the browser to visit page http://127.0.0.1:5454/api/v1/ui to launch the swagger ui and to test the service just added

Alternatively, one could use the cUrl utility as well:

curl -X 'GET' \
  'http://127.0.0.1:5454/api/v1/ping?suffix=suffix01' \
  -H 'accept: */*'

Code reviews and walkthroughs

Testing

Unit testing

Need to add unit testing for each module which should run nightly - for every branch Successful tests is the first criteria for accepting a merge request

Automated testing

Need to create automated functional tests which should run nightly - for every branch Successful tets is the first criteria for accepting a merge request

Documentation

Improve README.md

Improve wiki

Contribute to discussions

How to use redis-cli correctlyc

https://lightrun.com/dev-tools/using-the-redis-command-line/

https://redis.io/topics/data-types-intro

About

License:GNU General Public License v3.0


Languages

Language:Python 100.0%