From d95d0056f278eeb06fe16a82f8fc5589e6ccedf8 Mon Sep 17 00:00:00 2001 From: richardreeve Date: Wed, 17 Jul 2024 23:00:20 +0100 Subject: [PATCH] Allow new files in repo --- Project.toml | 8 +++++++- test/runtests.jl | 3 +++ test/test_Phylo.jl | 23 ++++++++++++++++++++++- 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/Project.toml b/Project.toml index fecf6d4..5602c99 100644 --- a/Project.toml +++ b/Project.toml @@ -40,10 +40,13 @@ DataFrames = "1" DataStructures = "0.17, 0.18" Distances = "0.10" Distributions = "0.24, 0.25" +Git = "1" Graphs = "1" IterableTables = "1" +Logging = "1" Missings = "1" ParserCombinator = "2" +Pkg = "1.6" Plots = "1" Printf = "1.6" RCall = "0.13, 0.14" @@ -78,9 +81,12 @@ orcid = "0000-0003-0852-2340" [extras] DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" +Git = "d7ba0133-e1db-5d97-8f8c-041e4b3a1eb2" +Logging = "56ddb016-857b-54e1-b83d-db4d58db5568" +Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80" RCall = "6f49c342-dc21-5d91-9882-a32aef131414" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [targets] -test = ["DataFrames", "Plots", "RCall", "Test"] +test = ["DataFrames", "Git", "Logging", "Pkg", "Plots", "RCall", "Test"] diff --git a/test/runtests.jl b/test/runtests.jl index fa27e5d..05c8267 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -3,6 +3,9 @@ using Random using Test using Phylo +using Pkg + +Pkg.develop(url = "https://github.com/richardreeve/ResearchSoftwareMetadata.jl.git") # Identify files in test/ that are testing matching files in src/ # - src/Source.jl will be matched by test/test_Source.jl diff --git a/test/test_Phylo.jl b/test/test_Phylo.jl index 16184cb..7af1589 100644 --- a/test/test_Phylo.jl +++ b/test/test_Phylo.jl @@ -2,8 +2,29 @@ module TestPhylo using Test - using Phylo +using Git +using Logging +using ResearchSoftwareMetadata + +function is_repo_clean(repo_path) + # Get the status of the repository + statuses = readlines(`$(Git.git()) status -s $repo_path`) + statuses = filter((!)∘contains("??"), statuses) + + is_clean = isempty(statuses) + is_clean || @error "\n" * join(statuses, "\n") + + return is_clean +end + +@testset "RSMD" begin + git_dir = readchomp(`$(Git.git()) rev-parse --show-toplevel`) + @test isnothing(ResearchSoftwareMetadata.crosswalk()) + global_logger(SimpleLogger(stderr, Logging.Warn)) + @test_nowarn ResearchSoftwareMetadata.crosswalk() + @test is_repo_clean(git_dir) +end @testset "Deprecations" begin t = NamedTree()