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

test: fix permissions of PackageBundler test inputs #11

Merged
merged 3 commits into from
Jul 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading