Skip to content

Commit

Permalink
test: add venom tests
Browse files Browse the repository at this point in the history
  • Loading branch information
adrienaury committed Mar 25, 2024
1 parent b0bb6fe commit 6c2b336
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/data/clients_full.jsonl
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{"ID_CLIENT":"0001","EMAIL_CLIENT":"[email protected]","ACCOUNT_NUMBER":1}
{"ID_CLIENT":"0002","EMAIL_CLIENT":"[email protected]","ACCOUNT_NUMBER":2}
3 changes: 3 additions & 0 deletions test/data/clients_sparse.jsonl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{"ID_CLIENT":"0001","EMAIL_CLIENT":"[email protected]","ACCOUNT_NUMBER":null}
{"ID_CLIENT":null,"EMAIL_CLIENT":null,"ACCOUNT_NUMBER":1}
{"EMAIL_CLIENT":"[email protected]","ACCOUNT_NUMBER":1}
Empty file removed test/data/input1.jsonl
Empty file.
21 changes: 21 additions & 0 deletions test/suites/02-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
31 changes: 31 additions & 0 deletions test/suites/03-dump.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 6c2b336

Please sign in to comment.