diff --git a/test/data/clients_full.jsonl b/test/data/clients_full.jsonl new file mode 100644 index 0000000..e0c686a --- /dev/null +++ b/test/data/clients_full.jsonl @@ -0,0 +1,2 @@ +{"ID_CLIENT":"0001","EMAIL_CLIENT":"jonh.doe@domain.com","ACCOUNT_NUMBER":1} +{"ID_CLIENT":"0002","EMAIL_CLIENT":"jane.doe@domain.com","ACCOUNT_NUMBER":2} diff --git a/test/data/clients_sparse.jsonl b/test/data/clients_sparse.jsonl new file mode 100644 index 0000000..5722fa0 --- /dev/null +++ b/test/data/clients_sparse.jsonl @@ -0,0 +1,3 @@ +{"ID_CLIENT":"0001","EMAIL_CLIENT":"jonh.doe@domain.com","ACCOUNT_NUMBER":null} +{"ID_CLIENT":null,"EMAIL_CLIENT":null,"ACCOUNT_NUMBER":1} +{"EMAIL_CLIENT":"jonh.doe@domain.com","ACCOUNT_NUMBER":1} diff --git a/test/data/input1.jsonl b/test/data/input1.jsonl deleted file mode 100644 index e69de29..0000000 diff --git a/test/suites/02-scan.yml b/test/suites/02-scan.yml index f1bbdc7..757077a 100644 --- a/test/suites/02-scan.yml +++ b/test/suites/02-scan.yml @@ -15,3 +15,24 @@ testcases: assertions: - result.systemerr ShouldContainSubstring "path is not valid" - result.code ShouldEqual 1 + + - name: full silo + steps: + - script: silo scan ../silos/full < ../data/clients_full.jsonl + assertions: + - result.systemout ShouldContainSubstring "Scanned 2 rows, found 6 links" + - result.code ShouldEqual 0 + + - name: sparse silo + steps: + - script: silo scan ../silos/sparse < ../data/clients_sparse.jsonl + assertions: + - result.systemout ShouldContainSubstring "Scanned 3 rows, found 3 links" + - result.code ShouldEqual 0 + + - name: update silo + steps: + - script: silo scan ../silos/sparse < ../data/clients_sparse.jsonl + assertions: + - result.systemout ShouldContainSubstring "Scanned 3 rows, found 3 links" + - result.code ShouldEqual 0 diff --git a/test/suites/03-dump.yml b/test/suites/03-dump.yml new file mode 100644 index 0000000..e093706 --- /dev/null +++ b/test/suites/03-dump.yml @@ -0,0 +1,31 @@ +# Venom Test Suite definition +# Check Venom documentation for more information : https://github.com/ovh/venom +name: dump +testcases: + - name: no arguments + steps: + - script: silo dump + assertions: + - result.systemerr ShouldContainSubstring "accepts 1 arg(s), received 0" + - result.code ShouldEqual 1 + + - name: invalid silo + steps: + - script: silo dump ../silos/invalid + assertions: + - result.systemerr ShouldContainSubstring "path is not valid" + - result.code ShouldEqual 1 + + - name: full silo + steps: + - script: silo dump ../silos/full | jq .uuid | uniq | wc -l + assertions: + - result.systemout ShouldEqual "2" + - result.code ShouldEqual 0 + + - name: sparse silo + steps: + - script: silo dump ../silos/sparse | jq .uuid | uniq | wc -l + assertions: + - result.systemout ShouldEqual "1" + - result.code ShouldEqual 0