From 2afeab8ce1e71eebab8c9bd862bed40c46eb6fd6 Mon Sep 17 00:00:00 2001 From: Takafumi Arakaki Date: Sun, 9 May 2021 21:03:03 -0400 Subject: [PATCH 01/15] Setup CI --- .github/workflows/test.yml | 32 ++++++++++++++++++++++++++++++++ Project.toml | 8 +------- test/Project.toml | 4 ++++ test/load.jl | 11 +++++++++++ test/runtests.jl | 2 ++ 5 files changed, 50 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/test.yml create mode 100644 test/Project.toml create mode 100644 test/load.jl 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 ]) From 157e65630960ca8d3dd4bcd04ebd1e290ed82880 Mon Sep 17 00:00:00 2001 From: Takafumi Arakaki Date: Sun, 9 May 2021 21:39:52 -0400 Subject: [PATCH 02/15] Skip clusters test with Julia 1.7 in CI --- test/test_dict.jl | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/test/test_dict.jl b/test/test_dict.jl index b621202..be0422d 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,9 @@ using Test end @testset "clusters" begin - @test length(clusters(d)::Vector{UnitRange{Int}}) > 0 + if VERSION < v"1.7-" && IS_CI + @test length(clusters(d)::Vector{UnitRange{Int}}) > 0 + end end end @@ -78,7 +82,9 @@ 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 + @test length(clusters(d)::Vector{UnitRange{Int}}) > 0 + end end end end From ae141453fe634ac9237852e09cf9115b775050c1 Mon Sep 17 00:00:00 2001 From: Takafumi Arakaki Date: Sun, 9 May 2021 21:52:34 -0400 Subject: [PATCH 03/15] Run broken tests --- .github/workflows/test-broken.yml | 41 +++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/test-broken.yml diff --git a/.github/workflows/test-broken.yml b/.github/workflows/test-broken.yml new file mode 100644 index 0000000..a337b2f --- /dev/null +++ b/.github/workflows/test-broken.yml @@ -0,0 +1,41 @@ +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: 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 + + - run: | + using Pkg + try + Pkg.test() + catch + exit(0) + end + error("Unexpected pass") + shell: julia --project {0} + env: + CI: "true" From d7ee16cc0fd168ccd92d0acf1e7ed9f61947eb97 Mon Sep 17 00:00:00 2001 From: Takafumi Arakaki Date: Sun, 9 May 2021 22:02:24 -0400 Subject: [PATCH 04/15] Fix how tests are skipped --- test/test_dict.jl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/test_dict.jl b/test/test_dict.jl index be0422d..797779e 100644 --- a/test/test_dict.jl +++ b/test/test_dict.jl @@ -52,7 +52,9 @@ const IS_CI = lowercase(get(ENV, "CI", "false")) == "true" end @testset "clusters" begin - if VERSION < v"1.7-" && IS_CI + if VERSION >= v"1.7-" && IS_CI + @info "skipping `clusters` (known bug)" + else @test length(clusters(d)::Vector{UnitRange{Int}}) > 0 end end @@ -82,7 +84,9 @@ const IS_CI = lowercase(get(ENV, "CI", "false")) == "true" @test "001" ∉ sort!(collect(keys(d))) end @testset "clusters" begin - if VERSION < v"1.7-" && IS_CI + if VERSION >= v"1.7-" && IS_CI + @info "skipping `clusters` (known bug)" + else @test length(clusters(d)::Vector{UnitRange{Int}}) > 0 end end From bf8030b1e4c6b5c1f833de1a5460e64ba775363c Mon Sep 17 00:00:00 2001 From: Takafumi Arakaki Date: Sun, 9 May 2021 22:10:37 -0400 Subject: [PATCH 05/15] Tweak CI name --- .github/workflows/test-broken.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-broken.yml b/.github/workflows/test-broken.yml index a337b2f..49ca08d 100644 --- a/.github/workflows/test-broken.yml +++ b/.github/workflows/test-broken.yml @@ -14,7 +14,7 @@ jobs: matrix: julia-version: ['nightly'] fail-fast: false - name: Test Julia ${{ matrix.julia-version }} + name: Broken test Julia ${{ matrix.julia-version }} steps: - uses: actions/checkout@v2 - name: Setup julia From 4bd8ecc8f45ca7a70148778a2edc562bf4c2d8dd Mon Sep 17 00:00:00 2001 From: Takafumi Arakaki Date: Sun, 9 May 2021 22:05:50 -0400 Subject: [PATCH 06/15] Trying to make test-broken.yml work --- .github/workflows/test-broken.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-broken.yml b/.github/workflows/test-broken.yml index 49ca08d..a29f389 100644 --- a/.github/workflows/test-broken.yml +++ b/.github/workflows/test-broken.yml @@ -38,4 +38,4 @@ jobs: error("Unexpected pass") shell: julia --project {0} env: - CI: "true" + CI: "false" From 7b1c7a2c31aa733b709736c8389880d63acd0d11 Mon Sep 17 00:00:00 2001 From: Takafumi Arakaki Date: Sun, 9 May 2021 22:23:01 -0400 Subject: [PATCH 07/15] Use julia-runtest --- .github/workflows/test-broken.yml | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/.github/workflows/test-broken.yml b/.github/workflows/test-broken.yml index a29f389..8a5e00d 100644 --- a/.github/workflows/test-broken.yml +++ b/.github/workflows/test-broken.yml @@ -28,14 +28,6 @@ jobs: - run: julia -e 'using InteractiveUtils; versioninfo()' - run: lscpu - - run: | - using Pkg - try - Pkg.test() - catch - exit(0) - end - error("Unexpected pass") - shell: julia --project {0} + - uses: julia-actions/julia-runtest@v1 env: CI: "false" From a9ecb573bc8b90c1eb75c9804749898d11814fbf Mon Sep 17 00:00:00 2001 From: Takafumi Arakaki Date: Sun, 9 May 2021 22:34:09 -0400 Subject: [PATCH 08/15] Use steps.*.outcome --- .github/workflows/test-broken.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/test-broken.yml b/.github/workflows/test-broken.yml index 8a5e00d..649be43 100644 --- a/.github/workflows/test-broken.yml +++ b/.github/workflows/test-broken.yml @@ -29,5 +29,14 @@ jobs: - run: lscpu - uses: julia-actions/julia-runtest@v1 + id: test env: CI: "false" + continue-on-error: true + + - name: "Expected failure" + run: "true" + if: ${{ steps.test.outcome == 'failure' }} + - name: "Unexpected pass" + run: "false" + if: ${{ steps.test.outcome != 'failure' }} From 5aec6826d7aca079a2302b3be1cadea1fea546b0 Mon Sep 17 00:00:00 2001 From: Takafumi Arakaki Date: Sun, 9 May 2021 22:38:05 -0400 Subject: [PATCH 09/15] Ignore unexpected pass --- .github/workflows/test-broken.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/test-broken.yml b/.github/workflows/test-broken.yml index 649be43..6df87b0 100644 --- a/.github/workflows/test-broken.yml +++ b/.github/workflows/test-broken.yml @@ -33,10 +33,3 @@ jobs: env: CI: "false" continue-on-error: true - - - name: "Expected failure" - run: "true" - if: ${{ steps.test.outcome == 'failure' }} - - name: "Unexpected pass" - run: "false" - if: ${{ steps.test.outcome != 'failure' }} From 90da12b15c53c5f77c9544f45e5c4695e8c77fee Mon Sep 17 00:00:00 2001 From: Takafumi Arakaki Date: Sun, 9 May 2021 22:38:46 -0400 Subject: [PATCH 10/15] Revert "Ignore unexpected pass" This reverts commit 5aec6826d7aca079a2302b3be1cadea1fea546b0. --- .github/workflows/test-broken.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/test-broken.yml b/.github/workflows/test-broken.yml index 6df87b0..649be43 100644 --- a/.github/workflows/test-broken.yml +++ b/.github/workflows/test-broken.yml @@ -33,3 +33,10 @@ jobs: env: CI: "false" continue-on-error: true + + - name: "Expected failure" + run: "true" + if: ${{ steps.test.outcome == 'failure' }} + - name: "Unexpected pass" + run: "false" + if: ${{ steps.test.outcome != 'failure' }} From 17665a7db0c02e2d2057114aca428dc5f728d1d0 Mon Sep 17 00:00:00 2001 From: Takafumi Arakaki Date: Sun, 9 May 2021 22:43:31 -0400 Subject: [PATCH 11/15] (rerun) From ab14099a881fc6867831cf8b10edf9dda321be93 Mon Sep 17 00:00:00 2001 From: Takafumi Arakaki Date: Sun, 9 May 2021 22:44:02 -0400 Subject: [PATCH 12/15] (rerun) From 26fe05c602926ada55908971646a310aaa386222 Mon Sep 17 00:00:00 2001 From: Takafumi Arakaki Date: Sun, 9 May 2021 22:44:10 -0400 Subject: [PATCH 13/15] (rerun) From e128a64eb0d8a7d7a15d99c620adbe77b4c2e494 Mon Sep 17 00:00:00 2001 From: Takafumi Arakaki Date: Sun, 9 May 2021 22:44:26 -0400 Subject: [PATCH 14/15] (rerun) From 8d3e3e5787eac4c79617277bc1d2d1c26bf9b0fc Mon Sep 17 00:00:00 2001 From: Takafumi Arakaki Date: Sun, 9 May 2021 22:50:33 -0400 Subject: [PATCH 15/15] Revert "Revert "Ignore unexpected pass"" This reverts commit 90da12b15c53c5f77c9544f45e5c4695e8c77fee. --- .github/workflows/test-broken.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/test-broken.yml b/.github/workflows/test-broken.yml index 649be43..6df87b0 100644 --- a/.github/workflows/test-broken.yml +++ b/.github/workflows/test-broken.yml @@ -33,10 +33,3 @@ jobs: env: CI: "false" continue-on-error: true - - - name: "Expected failure" - run: "true" - if: ${{ steps.test.outcome == 'failure' }} - - name: "Unexpected pass" - run: "false" - if: ${{ steps.test.outcome != 'failure' }}