Skip to content

Organization of some lib/scripts #239

Open
@nkakouros

Description

@nkakouros

Due diligence

Description

I am not sure I understand correctly the organization of the library files, but I thought I would ask anyway.

Under lib/ there is the bats-main script. This is the entry point to ./go test.
Then, almost each test file loads the tests/environment.bash file.
This, then, loads the "main" environment file lib/testing/environment plus the assertions library lib/bats/assertions.

If I understand the naming correctly, lib/bats/ is for libraries adding functionality that Bats is missing (more or less). So, we have the assertions library and background-process there. Then, lib/testing/ is for files that the test files will load on-demand if they need some special functionality to drive the application, eg the lib/testing/stack-trace file.

If the above are correct, here are my questions:

  1. Shouldn't lib/bats/assertion-test-helpers be under lib/testing as it contains special functions to test a part of the application?
  2. Shouldn't lib/bats/helpers, lib/bats/helper-function, lib/testing/environment be under a separate 3rd folder named perhaps lib/test-helpers or lib/testing-common or lib/testing/common? My thinking is that what these 3 files have in common (and what distinguishes them among the rest) is that they provide functions to write richer test functions.

This is not a functionally important issue but re-organizing might help a new contributor understand more easily what is going on and what each file is supposed to do. At least so it seems to me after spending ~1 hour trying to find where functions came from and the hierarchy of sourced files.

What do you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions