Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: JuliaTesting/ReTestItems.jl
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.20.0
Choose a base ref
...
head repository: JuliaTesting/ReTestItems.jl
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.20.1
Choose a head ref
  • 5 commits
  • 5 files changed
  • 1 contributor

Commits on Nov 17, 2023

  1. Copy the full SHA
    208ede2 View commit details
  2. Copy the full SHA
    3400aae View commit details
  3. Copy the full SHA
    7bdf3bb View commit details

Commits on Dec 4, 2023

  1. Copy the full SHA
    e542f94 View commit details

Commits on Dec 6, 2023

  1. Bump version (#128)

    * Bump version
    
    * Add stdlib compat
    nickrobinson251 authored Dec 6, 2023
    2

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    3c10e73 View commit details
Showing with 15 additions and 7 deletions.
  1. +1 −0 .github/workflows/CI.yml
  2. +8 −1 Project.toml
  3. +4 −3 README.md
  4. +2 −1 src/ReTestItems.jl
  5. +0 −2 src/testcontext.jl
1 change: 1 addition & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -19,6 +19,7 @@ jobs:
version:
- '1.8'
- '1.9'
- '1.10-nightly'
os:
- ubuntu-latest
- macOS-latest
9 changes: 8 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "ReTestItems"
uuid = "817f1d60-ba6b-4fd5-9520-3cf149f6a823"
version = "1.20.0"
version = "1.20.1"

[deps]
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
@@ -13,7 +13,14 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
TestEnv = "1e6cf692-eddd-4d53-88a5-2d735e33781b"

[compat]
Dates = "1"
Logging = "1"
LoggingExtras = "1"
Pkg = "1"
Random = "1"
Serialization = "1"
Sockets = "1"
Test = "1"
TestEnv = "1.8"
julia = "1.8"

7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -38,7 +38,8 @@ julia> runtests("test/arithmetic_tests.jl"; nworkers=2)

## Running tests

You can run tests using the `runtests` function, which will run all tests for the current active project.
You can run tests using the [`runtests`](https://docs.juliahub.com/General/ReTestItems/stable/autodocs/#ReTestItems.runtests) function,
which will run all tests for the current active project.

```julia
julia> using ReTestItems
@@ -79,7 +80,7 @@ julia> runtests("test/Database/"; logs=:issues)

## Writing tests

Tests must be wrapped in a `@testitem`.
Tests must be wrapped in a [`@testitem`](https://docs.juliahub.com/General/ReTestItems/stable/autodocs/#ReTestItems.@testitem-Tuple{Any,%20Vararg{Any}}).
In most cases, a `@testitem` can just be used instead of a `@testset`, wrapping together a bunch of related tests:
```julia
@testitem "min/max" begin
@@ -109,7 +110,7 @@ Since a `@testitem` is the block of code that will be executed, `@testitem`s can

#### Test setup

If some test-specific code needs to be shared by multiple `@testitem`s, this code can be placed in a `module` and marked as `@testsetup`,
If some test-specific code needs to be shared by multiple `@testitem`s, this code can be placed in a `module` and marked as [`@testsetup`](https://docs.juliahub.com/General/ReTestItems/stable/autodocs/#ReTestItems.@testsetup-Tuple{Any})
and the `@testitem`s can depend on it via the `setup` keyword.

```julia
3 changes: 2 additions & 1 deletion src/ReTestItems.jl
Original file line number Diff line number Diff line change
@@ -391,7 +391,8 @@ function start_worker(proj_name, nworker_threads, worker_init_expr, ntestitems;
Test.TESTSET_PRINT_ENABLE[] = false
const GLOBAL_TEST_CONTEXT = ReTestItems.TestContext($proj_name, $ntestitems)
GLOBAL_TEST_CONTEXT.setups_evaled = ReTestItems.TestSetupModules()
@info "Starting test worker$($i) on pid = $(Libc.getpid()), with $(Threads.nthreads()) threads"
nthreads_str = $nworker_threads
@info "Starting test worker$($i) on pid = $(Libc.getpid()), with $nthreads_str threads"
$(worker_init_expr.args...)
nothing
end)
2 changes: 0 additions & 2 deletions src/testcontext.jl
Original file line number Diff line number Diff line change
@@ -57,8 +57,6 @@ end

Base.push!(f::FileNode, ti::TestItem) = push!(f.testitems, ti)

duration(ts::DefaultTestSet) = ts.time_end - ts.time_start

walk(f, fn::FileNode) = foreach(f, fn.testitems)

struct DirNode