#99 Add several improvements to kiskadee
Merged by davidcarlos. Opened by davidcarlos.
improvements  into  master

Download 99.patch

From MES experience, I had notice some complaints from students to contribute to kiskadee code, and was really difficult to do that, because the main methods from monitor and runner were to coupled and bit coesive. Testing was another problem, because we had a lot of interdependence between then, and was not possible to run a specific test suite ( units, functional, integration). We were only able to run the entirely suite, or a single test. This MR propose to solve this problems implementing the following changes:

  • Refactor Monitor and Runner classes following a simple rule: Each method must have only one responsibility.
  • Refactor Monitor and Runner classes following a simple rule: Each method must have at most four arguments.
    • I took this rules from this talk: https://www.youtube.com/watch?v=npOGOmkxuio, and I think we should use it to all future features that we will add to kiskadee.
  • All code that interacts with database was moved to the model.py module.
  • Creates test suites to different test levels. Now we have unit, functional, plugins and integration tests. We can run each one using make command.
    • Mock all database calls on integration tests. Here I say why: http://davidcarlos.me/magickmock-and-unittest.html
  • Rename Package model to Project. We do not always analyze packages, but we always analyze projects.
  • Remove from Monitor the responsibility to start Runner and it self. Now we do that on initializer module.

17 new commits added

  • Update documentation.
  • Rename Package model to Project.
  • Fix logging messages.
  • Add initializer module.
  • Fix Jenkinsfile
  • Fix remaining tests.
  • reimplement runner integration tests
  • WIP: Refactoring runner code.
  • Make Monitor code more readable and maintainable.
  • Move code from monitor to model class.
  • Minor fixes to run ansible deploy.
  • Add make rules to run tests.
  • Group tests into subpackages.
  • Use mock to run api tests.
  • Refactors queue.py module.
  • Use a migration to create kiskadee fetchers.
  • Group tests into subpackages.

1 new commit added

  • Revert "Rename Package model to Project."

rebased onto afb3c06c5173fad38e2783d47f6a926f14ca013a

Pull-Request has been merged by davidcarlos

Metadata