Skip to content

Commit

Permalink
Update Pluto integration testing system
Browse files Browse the repository at this point in the history
  • Loading branch information
fonsp committed Nov 13, 2024
1 parent 352b212 commit c50a449
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 45 deletions.
7 changes: 7 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,10 @@ ExpressionExplorer = "0.6, 1"
InteractiveUtils = "1"
Markdown = "1"
julia = "1.10"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"

[targets]
test = ["Pkg", "Test"]
6 changes: 0 additions & 6 deletions test/Project.toml

This file was deleted.

48 changes: 22 additions & 26 deletions test/pluto integration/DEV EDIT ME pluto pkg source.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,44 +3,40 @@
the PackageSpec written in this file will be used to import Pluto during these tests.
# DO I NEED IT?
When developing PlutoDependencyExplorer, and you don't need matching changes from Pluto, then leave this file empty.
When developing PlutoDependencyExplorer, and you don't need matching changes from Pluto, then leave this file as-is.
In the special case that you need to make changes to PlutoDependencyExplorer and Pluto at the same time, you can use this file.
In the special case that you need to make changes to PlutoDependencyExplorer and Pluto at the same time, you can edit this file to test those changes.
# HOW TO USE IT
## Step 1:
If this change needs a matching Pluto change, set:
```julia
i_need_a_special_pluto_branch = true
```
and continue to Step 2. Otherwise, set it to `false` and you're done.
Uncomment the PackageSpec that best matches your needs.
## Step 2:
"""


"""
function get_spec()


# DEFAULT: use the latest development Pluto
Pkg.PackageSpec(
name="Pluto",
rev="main",
)

i_need_a_special_pluto_branch = false
# EXAMPLE: use a specific branch of Pluto
# Pkg.PackageSpec(
# name="Pluto",
# rev="something-different",
# )

# LOCAL DEVELOPMENT: use a local copy of Pluto
# Pkg.PackageSpec(
# name="Pluto",
# path="/Users/fons/Documents/Pluto.jl"
# )

if i_need_a_special_pluto_branch
if get(ENV, "CI", "🍄") == "true"
Pkg.PackageSpec(
name="Pluto",
rev="PlutoDependencyExplorer-split",
)
else
Pkg.PackageSpec(
name="Pluto",
path="/Users/fons/Documents/Pluto.jl"
)
end
else
nothing
end



get_spec()
27 changes: 14 additions & 13 deletions test/pluto integration/run.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,26 @@ import Pkg

pkg_source = include("./DEV EDIT ME pluto pkg source.jl")

@info "PlutoDependencyExplorer: importing Pluto from" pkg_source
@info "PlutoDependencyExplorer tests: importing Pluto from" pkg_source

if pkg_source !== nothing
@assert pkg_source isa Pkg.PackageSpec

is_dev = if hasfield(typeof(pkg_source), :rev)
pkg_source.rev === nothing
else
pkg_source.repo.rev === nothing
end

if is_dev
Pkg.develop(pkg_source)
else
Pkg.add(pkg_source)
end
is_dev = if hasfield(typeof(pkg_source), :rev)
pkg_source.rev === nothing
else
pkg_source.repo.rev === nothing
end

if is_dev
Pkg.develop(pkg_source)
else
Pkg.add(pkg_source)
end

import Pluto

@info "PlutoDependencyExplorer tests: imported Pluto" pkgversion(Pluto)

include("./helpers.jl")

include("./identity.jl")
Expand Down

0 comments on commit c50a449

Please sign in to comment.