enso
enso copied to clipboard
Enso tests can be run with filter from cmdline
Closes #8998
Pull Request Description
Simplify the Test.Suite.run_with_filter
to accept a single filter parameter that searches for all the groups and specs that matches that filter. This filter can be a simple text provided from the command line.
Important notes
- Pending groups are now printed at the end of the run
-
Test.Suite.run_with_filter
is simplified to accept a single filter parameter that is eitherText
orNothing
. See the docs.- Passing a filter from the command line is therefore straightforward, it is treated as a regex.
- For convenience, I have left all the
main
methods in all the test sources. I have just refactored them to accept thefilter
argument from the command line.- For example, to run only a single spec from
Vector_Spec.enso
, invokeenso --run test/Base_Tests/src/Data/Vector_Spec.enso "should allow vector creation with a programmatic constructor"
- For example, to run only a single spec from
-
Majority of the PR is a regex replace of
^main =
formain filter=Nothing =
and ofsuite.run_with_filter
forsuite.run_with_filter filter
.
Example usage
$ enso --run test/Base_Tests "should have properly defined length"
List: [1/1, 27ms]
- should have properly defined length [27ms]
1 tests succeeded.
0 tests failed.
0 tests skipped.
0 groups skipped.
$ enso --run test/Base_Tests "List"
List: [31/31, 1002ms]
- should have properly defined length [25ms]
- should have well defined length when empty [0ms]
- should allow folding the list with an arbitrary operation with .fold [1ms]
- should allow reducing the list with an arbitrary operation with .reduce [15ms]
- should allow checking if an element satisfies a predicate with .any [52ms]
- should allow checking if all elements satisfy a predicate with `.all` [16ms]
- should allow checking if an element is in the list with `.contains` [3ms]
- should allow finding an element in the list with `.find` [49ms]
- should allow finding the index of an element in the list with `.index_of` [50ms]
- should allow finding the last index of an element in the list with `.last_index_of` [66ms]
- should allow checking if the list is empty with `.is_empty` [1ms]
- should allow checking if the list is not empty `.not_empty` [1ms]
- should be convertible to a vector [16ms]
- should allow filtering of the list using `.filter` [11ms]
- should filter elements by Filter_Condition [603ms]
- should allow to partition a list [27ms]
- should allow mapping a function over its elements with .map [3ms]
- should allow executing an action for each element with .each [6ms]
- should allow reversing with .reverse [0ms]
- should allow dropping elements from the left with `.drop` [2ms]
- should allow taking elements from the left with `.take_start` [3ms]
- should allow getting the tail of the list with `.tail` [3ms]
- single element list.init yields Nil [1ms]
- two element list.init yields one element [2ms]
- should allow getting the init of the list with `.init` [3ms]
- should allow getting the last element of the list with `.last` [3ms]
- should allow getting the head of the list with `.first` [3ms]
- should allow getting the second item of the list with `.second` [6ms]
- should allow getting the last element of the list with `.last` [4ms]
- should allow getting the items of the list with `.at` [9ms]
- should allow getting the items of the list with `.get` [2ms]
31 tests succeeded.
0 tests failed.
0 tests skipped.
0 groups skipped.
$ enso --run test/Base_Tests/src/Data/Vector_Spec.enso XX
Use a slice of an array as vectors: [1/1, 56ms]
- XXshould allow vector creation with a constant constructor [56ms]
Use Array_Proxy as vectors: [1/1, 4ms]
- XXshould allow vector creation with a constant constructor [4ms]
Use Vector as vectors: [1/1, 2ms]
- XXshould allow vector creation with a constant constructor [2ms]
Use Array as vectors: [1/1, 2ms]
- XXshould allow vector creation with a constant constructor [2ms]
Use Java ArrayList as vectors: [1/1, 2ms]
- XXshould allow vector creation with a constant constructor [2ms]
5 tests succeeded.
0 tests failed.
0 tests skipped.
0 groups skipped.
Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
- [X] The documentation has been updated, if necessary.
- [X] Screenshots/screencasts have been attached, if there are any visual changes. For interactive or animated visual changes, a screencast is preferred.
- [X] All code follows the Scala, Java, and Rust style guides. In case you are using a language not listed above, follow the Rust style guide.
- All code has been tested:
- [X] Unit tests have been written where possible.
- [X] If GUI codebase was changed, the GUI was tested when built using
./run ide build
.