-
Notifications
You must be signed in to change notification settings - Fork 10
Getting started
Requirements
- Github student pack (it will be used for getting Pro edtition of PyCharm)
- PyCharm Professional 2017
- Git (for Windows users)
- Python 3.6
First time setup
- Create virtual environment in PyCharm
Terms
- PR - Pull Request
Github
- Each PR has to resolve the corresponding issue. For doing this write "Resolve #number_of_issue" in a description. E.g "Resolve #44"
Testing
-
Testing files have to be placed in subdirectory with test's name
-
Every high-level package should have package_dir variable declared in
__init__ -
All paths have to be absolute. Use
os.path.join(packaga_dir, <your file/folder name>) -
Cross testing. Code and tests are always made by different persons
-
Make at least one test for every function
General tests:
- "Sample" tests. This test checks basic functioning. You should make 3 samples and give them as input to a tested function. Test is passed if function worked without exceptions on all samples
- "Known result". Generate input data for tested func (as you did in Sample tests). Then save function's result. Manually check the correctness of the saved result. If you're convinced that result is correct and func work properly, add generated source data as input. Run func with that input and check output and for equality with saved result (use assert for this)
Parsing:
- "Broken source". Generate data as it was for Sample, but then modify it to check: If func handles known exceptions. If it throws an exception in case of input format does not live up to expectations
Workflow
-
In brief, when you create PR, code from your branch get copied to Travis. Travis installs all libs from
requirements.txt, then run tests from/testpackage. If all tests are passed, Travis sends the result to CodeCov. CodeCov calculates how many new lines were added and how many lines became covered by tests. If the ratio is greater then zero, all checks are passed. After that, your code should be approved by at least one person. -
If any of checks is failed or if someone requested changes, you should make appropriate changes to your code
-
Current version of code stored in master. master is protected branch. All code is added to master via PRs
-
Each PR must be approved by at least one another person
-
Travis is used for continuous integration
-
What is continious intergration
-
CodeCov is used for test coverage