Skip to content

Commit

Permalink
remove Forwards compat test
Browse files Browse the repository at this point in the history
  • Loading branch information
fonsp committed Oct 10, 2024
1 parent b3070e4 commit 3ba50cd
Showing 1 changed file with 2 additions and 55 deletions.
57 changes: 2 additions & 55 deletions test/packages/Basic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -429,12 +429,10 @@ import Malt
@test index_order == [3, 2, 1]
end

pre_pkg_notebook = read(joinpath(@__DIR__, "old_import.jl"), String)
local post_pkg_notebook = nothing

@testset "File format -- Backwards compat" begin
🍭 = ServerSession()


pre_pkg_notebook = read(joinpath(@__DIR__, "old_import.jl"), String)
dir = mktempdir()
path = joinpath(dir, "hello.jl")
write(path, pre_pkg_notebook)
Expand All @@ -460,57 +458,6 @@ import Malt
cleanup(🍭, notebook)
end

@static if VERSION < v"1.10.0-0" # see https://github.com/fonsp/Pluto.jl/pull/2626#issuecomment-1671244510
@testset "File format -- Forwards compat" begin
# Using Distributed, we will create a new Julia process in which we install Pluto 0.14.7 (before PlutoPkg). We run the new notebook file on the old Pluto.
test_worker = Malt.Worker()

@test post_pkg_notebook isa String

Malt.remote_eval_wait(Main, test_worker, quote
path = tempname()
write(path, $(post_pkg_notebook))
import Pkg
# optimization:
if isdefined(Pkg, :UPDATED_REGISTRY_THIS_SESSION)
Pkg.UPDATED_REGISTRY_THIS_SESSION[] = true
end

Pkg.activate(;temp=true)
Pkg.add(Pkg.PackageSpec(;name="Pluto",version=v"0.14.7"))
# Distributed is required for old Pluto to work!
Pkg.add("Distributed")

import Pluto
@info Pluto.PLUTO_VERSION
@assert Pluto.PLUTO_VERSION == v"0.14.7"
end)

@test Malt.remote_eval_fetch(Main, test_worker, quote
s = Pluto.ServerSession()
nb = Pluto.SessionActions.open(s, path; run_async=false)
nb.cells[2].errored == false
end)

# Cells that use Example will error because the package is not installed.

# @test Malt.remote_eval_fetch(Main, test_worker, quote
# nb.cells[1].errored == false
# end)
@test Malt.remote_eval_fetch(Main, test_worker, quote
nb.cells[2].errored == false
end)
# @test Malt.remote_eval_fetch(Main, test_worker, quote
# nb.cells[3].errored == false
# end)
# @test Malt.remote_eval_fetch(Main, test_worker, quote
# nb.cells[3].output.body == "25"
# end)

Malt.stop(test_worker)
end
end

@testset "PkgUtils -- reset" begin
dir = mktempdir()
f = joinpath(dir, "hello.jl")
Expand Down

0 comments on commit 3ba50cd

Please sign in to comment.