Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
N neoppod
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1
    • Issues 1
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge requests 2
    • Merge requests 2
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value Stream
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • nexedi
  • neoppod
  • Merge requests
  • !5

Merged
Created Dec 01, 2016 by Julien Muchembled@jmOwner

Remove some useless unit tests

  • Overview 0
  • Commits 1
  • Changes 18

Many "unit" tests (!= "threaded" tests) don't do more than checking implementation details, and increase coverage artificially. As with testEvent in commit 71e30fb9, most of these tests will either be removed or rewritten as threaded tests.

The fact that the remaining unit tests actually cover code that other test don't gives motivation to maintain them. It will be also less code to update when switching to https://pypi.python.org/pypi/mock

I proceeded as follows:

  1. Measure coverage for all tests except unit tests. While checking my work, I found that coverage stats for threaded/functional/zodb tests are quite unstable, so I restarted from the beginning by doing this measure several times and only keeping the intersection of coverage data.

  2. Measure coverage individually for each 'unit' tests, and substract the each result with the data in 1.

  3. The candidates for deletion are those without any code covered.

Tests I didn't delete:

  • neo.tests.master.testElectionHandler: I always do minimal changes about election, as long as there's no serious review.

  • neo.tests.master.testMasterPT.MasterPartitionTableTests.test_13_outdate

  • 4 tests in neo.tests.testPT: test_01_Cell, test_04_removeCell, test_06_clear, test_08_filled

  • neo.tests.storage.testStorage{MySQL,SQLite}

  • neo.tests.testUtil.UtilTests.testReadBufferRead

In a way, this commit is actually quite conservative. There are still many useless tests that only check error paths and for simple tested methods, this is just duplicating thie tested code.

Assignee
Assign to
Reviewer
Request review from
None
Milestone
None
Assign milestone
Time tracking
Source branch: drop-useless-unit-tests
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7