Skip to content

Latest commit

 

History

81 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

storage

This project implements a simple file based storage.

Configuring the environment

Development environment: Visual Studio Code

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.

Version management: git and gitlab

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.git

Coding language: python 3.10

This 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 .venv

Activate your virtual Environment:

.\.venv\Scripts\Activate.ps1

All the needed python packages are listed in the requirements.txt-file. The packages can be install using this command:

pip install -r .\requirements.txt

Testing by unittest

The 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.

Run Linting

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.

Run Code Coverage

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 -i

In 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 -i

Executing 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.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages