mirror of
https://github.com/turbot/steampipe.git
synced 2025-12-19 18:12:43 -05:00
Fix acceptance tests and expectations. Closes #4032
This commit is contained in:
@@ -1,7 +1,3 @@
|
||||
connection "chaos_ttl_options" {
|
||||
plugin = "chaos"
|
||||
options "connection" {
|
||||
cache = true
|
||||
cache_ttl = 10
|
||||
}
|
||||
}
|
||||
@@ -1,164 +1,132 @@
|
||||
[
|
||||
{
|
||||
"_ctx": {
|
||||
"connection_name": "chaos"
|
||||
{
|
||||
"column_0": "column_0-0",
|
||||
"column_1": "column_1-0",
|
||||
"column_2": "column_2-0",
|
||||
"column_3": "column_3-0",
|
||||
"column_4": "column_4-0",
|
||||
"column_5": "column_5-0",
|
||||
"column_6": "column_6-0",
|
||||
"column_7": "column_7-0",
|
||||
"column_8": "column_8-0",
|
||||
"column_9": "column_9-0",
|
||||
"id": 0
|
||||
},
|
||||
"column_0": "column_0-0",
|
||||
"column_1": "column_1-0",
|
||||
"column_2": "column_2-0",
|
||||
"column_3": "column_3-0",
|
||||
"column_4": "column_4-0",
|
||||
"column_5": "column_5-0",
|
||||
"column_6": "column_6-0",
|
||||
"column_7": "column_7-0",
|
||||
"column_8": "column_8-0",
|
||||
"column_9": "column_9-0",
|
||||
"id": 0
|
||||
},
|
||||
{
|
||||
"_ctx": {
|
||||
"connection_name": "chaos"
|
||||
{
|
||||
"column_0": "column_0-1",
|
||||
"column_1": "column_1-1",
|
||||
"column_2": "column_2-1",
|
||||
"column_3": "column_3-1",
|
||||
"column_4": "column_4-1",
|
||||
"column_5": "column_5-1",
|
||||
"column_6": "column_6-1",
|
||||
"column_7": "column_7-1",
|
||||
"column_8": "column_8-1",
|
||||
"column_9": "column_9-1",
|
||||
"id": 1
|
||||
},
|
||||
"column_0": "column_0-1",
|
||||
"column_1": "column_1-1",
|
||||
"column_2": "column_2-1",
|
||||
"column_3": "column_3-1",
|
||||
"column_4": "column_4-1",
|
||||
"column_5": "column_5-1",
|
||||
"column_6": "column_6-1",
|
||||
"column_7": "column_7-1",
|
||||
"column_8": "column_8-1",
|
||||
"column_9": "column_9-1",
|
||||
"id": 1
|
||||
},
|
||||
{
|
||||
"_ctx": {
|
||||
"connection_name": "chaos"
|
||||
{
|
||||
"column_0": "column_0-10",
|
||||
"column_1": "column_1-10",
|
||||
"column_2": "column_2-10",
|
||||
"column_3": "column_3-10",
|
||||
"column_4": "column_4-10",
|
||||
"column_5": "column_5-10",
|
||||
"column_6": "column_6-10",
|
||||
"column_7": "column_7-10",
|
||||
"column_8": "column_8-10",
|
||||
"column_9": "column_9-10",
|
||||
"id": 10
|
||||
},
|
||||
"column_0": "column_0-10",
|
||||
"column_1": "column_1-10",
|
||||
"column_2": "column_2-10",
|
||||
"column_3": "column_3-10",
|
||||
"column_4": "column_4-10",
|
||||
"column_5": "column_5-10",
|
||||
"column_6": "column_6-10",
|
||||
"column_7": "column_7-10",
|
||||
"column_8": "column_8-10",
|
||||
"column_9": "column_9-10",
|
||||
"id": 10
|
||||
},
|
||||
{
|
||||
"_ctx": {
|
||||
"connection_name": "chaos"
|
||||
{
|
||||
"column_0": "column_0-100",
|
||||
"column_1": "column_1-100",
|
||||
"column_2": "column_2-100",
|
||||
"column_3": "column_3-100",
|
||||
"column_4": "column_4-100",
|
||||
"column_5": "column_5-100",
|
||||
"column_6": "column_6-100",
|
||||
"column_7": "column_7-100",
|
||||
"column_8": "column_8-100",
|
||||
"column_9": "column_9-100",
|
||||
"id": 100
|
||||
},
|
||||
"column_0": "column_0-100",
|
||||
"column_1": "column_1-100",
|
||||
"column_2": "column_2-100",
|
||||
"column_3": "column_3-100",
|
||||
"column_4": "column_4-100",
|
||||
"column_5": "column_5-100",
|
||||
"column_6": "column_6-100",
|
||||
"column_7": "column_7-100",
|
||||
"column_8": "column_8-100",
|
||||
"column_9": "column_9-100",
|
||||
"id": 100
|
||||
},
|
||||
{
|
||||
"_ctx": {
|
||||
"connection_name": "chaos"
|
||||
{
|
||||
"column_0": "column_0-1000",
|
||||
"column_1": "column_1-1000",
|
||||
"column_2": "column_2-1000",
|
||||
"column_3": "column_3-1000",
|
||||
"column_4": "column_4-1000",
|
||||
"column_5": "column_5-1000",
|
||||
"column_6": "column_6-1000",
|
||||
"column_7": "column_7-1000",
|
||||
"column_8": "column_8-1000",
|
||||
"column_9": "column_9-1000",
|
||||
"id": 1000
|
||||
},
|
||||
"column_0": "column_0-1000",
|
||||
"column_1": "column_1-1000",
|
||||
"column_2": "column_2-1000",
|
||||
"column_3": "column_3-1000",
|
||||
"column_4": "column_4-1000",
|
||||
"column_5": "column_5-1000",
|
||||
"column_6": "column_6-1000",
|
||||
"column_7": "column_7-1000",
|
||||
"column_8": "column_8-1000",
|
||||
"column_9": "column_9-1000",
|
||||
"id": 1000
|
||||
},
|
||||
{
|
||||
"_ctx": {
|
||||
"connection_name": "chaos"
|
||||
{
|
||||
"column_0": "column_0-1001",
|
||||
"column_1": "column_1-1001",
|
||||
"column_2": "column_2-1001",
|
||||
"column_3": "column_3-1001",
|
||||
"column_4": "column_4-1001",
|
||||
"column_5": "column_5-1001",
|
||||
"column_6": "column_6-1001",
|
||||
"column_7": "column_7-1001",
|
||||
"column_8": "column_8-1001",
|
||||
"column_9": "column_9-1001",
|
||||
"id": 1001
|
||||
},
|
||||
"column_0": "column_0-1001",
|
||||
"column_1": "column_1-1001",
|
||||
"column_2": "column_2-1001",
|
||||
"column_3": "column_3-1001",
|
||||
"column_4": "column_4-1001",
|
||||
"column_5": "column_5-1001",
|
||||
"column_6": "column_6-1001",
|
||||
"column_7": "column_7-1001",
|
||||
"column_8": "column_8-1001",
|
||||
"column_9": "column_9-1001",
|
||||
"id": 1001
|
||||
},
|
||||
{
|
||||
"_ctx": {
|
||||
"connection_name": "chaos"
|
||||
{
|
||||
"column_0": "column_0-1002",
|
||||
"column_1": "column_1-1002",
|
||||
"column_2": "column_2-1002",
|
||||
"column_3": "column_3-1002",
|
||||
"column_4": "column_4-1002",
|
||||
"column_5": "column_5-1002",
|
||||
"column_6": "column_6-1002",
|
||||
"column_7": "column_7-1002",
|
||||
"column_8": "column_8-1002",
|
||||
"column_9": "column_9-1002",
|
||||
"id": 1002
|
||||
},
|
||||
"column_0": "column_0-1002",
|
||||
"column_1": "column_1-1002",
|
||||
"column_2": "column_2-1002",
|
||||
"column_3": "column_3-1002",
|
||||
"column_4": "column_4-1002",
|
||||
"column_5": "column_5-1002",
|
||||
"column_6": "column_6-1002",
|
||||
"column_7": "column_7-1002",
|
||||
"column_8": "column_8-1002",
|
||||
"column_9": "column_9-1002",
|
||||
"id": 1002
|
||||
},
|
||||
{
|
||||
"_ctx": {
|
||||
"connection_name": "chaos"
|
||||
{
|
||||
"column_0": "column_0-1003",
|
||||
"column_1": "column_1-1003",
|
||||
"column_2": "column_2-1003",
|
||||
"column_3": "column_3-1003",
|
||||
"column_4": "column_4-1003",
|
||||
"column_5": "column_5-1003",
|
||||
"column_6": "column_6-1003",
|
||||
"column_7": "column_7-1003",
|
||||
"column_8": "column_8-1003",
|
||||
"column_9": "column_9-1003",
|
||||
"id": 1003
|
||||
},
|
||||
"column_0": "column_0-1003",
|
||||
"column_1": "column_1-1003",
|
||||
"column_2": "column_2-1003",
|
||||
"column_3": "column_3-1003",
|
||||
"column_4": "column_4-1003",
|
||||
"column_5": "column_5-1003",
|
||||
"column_6": "column_6-1003",
|
||||
"column_7": "column_7-1003",
|
||||
"column_8": "column_8-1003",
|
||||
"column_9": "column_9-1003",
|
||||
"id": 1003
|
||||
},
|
||||
{
|
||||
"_ctx": {
|
||||
"connection_name": "chaos"
|
||||
{
|
||||
"column_0": "column_0-1004",
|
||||
"column_1": "column_1-1004",
|
||||
"column_2": "column_2-1004",
|
||||
"column_3": "column_3-1004",
|
||||
"column_4": "column_4-1004",
|
||||
"column_5": "column_5-1004",
|
||||
"column_6": "column_6-1004",
|
||||
"column_7": "column_7-1004",
|
||||
"column_8": "column_8-1004",
|
||||
"column_9": "column_9-1004",
|
||||
"id": 1004
|
||||
},
|
||||
"column_0": "column_0-1004",
|
||||
"column_1": "column_1-1004",
|
||||
"column_2": "column_2-1004",
|
||||
"column_3": "column_3-1004",
|
||||
"column_4": "column_4-1004",
|
||||
"column_5": "column_5-1004",
|
||||
"column_6": "column_6-1004",
|
||||
"column_7": "column_7-1004",
|
||||
"column_8": "column_8-1004",
|
||||
"column_9": "column_9-1004",
|
||||
"id": 1004
|
||||
},
|
||||
{
|
||||
"_ctx": {
|
||||
"connection_name": "chaos"
|
||||
},
|
||||
"column_0": "column_0-1005",
|
||||
"column_1": "column_1-1005",
|
||||
"column_2": "column_2-1005",
|
||||
"column_3": "column_3-1005",
|
||||
"column_4": "column_4-1005",
|
||||
"column_5": "column_5-1005",
|
||||
"column_6": "column_6-1005",
|
||||
"column_7": "column_7-1005",
|
||||
"column_8": "column_8-1005",
|
||||
"column_9": "column_9-1005",
|
||||
"id": 1005
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
{
|
||||
"column_0": "column_0-1005",
|
||||
"column_1": "column_1-1005",
|
||||
"column_2": "column_2-1005",
|
||||
"column_3": "column_3-1005",
|
||||
"column_4": "column_4-1005",
|
||||
"column_5": "column_5-1005",
|
||||
"column_6": "column_6-1005",
|
||||
"column_7": "column_7-1005",
|
||||
"column_8": "column_8-1005",
|
||||
"column_9": "column_9-1005",
|
||||
"id": 1005
|
||||
}
|
||||
]
|
||||
@@ -1,8 +1,5 @@
|
||||
[
|
||||
{
|
||||
"_ctx": {
|
||||
"connection_name": "chaos"
|
||||
},
|
||||
"column_1": "parallelHydrate1",
|
||||
"column_10": "parallelHydrate10",
|
||||
"column_11": "parallelHydrate11",
|
||||
@@ -25,6 +22,4 @@
|
||||
"column_9": "parallelHydrate9",
|
||||
"id": 0
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
]
|
||||
@@ -1,8 +1,5 @@
|
||||
[
|
||||
{
|
||||
"_ctx": {
|
||||
"connection_name": "chaos"
|
||||
},
|
||||
"hydrate_column_1": "hydrate1-0",
|
||||
"hydrate_column_2": "hydrate2-0-hydrate1-0",
|
||||
"hydrate_column_3": "hydrate3-0-hydrate2-0-hydrate1-0",
|
||||
@@ -10,6 +7,4 @@
|
||||
"hydrate_column_5": "hydrate5-0-hydrate4-0-hydrate1-0",
|
||||
"id": 0
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
]
|
||||
@@ -1,9 +1,12 @@
|
||||
load "$LIB_BATS_ASSERT/load.bash"
|
||||
load "$LIB_BATS_SUPPORT/load.bash"
|
||||
|
||||
@test "select * from chaos.chaos_high_row_count order by column_0" {
|
||||
run steampipe query --output json "select * from chaos.chaos_high_row_count order by column_0 limit 10"
|
||||
assert_equal "$output" "$(cat $TEST_DATA_DIR/expected_1.json)"
|
||||
@test "select from chaos.chaos_high_row_count order by column_0" {
|
||||
run steampipe query --output json "select column_0,column_1,column_2,column_3,column_4,column_5,column_6,column_7,column_8,column_9,id from chaos.chaos_high_row_count order by column_0 limit 10"
|
||||
echo $output > $TEST_DATA_DIR/actual_1.json
|
||||
run jd $TEST_DATA_DIR/actual_1.json $TEST_DATA_DIR/expected_1.json
|
||||
rm -f $TEST_DATA_DIR/actual_1.json
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test "select id, string_column, json_column, boolean_column from chaos.chaos_all_column_types where id='0'" {
|
||||
@@ -11,17 +14,17 @@ load "$LIB_BATS_SUPPORT/load.bash"
|
||||
assert_equal "$output" "$(cat $TEST_DATA_DIR/expected_2.json)"
|
||||
}
|
||||
|
||||
@test "select * from chaos.chaos_high_column_count order by column_0" {
|
||||
@test "select from chaos.chaos_high_column_count order by column_0" {
|
||||
run steampipe query --output json "select * from chaos.chaos_high_column_count order by column_0 limit 10"
|
||||
assert_equal "$output" "$(cat $TEST_DATA_DIR/expected_3.json)"
|
||||
}
|
||||
|
||||
@test "select * from chaos.chaos_hydrate_columns_dependency where id='0'" {
|
||||
run steampipe query --output json "select * from chaos.chaos_hydrate_columns_dependency where id='0'"
|
||||
@test "select from chaos.chaos_hydrate_columns_dependency where id='0'" {
|
||||
run steampipe query --output json "select hydrate_column_1,hydrate_column_2,hydrate_column_3,hydrate_column_4,hydrate_column_5,id from chaos.chaos_hydrate_columns_dependency where id='0'"
|
||||
assert_equal "$output" "$(cat $TEST_DATA_DIR/expected_5.json)"
|
||||
}
|
||||
|
||||
@test "select * from chaos.chaos_list_error" {
|
||||
@test "select from chaos.chaos_list_error" {
|
||||
run steampipe query "select fatal_error from chaos.chaos_list_errors"
|
||||
assert_output --partial 'fatalError'
|
||||
}
|
||||
@@ -37,13 +40,13 @@ load "$LIB_BATS_SUPPORT/load.bash"
|
||||
assert_output --partial 'TRANSFORM ERROR'
|
||||
}
|
||||
|
||||
@test "select * from chaos.chaos_hydrate_delay" {
|
||||
@test "select from chaos.chaos_hydrate_delay" {
|
||||
run steampipe query --output json "select delay from chaos.chaos_hydrate_errors order by id"
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test "select * from chaos.chaos_parallel_hydrate_columns where id='0'" {
|
||||
run steampipe query --output json "select * from chaos.chaos_parallel_hydrate_columns where id='0'"
|
||||
@test "select from chaos.chaos_parallel_hydrate_columns where id='0'" {
|
||||
run steampipe query --output json "select column_1,column_10,column_11,column_12,column_13,column_14,column_15,column_16,column_17,column_18,column_19,column_2,column_20,column_3,column_4,column_5,column_6,column_7,column_8,column_9,id from chaos.chaos_parallel_hydrate_columns where id='0'"
|
||||
assert_equal "$output" "$(cat $TEST_DATA_DIR/expected_11.json)"
|
||||
}
|
||||
|
||||
|
||||
@@ -129,7 +129,7 @@ load "$LIB_BATS_SUPPORT/load.bash"
|
||||
steampipe query "select 1"
|
||||
|
||||
# check regions in connection config is being parsed and used
|
||||
run steampipe query "select * from chaos6.chaos_regions order by id" --output json
|
||||
run steampipe query "select id,region_name from chaos6.chaos_regions order by id" --output json
|
||||
result=$(echo $output | tr -d '[:space:]')
|
||||
# set the trimmed result as output
|
||||
run echo $result
|
||||
@@ -138,7 +138,7 @@ load "$LIB_BATS_SUPPORT/load.bash"
|
||||
# remove the config file
|
||||
rm -f $STEAMPIPE_INSTALL_DIR/config/chaos_options.spc
|
||||
# check output
|
||||
assert_output --partial '[{"_ctx":{"connection_name":"chaos6"},"id":0,"region_name":"us-east-1"},{"_ctx":{"connection_name":"chaos6"},"id":3,"region_name":"us-west-2"}]'
|
||||
assert_output --partial '[{"id":0,"region_name":"us-east-1"},{"id":3,"region_name":"us-west-2"}]'
|
||||
|
||||
}
|
||||
|
||||
@@ -148,7 +148,7 @@ load "$LIB_BATS_SUPPORT/load.bash"
|
||||
steampipe query "select 1"
|
||||
|
||||
# check regions in connection config is being parsed and used
|
||||
run steampipe query "select * from chaos6.chaos_regions order by id" --output json
|
||||
run steampipe query "select id,region_name from chaos6.chaos_regions order by id" --output json
|
||||
result=$(echo $output | tr -d '[:space:]')
|
||||
# set the trimmed result as output
|
||||
run echo $result
|
||||
@@ -157,7 +157,7 @@ load "$LIB_BATS_SUPPORT/load.bash"
|
||||
# remove the config file
|
||||
rm -f $STEAMPIPE_INSTALL_DIR/config/chaos_options.yml
|
||||
# check output
|
||||
assert_output --partial '[{"_ctx":{"connection_name":"chaos6"},"id":0,"region_name":"us-east-1"},{"_ctx":{"connection_name":"chaos6"},"id":3,"region_name":"us-west-2"}]'
|
||||
assert_output --partial '[{"id":0,"region_name":"us-east-1"},{"id":3,"region_name":"us-west-2"}]'
|
||||
|
||||
}
|
||||
|
||||
@@ -167,7 +167,7 @@ load "$LIB_BATS_SUPPORT/load.bash"
|
||||
steampipe query "select 1"
|
||||
|
||||
# check regions in connection config is being parsed and used
|
||||
run steampipe query "select * from chaos6.chaos_regions order by id" --output json
|
||||
run steampipe query "select id,region_name from chaos6.chaos_regions order by id" --output json
|
||||
result=$(echo $output | tr -d '[:space:]')
|
||||
# set the trimmed result as output
|
||||
run echo $result
|
||||
@@ -176,7 +176,7 @@ load "$LIB_BATS_SUPPORT/load.bash"
|
||||
# remove the config file
|
||||
rm -f $STEAMPIPE_INSTALL_DIR/config/chaos_options.json
|
||||
# check output
|
||||
assert_output --partial '[{"_ctx":{"connection_name":"chaos6"},"id":0,"region_name":"us-east-1"},{"_ctx":{"connection_name":"chaos6"},"id":3,"region_name":"us-west-2"}]'
|
||||
assert_output --partial '[{"id":0,"region_name":"us-east-1"},{"id":3,"region_name":"us-west-2"}]'
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user