This project implements a simple file based storage.
The storage-component is developed in Visual Studio Code. We are using the extensions mentioned in .\storage\vscode\extensions.json
The storage-project can be run in Visual Studio Code using storage as base folder.
The version management is done by git and gitlab. Git needs to be installed on your local machine to manage the local project repository and to synchronize it with the online repository at gitlab.
The local repository is created at any folder location, as chosen by the developer. Within this location open git bash and execute the following command within this terminal:
git clone https://mygit.th-deg.de/kernel/storage.gitThis project was started with Python 3.8 and is prepared for Python 3.10. We are setting up an local environment within the project location. To initialize this environment execute the following command (the location of the python.exe-file can vary) within a terminal in VS Code:
~\AppData\Local\Microsoft\WindowsApps\python3.10.exe -m venv .venvActivate your virtual Environment:
.\.venv\Scripts\Activate.ps1All the needed python packages are listed in the requirements.txt-file. The packages can be install using this command:
pip install -r .\requirements.txtThe testcases are run using unittest. The test-run is preconfigured in VS Code (see file .vscode/settings.json). The tests can be run and debugged using the Testing extension.
To do linting pycodestyle is used and pre-activated in VS Code (see file .vscode/settings.json and requirements.txt). Linting is run each time a python file is stored. The extracted findings are visible in the PROBLEMS panel.
The code coverage is enabled and preconfigured by
-
installing the python module coverage (see file .vscode/settings.json)
-
installing the extension ryanluker.vscode-coverage-gutters in VS Code
The code coverage analysis is based on the written unittests. To watch the code coverage run the following code in the terminal. This can be executed on Windows using the previously setup environment:
coverage run -m unittest discover -s .\test\ -p 'test_*.py'
coverage xml -o coverage.xml -iIn case, the coverage should be run on a Linux system using the set up environment, the following code is sufficient for solving the problem (running coverage3):
./.venv/bin/coverage3 run -m unittest discover -s .\test\ -p 'test_*.py'
coverage xml -o coverage.xml -iExecuting the first command executes all the written test-cases in the test-folder and creates the .coverage-file. To use this analysis within Coverage Gutters it needs to be parsed into an xml-file by the second command. After this step, the coverage can be viewed by activating the view provided by Coverage Gutters.