Skip to content

Commit

Permalink
Test nodes tracking a path
Browse files Browse the repository at this point in the history
  • Loading branch information
00vareladavid committed Nov 19, 2019
1 parent da8a897 commit 22f0121
Show file tree
Hide file tree
Showing 13 changed files with 134 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/new.jl
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,20 @@ inside_test_sandbox(fn; kwargs...) = Pkg.test(;test_fn=fn, kwargs...)
end
end
end end
# Check that active subgraph is transfered to test sandbox, even when tracking paths
isolate(loaded_depot=true) do; mktempdir() do tempdir
path = copy_test_package(tempdir, "TestSubgraphTrackingPath")
Pkg.activate(path)
inside_test_sandbox() do
Pkg.dependencies(unregistered_uuid) do pkg
@test pkg.isdeveloped
end
Pkg.dependencies(exuuid) do pkg
@test pkg.isdeveloped
end
end
end end
# Check that subgraph is transfered even when
# test dependency tracking path
isolate(loaded_depot=true) do; mktempdir() do tempdir
path = copy_test_package(tempdir, "TestDepTrackingPath")
Expand Down
12 changes: 12 additions & 0 deletions test/test_packages/TestSubgraphTrackingPath/Manifest.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# This file is machine-generated - editing it directly is not advised

[[Example]]
git-tree-sha1 = "46e44e869b4d90b96bd8ed1fdcf32244fddfb6cc"
uuid = "7876af07-990d-54b4-ab0e-23690620f79a"
version = "0.5.3"

[[Unregistered]]
deps = ["Example"]
path = "dev/Unregistered"
uuid = "dcb67f36-efa0-11e8-0cef-2fc465ed98ae"
version = "0.2.0"
6 changes: 6 additions & 0 deletions test/test_packages/TestSubgraphTrackingPath/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
name = "TestSubgraphTrackingPath"
uuid = "d0c1820a-42b1-4475-a264-e47af7733fd7"
version = "0.1.0"

[deps]
Unregistered = "dcb67f36-efa0-11e8-0cef-2fc465ed98ae"
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# This file is machine-generated - editing it directly is not advised

[[Example]]
path = "dev/Example"
uuid = "7876af07-990d-54b4-ab0e-23690620f79a"
version = "0.5.4"
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
name = "Unregistered"
uuid = "dcb67f36-efa0-11e8-0cef-2fc465ed98ae"
version = "0.2.0"

[deps]
Example = "7876af07-990d-54b4-ab0e-23690620f79a"
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name = "Example"
uuid = "7876af07-990d-54b4-ab0e-23690620f79a"
version = "0.5.4"
[compat]
julia = "1"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test"]

Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module Example
export hello, domath

"""
hello(who::String)
Return "Hello, `who`".
"""
hello(who::String) = "Hello, $who"

"""
domath(x::Number)
Return `x + 5`.
"""
domath(x::Number) = x + 5

end
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
using Test, Example

@test hello("Julia") == "Hello, Julia"
@test domath(2.0) 7.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module Unregistered
import Example
export plusfive

plusfive(x) = Example.domath(x)

end # module
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module TestSubgraphTrackingPath
import Unregistered

greet() = print("Hello World!")
addfive(x) = Unregistered.plusfive(x)

end # module
33 changes: 33 additions & 0 deletions test/test_packages/TestSubgraphTrackingPath/test/Manifest.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# This file is machine-generated - editing it directly is not advised

[[Base64]]
uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"

[[Distributed]]
deps = ["Random", "Serialization", "Sockets"]
uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b"

[[InteractiveUtils]]
deps = ["Markdown"]
uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240"

[[Logging]]
uuid = "56ddb016-857b-54e1-b83d-db4d58db5568"

[[Markdown]]
deps = ["Base64"]
uuid = "d6f4376e-aef5-505a-96c1-9c027394607a"

[[Random]]
deps = ["Serialization"]
uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"

[[Serialization]]
uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b"

[[Sockets]]
uuid = "6462fe0b-24de-5631-8697-dd941f90decc"

[[Test]]
deps = ["Distributed", "InteractiveUtils", "Logging", "Random"]
uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
2 changes: 2 additions & 0 deletions test/test_packages/TestSubgraphTrackingPath/test/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[deps]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
7 changes: 7 additions & 0 deletions test/test_packages/TestSubgraphTrackingPath/test/runtests.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module SomeModule
import TestSubgraphTrackingPath
using Test

@test TestSubgraphTrackingPath.addfive(1) == 6

end

0 comments on commit 22f0121

Please sign in to comment.