-
Several issues have been identified and need to be corrected in the project.
Tests need to be performed and passed to be sure the bugs have been corrected. -
A new feature needs to be added to the project.
Tests are needed to check its validity. -
The program will need an update regarding one feature after the previous corrections.
Tests will be updated also to reflect this evolution. -
Check that at least 60% of the code has been covered by the tests
My personal configuration for this project:
- OS: Linux Mint 20.2 Cinnamon
- Python version: 3.8.10
- Webdriver for Selenium: Chromium
Version 94.0.4606.81 (Build officiel) for Linux Mint (64 bits)
However here are the general observations to run the tests
- The unitary and integration tests can be run from any configuration
- The functional tests must be run with Chromium on your computer
- The performance tests can be run from any configuration
- The unitary and integration tests can be performed at once and appart from the functional tests
- The functional tests can be run on their own
To be able to run the tests follow the steps described in the following sections of this file.
- It has been decided to use PEP8 for this program
- All the corrections, features and tests will be written folowing the PEP8
- As this program is a MVP and some code has already been written, the existing code will remain as it is until the QA has been validated
- When the program is validated, all the code will be updated to PEP8 standard
- Clone the repo & install the virtual environment
- Install the dependencies:
pip install -r requirements.txt
- All tests appart from functional tests can be performed, the command to run them will be displayed in the next section of this file
- To run functional tests do as follows:
a. go to this webpage
b. download the WebDriver corresponding to Chromium for your computer
c. install it on your computer
d. go to the following folder:P11_Flask_Testing_Debugging/tests/fonctionnels/
e. replace the actual chromedriver file. !!WARNING!! use the exact same file name when replacing the chromdriver file
f. tests are ready to be performed using the commands presented in the next section
To run all the tests at once (except the functional tests) do as follows:
- in a new terminal window go to the root directory
- activate your virtual environment
- go to the root folder
P11_Flask_Testing_Debugging
- then type
pytest -m all_tests
to run the tests
To run the functional tests you will need to do as follows:
- open a first terminal window go to the root directory
a. activate your virtual environment
c. go to the directoryP11_Flask_Testing_Debugging
d. typeexport FLASK_APP=server.py
e. thenflask run
- open a second terminal window
a. activate your virtual environment
b. go to the directoryP11_Flask_Testing_Debugging
c. typepytest -m functional_tests
to run the tests
To run only one bug or feature tests you will need to do as follows:
- open a first terminal window go to the root directory
a. activate your virtual environment
c. go to the directoryP11_Flask_Testing_Debugging
d. typeexport FLASK_APP=server.py
e. thenflask run
- open a second terminal window
a. activate your virtual environment
b. go to the directoryP11_Flask_Testing_Debugging
c. typepytest -m <pytest_marker>
to run the tests
Here are the details regarding the bugs ad features of this program
BUGS - FEATURES | PYTEST MARKER | COMMAND LINE |
---|---|---|
bug/login-error | login_error | pytest -m login_error |
bug/points-update | points_updated | pytest -m points_updated |
bug/past-competition | past_competition | pytest -m past_competition |
bug/no_more_than_club_points | no_more_than_club_points | pytest -m no_more_than_club_points |
bug/max_12_places | max_12_places | pytest -m max_12_places |
feature/points_by_place | points_by_place | pytest -m points_by_place |
feature/list_of_clubs_and_points | new_feature | pytest -m new_feature |
####E. Performance tests To run one performance test for each bug or feature at the time do as follows:
- open a first terminal window go to the root directory
a. activate your virtual environment
c. go to the directoryP11_Flask_Testing_Debugging
d. typeexport FLASK_APP=server.py
e. thenflask run
- open a second terminal window
a. activate your virtual environment
b. go to the directoryP11_Flask_Testing_Debugging
c. typelocust -f tests/performance/all_performance_tests.py
Then follow the instructions using these parameters:
- Number of users = 6
- Spawn rate = 6
- Host = http://127.0.0.1:5000