From dccf693a082a5104b6ccd2a039b605276aa43c1c Mon Sep 17 00:00:00 2001 From: Reuben Gardos Reid <5456207+ReubenJ@users.noreply.github.com> Date: Thu, 14 Nov 2024 11:36:58 +0100 Subject: [PATCH 1/3] Move to separate Test project --- Project.toml | 8 -------- test/Project.toml | 13 +++++++++++++ 2 files changed, 13 insertions(+), 8 deletions(-) create mode 100644 test/Project.toml diff --git a/Project.toml b/Project.toml index 018ff11..77c8e8a 100644 --- a/Project.toml +++ b/Project.toml @@ -10,7 +10,6 @@ HerbGrammar = "4ef9e186-2fe5-4b24-8de7-9f7291f24af7" HerbInterpret = "5bbddadd-02c5-4713-84b8-97364418cca7" HerbSearch = "3008d8e8-f9aa-438a-92ed-26e9c7b4829f" HerbSpecification = "6d54aada-062f-46d8-85cf-a1ceaf058a06" -Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" [compat] HerbConstraints = "^0.2.0" @@ -20,10 +19,3 @@ HerbInterpret = "^0.1.2" HerbSearch = "^0.3.0" HerbSpecification = "^0.1.0" julia = "^1.8" - -[extras] -Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" -Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" - -[targets] -test = ["Test"] diff --git a/test/Project.toml b/test/Project.toml new file mode 100644 index 0000000..a15268b --- /dev/null +++ b/test/Project.toml @@ -0,0 +1,13 @@ +[deps] +Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" +Herb = "c09c6b7f-4f63-49de-90d9-97a3563c0f4a" +HerbConstraints = "1fa96474-3206-4513-b4fa-23913f296dfc" +HerbCore = "2b23ba43-8213-43cb-b5ea-38c12b45bd45" +HerbGrammar = "4ef9e186-2fe5-4b24-8de7-9f7291f24af7" +HerbInterpret = "5bbddadd-02c5-4713-84b8-97364418cca7" +HerbSearch = "3008d8e8-f9aa-438a-92ed-26e9c7b4829f" +HerbSpecification = "6d54aada-062f-46d8-85cf-a1ceaf058a06" +JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b" +PlutoStaticHTML = "359b1769-a58e-495b-9770-312e911026ad" +PlutoUI = "7f904dfe-b85e-4ff6-b463-dae2292396a8" +Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" From 1a23991fbe6f364c063c937e00a47abd71cb85d8 Mon Sep 17 00:00:00 2001 From: Reuben Gardos Reid <5456207+ReubenJ@users.noreply.github.com> Date: Thu, 14 Nov 2024 11:37:54 +0100 Subject: [PATCH 2/3] Move notebook building function to separate file --- docs/build_notebooks.jl | 9 +++++++++ docs/make.jl | 31 ++++++++----------------------- 2 files changed, 17 insertions(+), 23 deletions(-) create mode 100644 docs/build_notebooks.jl diff --git a/docs/build_notebooks.jl b/docs/build_notebooks.jl new file mode 100644 index 0000000..ef790a6 --- /dev/null +++ b/docs/build_notebooks.jl @@ -0,0 +1,9 @@ +using PlutoStaticHTML + +function build(tutorials_dir) + @info "Building notebooks in $tutorials_dir" + use_distributed = false + output_format = documenter_output + bopts = BuildOptions(tutorials_dir; use_distributed, output_format) + build_notebooks(bopts) +end \ No newline at end of file diff --git a/docs/make.jl b/docs/make.jl index ffc36e5..183c060 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -1,34 +1,19 @@ -using Documenter: - HTML, - deploydocs, - makedocs - -using PlutoStaticHTML -using Pkg: Pkg - +using Documenter: HTML, deploydocs, makedocs using Herb - using HerbConstraints -using HerbSearch +using HerbCore using HerbGrammar using HerbInterpret -using HerbCore +using HerbSearch using HerbSpecification +using Pkg +using PlutoStaticHTML +include(joinpath(@__DIR__, "..", "docs", "build_notebooks.jl")) tutorials_dir = joinpath(dirname(@__DIR__), "docs", "src", "tutorials") -function build() - println("Building notebooks in $tutorials_dir") - use_distributed = false - output_format = documenter_output - bopts = BuildOptions(tutorials_dir; use_distributed, output_format) - build_notebooks(bopts) - Pkg.activate(@__DIR__) - return nothing -end - -build() - +Pkg.activate(@__DIR__) +build(tutorials_dir) makedocs( modules=[HerbConstraints, HerbSearch, HerbGrammar, HerbSpecification, HerbInterpret, HerbCore], From e99b1219839a01ada6077e8d803bb06eaea0dddb Mon Sep 17 00:00:00 2001 From: Reuben Gardos Reid <5456207+ReubenJ@users.noreply.github.com> Date: Thu, 14 Nov 2024 11:40:00 +0100 Subject: [PATCH 3/3] Remove subpackage tests and add umbrella tests - Add Aqua tests - Add tutorial notebook building as a smoke test --- test/Project.toml | 1 - test/runtests.jl | 39 +++++++++++++-------------------------- 2 files changed, 13 insertions(+), 27 deletions(-) diff --git a/test/Project.toml b/test/Project.toml index a15268b..52ed959 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -7,7 +7,6 @@ HerbGrammar = "4ef9e186-2fe5-4b24-8de7-9f7291f24af7" HerbInterpret = "5bbddadd-02c5-4713-84b8-97364418cca7" HerbSearch = "3008d8e8-f9aa-438a-92ed-26e9c7b4829f" HerbSpecification = "6d54aada-062f-46d8-85cf-a1ceaf058a06" -JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b" PlutoStaticHTML = "359b1769-a58e-495b-9770-312e911026ad" PlutoUI = "7f904dfe-b85e-4ff6-b463-dae2292396a8" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" diff --git a/test/runtests.jl b/test/runtests.jl index 133fd25..2109915 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,29 +1,16 @@ -module HerbTest - -using HerbConstraints -using HerbCore -using HerbInterpret -using HerbGrammar -using HerbSearch -using HerbSpecification - +using Aqua +using Herb using Test -using Pkg +include(joinpath(@__DIR__, "..", "docs", "build_notebooks.jl")) -@testset verbose=false "Herb" begin - @test 1==1 # dummy test - println("\n--- HerbConstraints tests ---") - Pkg.test("HerbConstraints") - println("\n--- HerbCore tests ---") - Pkg.test("HerbCore") - println("\n--- HerbInterpret tests ---") - Pkg.test("HerbInterpret") - println("\n--- HerbGrammar tests ---") - Pkg.test("HerbGrammar") - println("\n--- HerbSearch tests ---") - Pkg.test("HerbSearch") - println("\n--- HerbSpecification tests ---") - Pkg.test("HerbSpecification") -end +@testset "Herb" begin + @testset "Aqua.jl" begin + Aqua.test_all(Herb) + end -end # module + @testset "Build notebooks" begin + tutorials_dir = joinpath(dirname(@__DIR__), "docs", "src", "tutorials") + # Smoke test to make sure building the notebooks doesn't error + @test build(tutorials_dir) isa Any + end +end