Skip to content

Commit

Permalink
Add support for filter callback
Browse files Browse the repository at this point in the history
  • Loading branch information
davidanthoff committed Apr 1, 2023
1 parent 98be1ae commit 54d3970
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Runs test items. This will re-use client processes from a previous call to `run_

Args:
- `path`: Filesystem path to a folder.
- `filter`: Not implemented right now.
- `filter`: A filter callback function that will be called for each identified test item. If the filter callback returns `true` that test item will be run, if `false` it will not run. Each call to the provided filter callback passes a named tuple argument with a number of fields that contain metadata about the specific test item. The provided information is `filename`, `name`, `tags` and `package_name`.
- `verbose` Not implemented right now.
- `max_workers`: Max number of child processes per identified project.
- `timeout`: Timeout in seconds.
Expand Down
8 changes: 4 additions & 4 deletions src/TestItemRunner2.jl
Original file line number Diff line number Diff line change
Expand Up @@ -251,10 +251,10 @@ function run_tests(path; filter=nothing, verbose=false, max_workers::Int=Sys.CPU
# Flat list of @testitems
testitems = [(detail=i, code=get_text(jw._text_documents[i.uri])[i.code_range]) for i in Iterators.flatten(values(jw._testitems))]

# # Filter @testitems
# if filter !== nothing
# filter!(i->filter((filename=uri2filepath(i.detail.uri), name=i.detail.name, tags=i.detail.option_tags)), testitems)
# end
# Filter @testitems
if filter !== nothing
filter!(i->filter((filename=uri2filepath(i.detail.uri), name=i.detail.name, tags=i.detail.option_tags, package_name=i.detail.package_name)), testitems)
end

executed_testitems = []

Expand Down

0 comments on commit 54d3970

Please sign in to comment.