Skip to content

Lack of code tests #178

@e100

Description

@e100

I finally setup continuous integration using Github actions so we can start focusing on reliability and readability.

For an aviation application we need to improve our code testing, currently we only have about 18% of the code tested, thanks @birkelbach But we should have 100% coverage.

You can easily find what code needs tested here:
https://htmlpreview.github.io/?https://github.com/makerplane/FIX-Gateway/blob/python-coverage-comment-action-data/htmlcov/index.html

That report is automatically updated when pull requests are merged into the master branch.

In addition to tests, I have setup flake8 to check for style and syntax. We should work to get all of those findings removed too.
After checking out the code if you run 'make test' it will run flake8 and all the tests so it is easy to see what needs addressed.

I have actually found and fixed numerous bugs from flake8 output, particularly from output like:

./src/fixgw/database.py:350:5: F841 local variable 'state' is assigned to but never used

Maybe the developer meant self.state or maybe it should have been stat

Following and fixing the style suggestions will not only make the code easier to read, but also can prevent bugs from typos and logic errors.

When pull requests are submitted the CI will also generate a comment that details how much of the new code is covered by tests.
For example: #177 (comment)

At some point we should consider requiring 100% coverage for every new or modified line in a pull request.

So if you have a few minute here or there, make a unit test and send a pull request.
If you need help, please ask in the discussions:
https://github.com/makerplane/FIX-Gateway/discussions/categories/general

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions