Skip to content

Commit

Permalink
test: fix permissions of PackageBundler test inputs (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
mortenpi authored Jul 6, 2023
1 parent ce0a802 commit 886402f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
12 changes: 10 additions & 2 deletions test/jobs.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# We have to copy the test environment files to a temporary directory
# because PackageBundler needs write access to them.
JOBENVS = let tmp = tempname()
cp(joinpath(@__DIR__, "jobenvs"), tmp)
chmod(tmp, 0o777; recursive=true)
tmp
end

@testset "JuliaHub.script" begin
jobfile(path...) = joinpath(@__DIR__, "jobenvs", "job1", path...)
jobfile(path...) = joinpath(JOBENVS, "job1", path...)

let s = JuliaHub.script(; code="1", project="name=1", manifest="name=1", artifacts="name=1")
@test s.code == "1"
Expand Down Expand Up @@ -50,7 +58,7 @@
end

@testset "JuliaHub.appbundle" begin
jobfile(path...) = joinpath(@__DIR__, "jobenvs", "job1", path...)
jobfile(path...) = joinpath(JOBENVS, "job1", path...)

bundle = JuliaHub.appbundle(jobfile(), "script.jl")
@test isfile(bundle.environment.tarball_path)
Expand Down
10 changes: 9 additions & 1 deletion test/packagebundler.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
import Tar

pkg1 = joinpath(@__DIR__, "fixtures", "ignorefiles", "Pkg1")
# We have to copy the test environment files to a temporary directory
# because PackageBundler needs write access to them.
TMP_FIXTURES = let tmp = tempname()
cp(joinpath(@__DIR__, "fixtures"), tmp)
chmod(tmp, 0o777; recursive=true)
tmp
end

pkg1 = joinpath(TMP_FIXTURES, "ignorefiles", "Pkg1")
if !isdir(joinpath(pkg1, ".git"))
mkdir(joinpath(pkg1, ".git")) # can't check in sub-repos
touch(joinpath(pkg1, ".git", "test"))
Expand Down

0 comments on commit 886402f

Please sign in to comment.