Skip to content

Commit

Permalink
fix: fix integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wfxr committed Nov 15, 2021
1 parent 7730be2 commit 5818926
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 14 deletions.
4 changes: 2 additions & 2 deletions featctl/test/test_list_feature.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ register_features
import_sample > /dev/null

case='featctl list feature works'
expected='Name,Group,Entity,Category,DBValueType,ValueType,Description,OnlineRevision
expected='Name,Group,Entity,Category,DBValueType,ValueType,Description,OnlineRevisionID
model,phone,device,batch,varchar(32),string,,<NULL>
price,phone,device,batch,int,int32,,<NULL>
'
actual=$(featctl list feature -o csv)
ignore_time() { cut -d ',' -f 1-8 <<<"$1"; }
assert_eq "$case" "$expected" "$(ignore_time "$actual" | sort)"
assert_eq "$case" "$(sort <<< "$expected")" "$(ignore_time "$actual" | sort)"
17 changes: 9 additions & 8 deletions featctl/test/test_update_feature.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ import_sample > /dev/null
case='featctl update feature works'
featctl update feature price --description "new description"
expected='
Name: price
Group: phone
Entity: device
Category: batch
DBValueType: int
ValueType: int32
Description: new description
Name: price
Group: phone
Entity: device
Category: batch
DBValueType: int
ValueType: int32
Description: new description
OnlineRevisionID: <NULL>
'
actual=$(featctl describe feature price)
ignore() { grep -Ev '^(CreateTime|ModifyTime|Online Revision|Offline Latest Revision|Offline Latest DataTable)' <<<"$1"; }
ignore() { grep -Ev '^(CreateTime|ModifyTime)' <<<"$1"; }
assert_eq "$case" "$expected" "$(ignore "$actual")"
9 changes: 5 additions & 4 deletions featctl/test/test_update_group.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ import_sample > /dev/null
case='featctl update group works'
featctl update group phone --description "new description"
expected='
Name: phone
Entity: device
Description: new description
Name: phone
Entity: device
Description: new description
OnlineRevisionID: <NULL>
'
actual=$(featctl describe group phone)
ignore() { grep -Ev '^(CreateTime|ModifyTime|Online Revision|Offline Latest Revision|Offline Latest DataTable)' <<<"$1"; }
ignore() { grep -Ev '^(CreateTime|ModifyTime)' <<<"$1"; }
assert_eq "$case" "$expected" "$(ignore "$actual")"

0 comments on commit 5818926

Please sign in to comment.