The Wayback Machine - https://web.archive.org/web/20210918134300/https://github.com/mitre/caldera/pull/1401
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revamp unit testing infrastructure #1401

Merged
merged 25 commits into from Mar 18, 2020
Merged

Revamp unit testing infrastructure #1401

merged 25 commits into from Mar 18, 2020

Conversation

@christophert
Copy link
Contributor

@christophert christophert commented Mar 17, 2020

  • Replaces barebones Travis CI configuration with Tox for more in-depth testing featureset and consistency across multiple dev environments
    Previously, you would manually install flake8 and use unittest manually to run tests. Tox builds entire virtualenvs with the required dependencies to run tests to mitigate the potential differences between developer environments.

  • Switch out python unittest for pytest

  • Add development requirements file

  • Add code coverage with coverage.py through https://codecov.io/gh/mitre/caldera

  • Add pre-commit configuration file that can be used by developers to catch potential errors before committed. It currently only runs flake8 and flake8-bugbear, but it will be incorporating the following pre-commit hooks in the future:

  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v2.2.3
    hooks:
      - id: check-byte-order-marker
      - id: trailing-whitespace
        args: [--markdown-linebreak-ext=md]
      - id: end-of-file-fixer

The hooks do the following:

check-byte-order-marker

Forbid files which have a UTF-8 byte-order marker

trailing-whitespace

Trims trailing whitespace.

end-of-file-fixer

Makes sure files end in a newline and only a newline.

@codecov-io
Copy link

@codecov-io codecov-io commented Mar 17, 2020

Codecov Report

No coverage uploaded for pull request base (master@df95348). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##             master   #1401   +/-   ##
========================================
  Coverage          ?   43.7%           
========================================
  Files             ?      36           
  Lines             ?    2137           
  Branches          ?       0           
========================================
  Hits              ?     934           
  Misses            ?    1203           
  Partials          ?       0

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update df95348...118e270. Read the comment docs.

Copy link
Contributor

@khyberspache khyberspache left a comment

Can you expand on why you switched out unites for Pytest?

tox.ini Outdated Show resolved Hide resolved
tox.ini Show resolved Hide resolved
@khyberspache khyberspache requested a review from privateducky Mar 17, 2020
CONTRIBUTING.md Outdated Show resolved Hide resolved
@privateducky privateducky merged commit b6438a5 into master Mar 18, 2020
4 checks passed
@privateducky privateducky deleted the VIRTS-1036-tox branch Mar 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
5 participants