forked from amperity/greenlight
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resolves amperity#52. This is a first pass for this feature so design input is requested. Initial decisions: - Use `use-fixtures` from `clojure.test` for fixture functions that apply to all of the tests in a namespace. Note that this does not support `:once` fixtures as of yet because the runner does not run all tests in a namespace as a group that can be `:once`d. This will require a change to `greenlight.runner`. - Add `::test/each` as an option to the `deftest` attribute map. This needs to be a collection of fixture functions. This could not quite be expressed via the `use-fixtures` method because it would unilaterally apply a fixture function to all steps in all tests in a namespace. This could be an additional feature as well. Open questions: - Are functions expressive enough, or should this introduce a new namespace that allows for composable definitions of fixtures in the way that steps are composable? Something like `deffixture`, a greenlight-specific `use-fixture` for top-level, and then fixture configuration at the test/step level. - Should context be passed into the fixture functions, and should it be modifiable by the fixture functions? e.g., should downstream steps see the changed context and should the test output contain that changed context. This gets a bit sticky and pushes on the `deffixture` idea, in that greenlight tries to be explicit about its data dependencies and outputs, but with fixtures that can take/update context, declaring data dependencies gets a bit hairier. I can imagine that `deffixture` would _also_ declare inputs and outputs, which could then get merged into the step inputs/outputs. Depends on how complex this needs to be.
- Loading branch information
1 parent
783e6fe
commit 92dc6ac
Showing
3 changed files
with
73 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters