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:
As of now, a total of four scripts is the ideal scenario to consider: one script for each database and one script that will run each of those, one after the other
The commands to create the containers and generate PythonREST is on the README of each database folder and should be used on the scripts that will be created.
The main script will do the steps 1-5 listed above, and then it will run the script for each database one after the success of the other.
Capture the logs and print them out or put them to files, try to capture the most important logs if possible to avoid filling the terminal and/or file log with unnecessary things.
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: