Skip to content

Conversation

@BenjamenMeyer
Copy link
Member

@BenjamenMeyer BenjamenMeyer commented Apr 17, 2018

Working through the unit testing to improve test coverage

  • 100% coverage on the following modules: stackinabox.stack, stackinabox.services.service, stackinabox.util.*
  • Refactor of the stackinabox.util.* modules for better testability
  • Bug Fix in the stackinabox.util.request_mock support (local_session vs local_sessions)
  • Refactor of stackinabox.services:
    • StackInABoxRouter is now its own module
    • StackInABox specific Exceptions are now their own module

Note: This converts some functionality that was indirectly tested to being directly tested. Direct tests are far better and help make the code coverage metric more meaningful. However, code coverage tooling doesn't have a good way to validate direct test coverage.

Working towards closing Issue #71

- Enhancement: update coverage report - branch coverage, precision,
  and show missing coverage lines
- Enhancement: Update testing on `stackinabox.stack` for full
  explicit testing without using the global instance for all tests
- Refactor: Move the Stack-In-A-Box exceptions to their own module
  these are all internal so should not affect users
- Refactor: Move the Stack-In-A-Box router to its own module,
  this is internal so should not affect users
- Bug Fix: add the `about` page to the toctree for the docs
- Bug Fix: pycodestyle fixes
- Enhancement: 93% coverage requirement
- Enhancement: Promote the `process_service` functionality to a
  class method so it can be properly tested
- Refactor: Move the `RequestMockCallable` to its own module within
  the requests-mock support to help clarify testing
- Bug Fix: requests-mock support had a bad variable name in the
  session support.
- Enhancement: Added more unit tests, catching several latent bugs
- Enhancement: Complete testing of the StackInABoxService
- Enhancement: 95% test coverage
- Bug Fix: RequestMockCallable moved to a sub-module in a refactor
- Refactor: HelloService is just an example; it doesn't need to be
  part of stackinabox proper. Moved it over to the test suite.
Refactor: setup each module layer with its own TestCase and base
  interface so each can be more specialized.
- Enhancement: Use a specific Exception instead of using a straight
  assert that causes a general AssertionError use a specific
  Exception class for when the router detects a circular reference
  being made in the routes.
- Enhancement: full test coverage of the StackInABoxRouter
- updated dependencies
- fixed some code style issues
- fixed an issue where the log message reported a pattern object
  instead of the pattern being looked at, making it hard to debug
- added a test of the request-mock callable; one of the tests
  presently fails (marked as an expected failure) for an unknown
  reason.
def test_handler_other_body(self, mock_call_into):
# For some reason the returned response isn't providing
# the expected body. For now, marking as an expected
# failure but this needs to be fixed.
Copy link
Member Author

Choose a reason for hiding this comment

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

Reading through this PR, this bug was there prior just not being tested. This reveals an issue as it introduced a unit test that exposed it. Not sure where it is but allowing through for now. We'll need to address it.

@BenjamenMeyer
Copy link
Member Author

Note: 2 of the builds failed (pypy, py35); this is acceptable for now as this is one of the last on travis-ci and those builds will be going away with the new CI environment any way.

@BenjamenMeyer BenjamenMeyer merged commit 005a3e3 into TestInABox:master Jan 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant