diff --git a/.github/workflows/test-broken.yml b/.github/workflows/test-broken.yml new file mode 100644 index 0000000..6df87b0 --- /dev/null +++ b/.github/workflows/test-broken.yml @@ -0,0 +1,35 @@ +name: Run broken tests + +on: + push: + branches: + - master + tags: '*' + pull_request: + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + julia-version: ['nightly'] + fail-fast: false + name: Broken test Julia ${{ matrix.julia-version }} + steps: + - uses: actions/checkout@v2 + - name: Setup julia + uses: julia-actions/setup-julia@v1 + with: + version: ${{ matrix.julia-version }} + # Use `JULIA_PKG_SERVER` mitigation implemented in julia-buildpkg: + - uses: julia-actions/julia-buildpkg@v1 + + # Maybe some useful information: + - run: julia -e 'using InteractiveUtils; versioninfo()' + - run: lscpu + + - uses: julia-actions/julia-runtest@v1 + id: test + env: + CI: "false" + continue-on-error: true diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..1229aff --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,32 @@ +name: Run tests + +on: + push: + branches: + - master + tags: '*' + pull_request: + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + julia-version: ['1.6', 'nightly'] + fail-fast: false + name: Test Julia ${{ matrix.julia-version }} + steps: + - uses: actions/checkout@v2 + - name: Setup julia + uses: julia-actions/setup-julia@v1 + with: + version: ${{ matrix.julia-version }} + # Use `JULIA_PKG_SERVER` mitigation implemented in julia-buildpkg: + - uses: julia-actions/julia-buildpkg@v1 + - uses: julia-actions/julia-runtest@v1 + - uses: julia-actions/julia-processcoverage@v1 + - uses: codecov/codecov-action@v1 + with: + file: ./lcov.info + flags: unittests + name: codecov-umbrella diff --git a/Project.toml b/Project.toml index 09d9f4a..d37bab0 100644 --- a/Project.toml +++ b/Project.toml @@ -4,10 +4,4 @@ authors = ["Takafumi Arakaki and contributors"] version = "0.1.0" [compat] -julia = "1" - -[extras] -Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" - -[targets] -test = ["Test"] +julia = "1.6" diff --git a/test/Project.toml b/test/Project.toml new file mode 100644 index 0000000..85c929d --- /dev/null +++ b/test/Project.toml @@ -0,0 +1,4 @@ +[deps] +BangBang = "198e06fe-97b7-11e9-32a5-e1d131e6ad66" +BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf" +Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" diff --git a/test/load.jl b/test/load.jl new file mode 100644 index 0000000..e97d4fa --- /dev/null +++ b/test/load.jl @@ -0,0 +1,11 @@ +try + using ConcurrentCollectionsBenchmarks + true +catch + false +end || begin + let path = joinpath(@__DIR__, "../benchmark/ConcurrentCollectionsBenchmarks/Project.toml") + path in LOAD_PATH || push!(LOAD_PATH, path) + end + using ConcurrentCollectionsBenchmarks +end diff --git a/test/runtests.jl b/test/runtests.jl index d7ce2e4..3fcfe0b 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,6 +1,8 @@ module TestConcurrentCollections using Test +include("load.jl") + @testset "$file" for file in sort([ file for file in readdir(@__DIR__) if match(r"^test_.*\.jl$", file) !== nothing ]) diff --git a/test/test_dict.jl b/test/test_dict.jl index b621202..797779e 100644 --- a/test/test_dict.jl +++ b/test/test_dict.jl @@ -4,6 +4,8 @@ using ConcurrentCollections using ConcurrentCollections.Implementations: clusters using Test +const IS_CI = lowercase(get(ENV, "CI", "false")) == "true" + @testset for npairs in [2, 100] @testset for Key in [Int8, Int32, Int64], Value in [Int] d = ConcurrentDict{Key,Value}() @@ -50,7 +52,11 @@ using Test end @testset "clusters" begin - @test length(clusters(d)::Vector{UnitRange{Int}}) > 0 + if VERSION >= v"1.7-" && IS_CI + @info "skipping `clusters` (known bug)" + else + @test length(clusters(d)::Vector{UnitRange{Int}}) > 0 + end end end @@ -78,7 +84,11 @@ using Test @test "001" ∉ sort!(collect(keys(d))) end @testset "clusters" begin - @test length(clusters(d)::Vector{UnitRange{Int}}) > 0 + if VERSION >= v"1.7-" && IS_CI + @info "skipping `clusters` (known bug)" + else + @test length(clusters(d)::Vector{UnitRange{Int}}) > 0 + end end end end