Skip to content

selectors for tests #28

Description

@nha

From lein help test:

Run the project's tests.

Marking deftest or ns forms with metadata allows you to pick selectors to
specify a subset of your test suite to run:

   (deftest ^:integration network-heavy-test
     (is (= [1 2 3] (:numbers (network-operation)))))

Write the selectors in project.clj:

   :test-selectors {:default (complement :integration)
                    :integration :integration}

Arguments to this task will be considered test selectors if they are keywords,
otherwise arguments must be test namespaces or files to run. With no
arguments the :default test selector is used if present, otherwise all
tests are run. Test selector arguments must come after the list of namespaces.

A default :only test-selector is available to run select tests. For example,
`lein test :only leiningen.test.test/test-default-selector` only runs the
specified test. A default :all test-selector is available to run all tests.

Arguments: ([& tests])

It would be nice to have a :test-selector parameter in boot test as well (it allows filtering namespaces at the moment, but not individual tests as far as I know).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions