Skip to content

Minor improvements in testing, builds and pipeline #707

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

Merged
merged 8 commits into from
Jun 29, 2020

Conversation

vrdmr
Copy link
Member

@vrdmr vrdmr commented Jun 28, 2020

Description

This PR adds the following:

  1. Move from coverage to pytest-cov - moving to pytest native coverage tool.
  2. Enabling --instafail to print out the stdout statements immediately.
  3. Adding a description of the rules exempted in flake8.
  4. Enable schedule runs every midnight for main branches in the pipeline.
  5. Adding typing information in the Dispatcher's __init__() to help in static analysis - [Improvement] Adding types to function/method parameters to help with static analysis #704.
  6. Minor refactoring (renaming, correct scope-levels and making static methods)

Fixes #704


PR information

  • The title of the PR is clear and informative.
  • There are a small number of commits, each of which has an informative message. This means that previously merged commits do not appear in the history of the PR. For information on cleaning up the commits in your pull request, see this page.
  • If applicable, the PR references the bug/issue that it fixes in the description.
  • New Unit tests were added for the changes made and CI is passing.

Quality of Code and Contribution Guidelines

@@ -290,7 +290,12 @@ def run(self):
'mypy',
'pytest',
'requests==2.*',
'coverage'
'coverage',
'pytest-sugar',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious, I don't see these packages are used anywhere in the code, are they pytest extensions and will be executed automatically?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pytest-sugar -> If you run pytest locally, this helps to present the tests better

pytest-cov -> This changes the "coverage" to use pytest-coverage - better in tracking coverages. The pipeline scripts have been updated to use this. Eg:

pytest  --instafail --cov=./azure_functions_worker --cov-report xml --cov-branch --cov-append tests/endtoend

pytest-xdist -> This can run the tests parallel, but the catch currently is that the tests rely on things from other tests (or depend on things which others are also changing at the same time, we need to improve it)

pytest-randomly -> This runs the tests randomly - exposes the ordering issues in tests, if any.

pytest-instafail -> shows failures and errors instantly instead of waiting until the end of test session, good for running when trying locally.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pytest-sugar's output.

image

include:
- dev
- master
- release/*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this change will make us running the release/* branch everynight. Do you suggest moving the previous releases into releases/ancient/* branches now?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I set up the branch patterns using the best practices as recommended by AzDevops. We can change the daily runs to not target release branches.

@vrdmr vrdmr merged commit b7bcd98 into dev Jun 29, 2020
@vrdmr vrdmr deleted the vameru/add-typing-info-to-methods branch June 29, 2020 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Improvement] Adding types to function/method parameters to help with static analysis
2 participants