aboutsummaryrefslogtreecommitdiffstats
path: root/test/integration
diff options
context:
space:
mode:
authorMarcos Magueta <maguetamarcos@gmail.com>2026-10-08 02:12:17 -0300
committerMarcos Magueta <maguetamarcos@gmail.com>2026-10-08 02:12:17 -0300
commit46e348142d782cfd94ba37421f92e2871b0f4c22 (patch)
treeec1afd29523c9f1af9605f0564b9e93aeab8fa42 /test/integration
parentf49890e12d7eb6a766b966438cd475f7cbf5081b (diff)
downloadRNT-drop-journal.tar.gz
RNT-drop-journal.zip
fix testsdrop-journal
Diffstat (limited to '')
-rw-r--r--test/integration/Registration.ml49
1 files changed, 33 insertions, 16 deletions
diff --git a/test/integration/Registration.ml b/test/integration/Registration.ml
index 693435b..5430270 100644
--- a/test/integration/Registration.ml
+++ b/test/integration/Registration.ml
@@ -6,49 +6,66 @@ module Make (S : Abstract.Storage.STORAGE) (C : Helpers.Storage.CONFIGURATOR) =
module I = Kernel.Initialization.Make (S)
module B = Kernel.Branch.Make (S)
module M = Kernel.Multigroup.Make (S)
- module R = Kernel.SubstantialRelation.Make (S)
+ module Sc = Kernel.Schema.Make (S)
module E = Kernel.EphemeralRelation.Make (S)
- let book = Kernel.Path.("multigroup" @/ "library" @/ "relation" @/ "book" @/ this)
- let shelf = Kernel.Path.("multigroup" @/ "library" @/ "relation" @/ "shelf" @/ this)
+ let book =
+ Kernel.Path.("multigroup" @/ "library" @/ "schema" @/ "default" @/ "relation" @/ "book" @/ this)
+
+ let shelf =
+ Kernel.Path.("multigroup" @/ "library" @/ "schema" @/ "default" @/ "relation" @/ "shelf" @/ this)
+
+ let stacks = Kernel.Path.("system" @/ "branch" @/ "stacks" @/ this)
+
+ let titled title =
+ { Concepts.Tuple.type_= "book";
+ attributes=
+ BatMap.String.of_list
+ ["title", Concepts.Value.String title; "author", Concepts.Value.String "Date"] }
let run conn =
let open Utilities.Result in
begin
let* root = I.initialize ~evaluators:["fol", Evaluators.FOL.make ()] conn in
- let* multigroup = M.make conn in
- let* schematics = H.SI.with_transaction conn (fun tx -> H.store_schema tx ["title"]) in
- let* relation = R.instantiate conn ~schematics in
- let* multigroup =
- Kernel.Path.(assoc multigroup ("relation" @/ this) "book" (Some relation))
- in
+ let* schema = Sc.make conn in
+ let* relation = H.relation conn ["title"; "author"] [titled "SQL and Relational Theory"] in
let* view =
E.persist conn ~name:"shelf" ~evaluator:Evaluators.FOL.name
~code:Evaluators.FOL.(encode (Project (Base book, BatFingerTree.singleton "title")))
(BatMap.String.singleton "title" {Protocols.Schematics.domain= "string"; provenance= []})
in
- let* multigroup = Kernel.Path.(assoc multigroup ("relation" @/ this) "shelf" (Some view)) in
+ let* schema =
+ Kernel.Path.(
+ assoc_all schema
+ ["relation" @/ this, "book", Some relation; "relation" @/ this, "shelf", Some view] )
+ in
+ let* multigroup = M.make conn in
+ let* multigroup = Kernel.Path.(assoc multigroup ("schema" @/ this) "default" (Some schema)) in
let* branch = B.make conn in
let* branch' =
Kernel.Path.(assoc branch ("multigroup" @/ this) "library" (Some multigroup))
in
- Kernel.Path.(update root ("branch" @/ this) "master" None (Some branch'))
+ Kernel.Path.(update root ("system" @/ "branch" @/ this) "stacks" None (Some branch'))
end
|> Helpers.condition_as_failure
|> ignore;
- let attributes =
+ let attributes, shelved =
begin
let* root = I.initialize ~evaluators:["fol", Evaluators.FOL.make ()] conn in
- let* branch = Kernel.Path.(lookup root ("branch" @/ "master" @/ this)) in
+ let* branch = Kernel.Path.lookup root stacks in
let* _ = Kernel.Path.lookup branch book in
- let* _ = Kernel.Path.(lookup root ("evaluator" @/ "fol" @/ this)) in
let* plan = Evaluators.FOL.(instantiate (Kernel.Path.lookup branch) (Base shelf)) in
let* description = Evaluators.FOL.describe plan in
- Ok (BatMap.String.keys description |> BatList.of_enum)
+ let* view = Kernel.Path.lookup branch shelf in
+ let* shelved = Helpers.titles view in
+ Ok (BatMap.String.keys description |> BatList.of_enum, shelved)
end
|> Helpers.condition_as_failure
in
- check (list string) "the stored view reads the book it was defined over" ["title"] attributes
+ check (list string) "the stored view reads the book it was defined over" ["title"] attributes;
+ check (list Helpers.value) "read through the branch, the stored view runs"
+ [Concepts.Value.String "SQL and Relational Theory"]
+ shelved
let suite =
( "registration",