Skip to content

Commit

Permalink
Silence noisy test in test/cmdlineargs.jl (JuliaLang#52225)
Browse files Browse the repository at this point in the history
This is spamming
([example](https://buildkite.com/julialang/julia-master/builds/30247#018be235-0cd3-43bb-ba43-cc378ac0d682/792-1056))
```
      From worker 12:	ERROR: LoadError: UndefVarError: `@which` not defined in `Main`
      From worker 12:	Stacktrace:
      From worker 12:	 [1] top-level scope
      From worker 12:	   @ :0
      From worker 12:	 [2] lower
      From worker 12:	   @ ./meta.jl:163 [inlined]
      From worker 12:	 [3] eval_user_input(errio::IOContext{Base.PipeEndpoint}, ast::Any, show_value::Bool)
      From worker 12:	   @ Base ./client.jl:141
      From worker 12:	 [4] run_main_repl(interactive::Bool, quiet::Bool, banner::Symbol, history_file::Bool, color_set::Bool)
      From worker 12:	   @ Base ./client.jl:477
      From worker 12:	 [5] repl_main
      From worker 12:	   @ Base ./client.jl:561 [inlined]
      From worker 12:	 [6] _start()
      From worker 12:	   @ Base ./client.jl:535
      From worker 12:	in expression starting at none:1
```
in all jobs
  • Loading branch information
giordano committed Nov 20, 2023
1 parent 5cb0e51 commit 67161a3
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions test/cmdlineargs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import Libdl

# helper function for passing input to stdin
# and returning the stdout result
function writereadpipeline(input, exename)
p = open(exename, "w+")
function writereadpipeline(input, exename; stderr=nothing)
p = open(pipeline(exename; stderr), "w+")
@async begin
write(p.in, input)
close(p.in)
Expand Down Expand Up @@ -145,14 +145,19 @@ end

let exename = `$(Base.julia_cmd()) --startup-file=no --color=no`
# tests for handling of ENV errors
let v = writereadpipeline(
let
io = IOBuffer()
v = writereadpipeline(
"println(\"REPL: \", @which(less), @isdefined(InteractiveUtils))",
setenv(`$exename -i -E '@assert isempty(LOAD_PATH); push!(LOAD_PATH, "@stdlib"); @isdefined InteractiveUtils'`,
"JULIA_LOAD_PATH" => "",
"JULIA_DEPOT_PATH" => ";:",
"HOME" => homedir()))
"HOME" => homedir());
stderr=io)
# @which is undefined
@test_broken v == ("false\nREPL: InteractiveUtilstrue\n", true)
stderr = String(take!(io))
@test_broken isempty(stderr)
end
let v = writereadpipeline("println(\"REPL: \", InteractiveUtils)",
setenv(`$exename -i -e 'const InteractiveUtils = 3'`,
Expand Down

0 comments on commit 67161a3

Please sign in to comment.