Giter Site home page Giter Site logo

khronos's Introduction

Khronos Downloads

Are your org hotfixes truly considered "hotfixes" if they take longer than 15 minutes to go live because of slow tests workflows running on GitHub Actions? To speed up this imagine benchmarking test durations to identify the slow tests when the total number of tests > 500, it seems impractical to run each test individually and manually record their duration times.

Khronos is a Python library that benchmarks the duration of Django tests. It helps identify slow-running tests in your test suite, allowing you to optimize their performance.

Feautres:

1) Benchmark Report: Create benchmark report in the terminal whenever you run your django tests and shows top 10(this no. can be configured) slowest tests.

2) Parallel Test Execution: Works with --parallel out of the box.

3) Google Sheets Integration: Whole tests benchmark can be automatically uploaded to Google Sheets.

4) CSV Export: Whole tests benchmark can be saved in a CSV.

How to configure:

  1. pip install django-khronos or build it locally python -m build and install in your virtual env.
  2. Add TEST_RUNNER = "khronos.custom_test_runner.KhronosTestRunner" in your settings.py
  3. If you want to increase the number of slowest tests displayed on terminal then set KHRONOS_REPORT_MAX_ROW= in your settings.py.
  4. If you want to add Google Sheets integration, add: KHRONOS_SPRAEDSHEET_REPORT_GSHEET_ID = "your-google-sheet-id" and your KHRONOS_GSHEET_CREDS_FILE_PATH = "your-gsheet-cred-path" in your settings.py` .
  5. For saving the khronos benchmark report.

Tested on Django 3.2.14. Open an issue if it's not supported in your's django version

Contributors ✨

Thanks go to these wonderful people

abhinavsp0730
Abhinav Prakash
Paul-Annay
Annay Paul

khronos's People

Contributors

abhinavsp0730 avatar github-actions[bot] avatar paul-annay avatar

Stargazers

Abhinav Prakash avatar  avatar aayush gupta  avatar Nikhil Laxminarayana avatar Akshita Dixit avatar Shubham Vitthal Khandare avatar Ajay R avatar deep_sea avatar

Watchers

 avatar  avatar

khronos's Issues

Write Sanity Test.

Write basic tests that blip works in Django 3 and 4. Also, write tests that will ensure it'll work with --parallel flag.

  1. Basic Test:
    a) Create two folder Django-3 and Django-4 .
    b) create a requirements.txt and add django 3 and django 4 version and add latest django khronos version(I'll add replace to github repo branch, if you can do it than it's good)
    b) In those folders create a django project.
    c) In settings.py add khronos.
    d) create tests folder inside these two folder.
    Now create two test files compatibility_test_1.py and compatibility_test_2.py. And add test
class CompatibilityTest(TestCase):
    def compatibiality_test:
          ...

After this I'll setup the github action.
There will be two steps
Sanity Test Django 3 / 4 (Creates the venv install django 3/4 and khronos).

The objective is that simply merging a PR will not break due to syntax error etc.

Feel free to ask if you need some more info.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.