Skip to content

Fix TestEnv for subpackages: precompile only the new test Project#90

Merged
NHDaly merged 4 commits intomainfrom
nhd-test-env-subprojects
Feb 10, 2026
Merged

Fix TestEnv for subpackages: precompile only the new test Project#90
NHDaly merged 4 commits intomainfrom
nhd-test-env-subprojects

Conversation

@NHDaly
Copy link
Copy Markdown
Member

@NHDaly NHDaly commented Oct 17, 2024

Fixes #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?

@NHDaly
Copy link
Copy Markdown
Member Author

NHDaly commented Oct 17, 2024

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
Copy link
Copy Markdown

codecov Bot commented Oct 17, 2024

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.27%. Comparing base (e97b393) to head (ca78f97).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #90      +/-   ##
==========================================
+ Coverage   78.17%   78.27%   +0.09%     
==========================================
  Files          34       34              
  Lines         921      925       +4     
==========================================
+ Hits          720      724       +4     
  Misses        201      201              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@NHDaly
Copy link
Copy Markdown
Member Author

NHDaly commented Oct 17, 2024

🤔 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

@NHDaly NHDaly requested a review from oxinabox October 17, 2024 20:07
@NHDaly
Copy link
Copy Markdown
Member Author

NHDaly commented Oct 17, 2024

Gonna try checking if CI is just broken due to something transient in the Pkg registry or something like that, by opening this PR: #91.

@kuszmaul
Copy link
Copy Markdown

kuszmaul commented Apr 8, 2025

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

Copy link
Copy Markdown
Member

@Drvi Drvi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (I don't see and can't reproduce any of the issues mentioned above)

@NHDaly NHDaly merged commit 80e3754 into main Feb 10, 2026
70 checks passed
@NHDaly NHDaly deleted the nhd-test-env-subprojects branch February 10, 2026 16:34
Drvi added a commit that referenced this pull request Feb 20, 2026
Fix TestEnv for subpackages: precompile only the new test Project, take 2
Like #90, but uses Pkg._auto_precompile instead of Pkg.precompile to respect the JULIA_PKG_PRECOMPILE_AUTO env var.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sub-packages aren't well supported (julia 1.10 feature setting manifest= in Project.toml): precompiling more than needed

3 participants