seven-technologies-cloud / pythonrest

Creative Commons Zero v1.0 Universal
10 stars 4 forks source link

Create test scripts to create and generate API for MySQL, PostgreSQL and SQLServer #71

Open leo-viana opened 3 months ago

leo-viana commented 3 months ago

Goal

Creation of scripts that can be run on a brand new machine to test that PythonREST works just fine.

Description

A tests folder was newly added to the root of the repository, that folder contains a structure separated for each database (MySQL, PostgreSQL and SQLServer), with a docker file, sql script and readme, all ready with instructions to get the database up and running, ready for connections.

The idea of this task is to use those and create scripts that will: 1 - Check if the following are installed, if not, install them: Docker(certify that docker compose is working with it), Python 3.11 and PythonREST 2 - Check above installations were successful 3 - Start Docker on machine and check Docker is running 4 - Navigate to the tests/Database folder 5 - Iterate through the database folders(MySQL, PostgreSQL and SQLServer) and do the following, for each of them: 5.1 - run docker compose up (and additional commands in case of SQLServer). 5.2 - Check the container is running successfully 5.3 - run pythonrest generate for the running container database 5.4 - check if api generated successfully(via checking prints of generation and correct folder structure on generated api folder) 5.5 - run the commands to start the api(create venv, activate venv, pip install requirements and run python app.py) 5.6 - verify that the api is running successfully ( via checking prints of flask app running and some way to check that flask is running somewhere inside machine) 5.7 - Run some curl requests on the api to check everything is definitely alright. 5.8 - Stop running the api and clean the docker container.

Some things to consider: