Fix TestEnv for subpackages: precompile only the new test Project
Fixes https://github.com/JuliaTesting/TestEnv.jl/issues/89.
Woohoo! :) It seems to work now! :)
@davidanthoff: This should also make testing subpackages faster in VSCode as well, not just for ReTestItems.
I'm happy to clone 1.9 into a 1.10 directory, and make this change there, but it doesn't seem to hurt anything on older versions so it seems like we can keep things as-is?
FYI the julia 1.0 - macos job failed with the following:
==> macos OS detected
https://uploader.codecov.io/latest/macos/codecov.SHA256SUM
==> SHASUM file signed by key id 806bb28aed[7](https://github.com/JuliaTesting/TestEnv.jl/actions/runs/11391513338/job/31695476316?pr=90#step:8:8)79[8](https://github.com/JuliaTesting/TestEnv.jl/actions/runs/11391513338/job/31695476316?pr=90#step:8:9)69
==> Uploader SHASUM verified (75086ee436f6f74c4e8f65448eaa3[9](https://github.com/JuliaTesting/TestEnv.jl/actions/runs/11391513338/job/31695476316?pr=90#step:8:10)9e38bc93bb27a53d057b24b275b9f78c89 codecov)
==> Running version latest
==> Running version v0.8.0
/Users/runner/work/_actions/codecov/codecov-action/v3/dist/codecov -n -Q github-action-3.1.6 -f lcov.info
Error: spawn Unknown system error -86
at ChildProcess.spawn (node:internal/child_process:421:[11](https://github.com/JuliaTesting/TestEnv.jl/actions/runs/11391513338/job/31695476316?pr=90#step:8:12))
at Object.spawn (node:child_process:761:9)
at ToolRunner.<anonymous> (/Users/runner/work/_actions/codecov/codecov-action/v3/webpack:/codecov-action/node_modules/@actions/exec/lib/toolrunner.js:4[13](https://github.com/JuliaTesting/TestEnv.jl/actions/runs/11391513338/job/31695476316?pr=90#step:8:14):1)
definitely seems like a flakey unrelated failure
Codecov Report
Attention: Patch coverage is 50.00000% with 2 lines in your changes missing coverage. Please review.
Project coverage is 10.46%. Comparing base (
3d198c7) to head (c30e22d).
| Files with missing lines | Patch % | Lines |
|---|---|---|
| src/julia-1.11/activate_set.jl | 0.00% | 1 Missing :warning: |
| src/julia-1.11/common.jl | 0.00% | 1 Missing :warning: |
:exclamation: There is a different number of reports uploaded between BASE (3d198c7) and HEAD (c30e22d). Click for more details.
HEAD has 6 uploads less than BASE
Flag BASE (3d198c7) HEAD (c30e22d) 7 1
Additional details and impacted files
@@ Coverage Diff @@
## main #90 +/- ##
===========================================
- Coverage 32.10% 10.46% -21.65%
===========================================
Files 28 28
Lines 707 707
===========================================
- Hits 227 74 -153
- Misses 480 633 +153
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
🤔 the 1.9 / 1.10 test failures seem real:
activate test/Project: Error During Test at /Users/runner/work/TestEnv.jl/TestEnv.jl/test/activate_set.jl:29
Got exception outside of a @test
The following 1 direct dependency failed to precompile:
NetCDF [30363a11-5582-574a-97bb-aa9a979735b9]
Failed to precompile NetCDF [30363a11-5582-574a-97bb-aa9a979735b9] to "/Users/runner/.julia/compiled/v1.9/NetCDF/jl_KVLanS".
ERROR: LoadError: InitError: could not load library "/Users/runner/.julia/artifacts/0b92c3ca1de2e9dc46a381553278edd25af54980/lib/libnetcdf.18.dylib"
dlopen(/Users/runner/.julia/artifacts/0b92c3ca1de2e9dc46a381553278edd25af54980/lib/libnetcdf.18.dylib, 0x0001): Library not loaded: '@rpath/libmbedtls.13.dylib'
Referenced from: '/Users/runner/.julia/artifacts/0b92c3ca1de2e9dc46a381553278edd25af54980/lib/libnetcdf.18.dylib'
Reason: tried: '/Users/runner/.julia/artifacts/0b92c3ca1de2e9dc46a381553278edd25af54980/lib/./libmbedtls.13.dylib' (no such file), '/Users/runner/.julia/artifacts/0b92c3ca1de2e9dc46a381553278edd25af54980/lib/./libmbedtls.13.dylib' (no such file), '/Users/runner/hostedtoolcache/julia/1.9.4/x64/lib/julia/libmbedtls.13.dylib' (no such file), '/Users/runner/hostedtoolcache/julia/1.9.4/x64/lib/julia/../libmbedtls.13.dylib' (no such file), '/Users/runner/hostedtoolcache/julia/1.9.4/x64/bin/../lib/libmbedtls.13.dylib' (no such file), '/usr/local/lib/libmbedtls.13.dylib' (no such file), '/usr/lib/libmbedtls.13.dylib' (no such file)
but weirdly the tests all pass for me locally, on julia 1.9, 1.10, and 1.11 on both macos and linux... 🤔 any ideas?
JULIA_PKG_SERVER_REGISTRY_PREFERENCE=eager julia +1.10 --proj --startup=no -e 'using Pkg; Pkg.test()'
...
Test Summary: | Pass Total Time
TestEnv.jl | 16 16 6.1s
Testing TestEnv tests passed
Gonna try checking if CI is just broken due to something transient in the Pkg registry or something like that, by opening this PR: https://github.com/JuliaTesting/TestEnv.jl/pull/91.
Local reproduction of the problem:
$ printenv JULIA_DEPOT_PATH
../jl_depot
$ git checkout main
$ rm -rf ../jl_depot/
$ ~/julia-1.11.3/bin/julia --project=.
julia> using Pkg
julia> pkg"test"
(success)
julia> exit
$ git checkout nhd-test-env-subprojects
$ rm -rf ../jl_depot/
$ ~/julia-1.11.3/bin/julia --project=.
julia> using Pkg
julia> pkg"test"
(fails)
...
Activating project at `/tmp/jl_EVeRTC`
activate test/Project: Error During Test at /home/ubuntu/github/TestEnv.jl/test/activate_set.jl:29
Got exception outside of a @test
The following 1 direct dependency failed to precompile:
NetCDF
Failed to precompile NetCDF [30363a11-5582-574a-97bb-aa9a979735b9] to "/home/ubuntu/github/jl_depot/compiled/v1.11/NetCDF/jl_7Km3mg".
ERROR: LoadError: InitError: could not load library "/home/ubuntu/github/jl_depot/artifacts/0a7f440ba143b238cc3dd0def2956d34d76755f3/lib/libnetcdf.so"
libmbedtls.so.13: cannot open shared object file: No such file or directory
Stacktrace:
[1] dlopen(s::String, flags::UInt32; throw_error::Bool)
@ Base.Libc.Libdl ./libdl.jl:120
[2] dlopen(s::String, flags::UInt32)
@ Base.Libc.Libdl ./libdl.jl:119
[3] macro expansion