From a0d355e21b467a46ef366509b540a5225726471c Mon Sep 17 00:00:00 2001 From: Tim Holy Date: Wed, 28 Jul 2021 04:55:17 -0500 Subject: [PATCH 1/3] Run tests with and without Revise Closes #57 --- .github/workflows/ci.yml | 3 +++ test/runtests.jl | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 155a3c6..0fed683 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,6 +45,9 @@ jobs: - name: Revise tests if: ${{ matrix.os == 'ubuntu-latest' }} run: julia -e 'using Pkg; Pkg.develop(PackageSpec(path=".")); Pkg.add(PackageSpec(url="https://github.com/timholy/Revise.jl")); Pkg.test("Revise")' + - name: Test while running Revise + if: ${{ matrix.os == 'ubuntu-latest' && matrix.version != '1.0' }} + run: julia -e 'using Pkg; Pkg.test("CodeTracking"; test_args=["revise"])' - uses: julia-actions/julia-processcoverage@v1 - uses: codecov/codecov-action@v1 with: diff --git a/test/runtests.jl b/test/runtests.jl index 9909b71..fbe1fe1 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -6,6 +6,11 @@ using Test, InteractiveUtils, LinearAlgebra, SparseArrays using CodeTracking: line_is_decl +if !isempty(ARGS) && "revise" ∈ ARGS + # For running tests with and without Revise + using Revise +end + isdefined(Main, :Revise) ? Main.Revise.includet("script.jl") : include("script.jl") @testset "CodeTracking.jl" begin From 4cc910f17c489b5bc44b24225264db7a275f4cd6 Mon Sep 17 00:00:00 2001 From: Tim Holy Date: Wed, 28 Jul 2021 05:07:15 -0500 Subject: [PATCH 2/3] Add Revise to CodeTracking's env during testing --- .github/workflows/ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0fed683..108a1fb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,7 +47,10 @@ jobs: run: julia -e 'using Pkg; Pkg.develop(PackageSpec(path=".")); Pkg.add(PackageSpec(url="https://github.com/timholy/Revise.jl")); Pkg.test("Revise")' - name: Test while running Revise if: ${{ matrix.os == 'ubuntu-latest' && matrix.version != '1.0' }} - run: julia -e 'using Pkg; Pkg.test("CodeTracking"; test_args=["revise"])' + run: julia -e 'using Pkg, CodeTracking; + Pkg.activate(pkgdir(CodeTracking)); + Pkg.add("Revise"); + Pkg.test("CodeTracking"; coverage=true, test_args=["revise"])' - uses: julia-actions/julia-processcoverage@v1 - uses: codecov/codecov-action@v1 with: From 8d45758a0e96a108401f5ece046ddbded15475db Mon Sep 17 00:00:00 2001 From: Tim Holy Date: Wed, 28 Jul 2021 09:27:28 -0500 Subject: [PATCH 3/3] Remove test/Project.toml, streamline ci script --- .github/workflows/ci.yml | 7 +++---- test/Project.toml | 6 ------ 2 files changed, 3 insertions(+), 10 deletions(-) delete mode 100644 test/Project.toml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 108a1fb..cafa2de 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,10 +47,9 @@ jobs: run: julia -e 'using Pkg; Pkg.develop(PackageSpec(path=".")); Pkg.add(PackageSpec(url="https://github.com/timholy/Revise.jl")); Pkg.test("Revise")' - name: Test while running Revise if: ${{ matrix.os == 'ubuntu-latest' && matrix.version != '1.0' }} - run: julia -e 'using Pkg, CodeTracking; - Pkg.activate(pkgdir(CodeTracking)); - Pkg.add("Revise"); - Pkg.test("CodeTracking"; coverage=true, test_args=["revise"])' + run: julia --project -e 'using Pkg; + Pkg.add("Revise"); + Pkg.test("CodeTracking"; coverage=true, test_args=["revise"])' - uses: julia-actions/julia-processcoverage@v1 - uses: codecov/codecov-action@v1 with: diff --git a/test/Project.toml b/test/Project.toml deleted file mode 100644 index 322854c..0000000 --- a/test/Project.toml +++ /dev/null @@ -1,6 +0,0 @@ -[deps] -ColorTypes = "3da002f7-5984-5a60-b8a6-cbb66c0b333f" -InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240" -LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" -SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" -Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"