Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No preferences loaded when testing package #40

Open
pxl-th opened this issue Jul 17, 2022 · 2 comments
Open

No preferences loaded when testing package #40

pxl-th opened this issue Jul 17, 2022 · 2 comments

Comments

@pxl-th
Copy link

pxl-th commented Jul 17, 2022

I encounter this bug on Julia 1.7.3. Julia 1.8.0-rc1 does not have this.

Here's MWE: R.tar.gz

The package is very minimal, it only loads preference const BACKEND = @load_preference("backend") from LocalPreferences.toml.
When using R directly, it loads preferences, but when ]testing package, BACKEND is nothing.

Tracing what happens during @load_preference I've found out that project_dir does not contain LocalPreferences.toml:

  • 1.7.3: readdir(project_dir) = ["Manifest.toml", "Project.toml"]
  • 1.8.0-rc1: readdir(project_dir) = ["JuliaLocalPreferences.toml", "Manifest.toml", "Project.toml"]
@giordano
Copy link
Member

#39 (comment) again

@pxl-th
Copy link
Author

pxl-th commented Jul 17, 2022

#39 (comment) again

I did try to specify R in [extras], but still get the same result

pxl-th@Atom:~/Downloads/R$ cat test/Project.toml 
[deps]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[extras]
R = "0c099881-77d4-44cc-8664-2f9c2902eb5d"
pxl-th@Atom:~/Downloads/R$ jl
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.7.3 (2022-05-06)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

(R) pkg> test
     Testing R
      Status `/tmp/jl_24AvVz/Project.toml`
  [0c099881] R v0.1.0 `~/Downloads/R`
  [8dfed614] Test `@stdlib/Test`
      Status `/tmp/jl_24AvVz/Manifest.toml`
  [21216c6a] Preferences v1.3.0
  [0c099881] R v0.1.0 `~/Downloads/R`
  [2a0f44e3] Base64 `@stdlib/Base64`
  [ade2ca70] Dates `@stdlib/Dates`
  [b77e0a4c] InteractiveUtils `@stdlib/InteractiveUtils`
  [56ddb016] Logging `@stdlib/Logging`
  [d6f4376e] Markdown `@stdlib/Markdown`
  [de0858da] Printf `@stdlib/Printf`
  [9a3f8284] Random `@stdlib/Random`
  [ea8e919c] SHA `@stdlib/SHA`
  [9e88b42a] Serialization `@stdlib/Serialization`
  [fa267f1f] TOML `@stdlib/TOML`
  [8dfed614] Test `@stdlib/Test`
  [4ec0a83e] Unicode `@stdlib/Unicode`
     Testing Running tests...
readdir(project_dir) = ["Manifest.toml", "Project.toml"]
Base.collect_preferences(project_toml, UUID) = Dict{String, Any}[]
R.BACKEND = nothing
     Testing R tests passed 

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

No branches or pull requests

2 participants