Skip to content

feat: add dangling test files check #62

@vladopajic

Description

@vladopajic

the why developers run tests is that all test files are usually included in final top lvl file. compiling and running this file will runs all tests in project.

now what often happens is that developers forget to include test file in top lvl file. it can happen when developers are adding new features (vacp2p/nim-libp2p#1825), or even refactoring (reorganizing) test files.

it would be possible to create some utility that would be run in top lvl file, some function checkDanglingTest that would if there are dangling files. this would prevent this from happening.

checkDanglingTest pseudocode:

  • list all test files in current dir and sub dirs (test files have match some regexp, eg test file has name test**.nim
    • user can provide path to root dir, and regexp that matches files
  • list all test files that are included in this file
    • function should collect all files listed in import ..., also fetching all imports of those imports
  • finally if there is difference between these two lists, show output
    • user may configure with argument --fail-on-dangling if check should abort text execution (or just do it by default always)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions