@@ -622,41 +622,46 @@ end
622
622
# version of one of the packages with a dependency to the other
623
623
# package. The registration is pushed to a new branch via a file URL.
624
624
@testset " register" begin
625
- mktempdir (@__DIR__ ) do temp_dir
626
- registry1_path = joinpath (temp_dir, " Registry1" )
627
- status = create_and_populate_registry (registry1_path, " Registry1" ,
628
- " 7e1d4fce-5fe6-405e-8bac-078d4138e9a2" ,
629
- " Example1" )
630
- @test ! haserror (status)
631
-
632
- registry2_path = joinpath (@__DIR__ , temp_dir, " Registry2" )
633
- status = create_and_populate_registry (registry2_path, " Registry2" ,
634
- " a5a8be26-c942-4674-beee-533a0e81ac1d" ,
635
- " Dep1" )
636
- @test ! haserror (status)
625
+ for pkg_f in [identity, Project]
626
+ mktempdir (@__DIR__ ) do temp_dir
627
+ registry1_path = joinpath (temp_dir, " Registry1" )
628
+ status = create_and_populate_registry (registry1_path, " Registry1" ,
629
+ " 7e1d4fce-5fe6-405e-8bac-078d4138e9a2" ,
630
+ " Example1" )
631
+ @test ! haserror (status)
632
+
633
+ registry2_path = joinpath (@__DIR__ , temp_dir, " Registry2" )
634
+ status = create_and_populate_registry (registry2_path, " Registry2" ,
635
+ " a5a8be26-c942-4674-beee-533a0e81ac1d" ,
636
+ " Dep1" )
637
+ @test ! haserror (status)
638
+
639
+ projects_path = joinpath (@__DIR__ , " project_files" )
640
+ project_file = joinpath (projects_path, " Example18.toml" )
641
+ pkg = pkg_f (project_file)
642
+ package_repo = " http://example.com/Example.git"
643
+ tree_hash = repeat (" 0" , 40 )
644
+ registry_repo = " file://$(registry1_path) "
645
+ deps_repo = " file://$(registry2_path) "
646
+ regbr = register (package_repo, pkg, tree_hash, registry = registry_repo,
647
+ registry_deps = [deps_repo], push = true ,
648
+ gitconfig = TEST_GITCONFIG)
649
+ if haskey (regbr. metadata, " error" ) || haskey (regbr. metadata, " warning" )
650
+ @info " " get (regbr. metadata, " error" , nothing ) get (regbr. metadata, " warning" , nothing )
651
+ end
652
+ @test ! haskey (regbr. metadata, " error" ) && ! haskey (regbr. metadata, " warning" )
653
+ git = gitcmd (registry1_path, TEST_GITCONFIG)
654
+ branches = readlines (` $git branch` )
655
+ @test length (branches) == 2
656
+ end
637
657
638
- projects_path = joinpath (@__DIR__ , " project_files" )
639
- project_file = joinpath (projects_path, " Example18.toml" )
640
- pkg = Project (project_file)
641
- package_repo = " http://example.com/$(pkg. name) .git"
642
- tree_hash = repeat (" 0" , 40 )
643
- registry_repo = " file://$(registry1_path) "
644
- deps_repo = " file://$(registry2_path) "
645
- regbr = register (package_repo, pkg, tree_hash, registry = registry_repo,
646
- registry_deps = [deps_repo], push = true ,
647
- gitconfig = TEST_GITCONFIG)
648
- @test ! haskey (regbr. metadata, " error" ) && ! haskey (regbr. metadata, " warning" )
649
- git = gitcmd (registry1_path, TEST_GITCONFIG)
650
- branches = readlines (` $git branch` )
651
- @test length (branches) == 2
658
+ # Clean up the registry cache created by `register`.
659
+ rm (joinpath (@__DIR__ , " registries" , " 7e1d4fce-5fe6-405e-8bac-078d4138e9a2" ),
660
+ recursive = true )
661
+ rm (joinpath (@__DIR__ , " registries" , " a5a8be26-c942-4674-beee-533a0e81ac1d" ),
662
+ recursive = true )
663
+ rm (joinpath (@__DIR__ , " registries" ))
652
664
end
653
-
654
- # Clean up the registry cache created by `register`.
655
- rm (joinpath (@__DIR__ , " registries" , " 7e1d4fce-5fe6-405e-8bac-078d4138e9a2" ),
656
- recursive = true )
657
- rm (joinpath (@__DIR__ , " registries" , " a5a8be26-c942-4674-beee-533a0e81ac1d" ),
658
- recursive = true )
659
- rm (joinpath (@__DIR__ , " registries" ))
660
665
end
661
666
662
667
@testset " find_registered_version" begin
0 commit comments