mirror of
https://github.com/turbot/steampipe.git
synced 2025-12-25 03:00:48 -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,8 +1,5 @@
|
||||
[
|
||||
{
|
||||
"_ctx": {
|
||||
"connection_name": "chaos"
|
||||
},
|
||||
"column_0": "column_0-0",
|
||||
"column_1": "column_1-0",
|
||||
"column_2": "column_2-0",
|
||||
@@ -16,9 +13,6 @@
|
||||
"id": 0
|
||||
},
|
||||
{
|
||||
"_ctx": {
|
||||
"connection_name": "chaos"
|
||||
},
|
||||
"column_0": "column_0-1",
|
||||
"column_1": "column_1-1",
|
||||
"column_2": "column_2-1",
|
||||
@@ -32,9 +26,6 @@
|
||||
"id": 1
|
||||
},
|
||||
{
|
||||
"_ctx": {
|
||||
"connection_name": "chaos"
|
||||
},
|
||||
"column_0": "column_0-10",
|
||||
"column_1": "column_1-10",
|
||||
"column_2": "column_2-10",
|
||||
@@ -48,9 +39,6 @@
|
||||
"id": 10
|
||||
},
|
||||
{
|
||||
"_ctx": {
|
||||
"connection_name": "chaos"
|
||||
},
|
||||
"column_0": "column_0-100",
|
||||
"column_1": "column_1-100",
|
||||
"column_2": "column_2-100",
|
||||
@@ -64,9 +52,6 @@
|
||||
"id": 100
|
||||
},
|
||||
{
|
||||
"_ctx": {
|
||||
"connection_name": "chaos"
|
||||
},
|
||||
"column_0": "column_0-1000",
|
||||
"column_1": "column_1-1000",
|
||||
"column_2": "column_2-1000",
|
||||
@@ -80,9 +65,6 @@
|
||||
"id": 1000
|
||||
},
|
||||
{
|
||||
"_ctx": {
|
||||
"connection_name": "chaos"
|
||||
},
|
||||
"column_0": "column_0-1001",
|
||||
"column_1": "column_1-1001",
|
||||
"column_2": "column_2-1001",
|
||||
@@ -96,9 +78,6 @@
|
||||
"id": 1001
|
||||
},
|
||||
{
|
||||
"_ctx": {
|
||||
"connection_name": "chaos"
|
||||
},
|
||||
"column_0": "column_0-1002",
|
||||
"column_1": "column_1-1002",
|
||||
"column_2": "column_2-1002",
|
||||
@@ -112,9 +91,6 @@
|
||||
"id": 1002
|
||||
},
|
||||
{
|
||||
"_ctx": {
|
||||
"connection_name": "chaos"
|
||||
},
|
||||
"column_0": "column_0-1003",
|
||||
"column_1": "column_1-1003",
|
||||
"column_2": "column_2-1003",
|
||||
@@ -128,9 +104,6 @@
|
||||
"id": 1003
|
||||
},
|
||||
{
|
||||
"_ctx": {
|
||||
"connection_name": "chaos"
|
||||
},
|
||||
"column_0": "column_0-1004",
|
||||
"column_1": "column_1-1004",
|
||||
"column_2": "column_2-1004",
|
||||
@@ -144,9 +117,6 @@
|
||||
"id": 1004
|
||||
},
|
||||
{
|
||||
"_ctx": {
|
||||
"connection_name": "chaos"
|
||||
},
|
||||
"column_0": "column_0-1005",
|
||||
"column_1": "column_1-1005",
|
||||
"column_2": "column_2-1005",
|
||||
@@ -160,5 +130,3 @@
|
||||
"id": 1005
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
[
|
||||
{
|
||||
"_ctx": {
|
||||
"connection_name": "chaos"
|
||||
},
|
||||
"column_1": "parallelHydrate1",
|
||||
"column_10": "parallelHydrate10",
|
||||
"column_11": "parallelHydrate11",
|
||||
@@ -26,5 +23,3 @@
|
||||
"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",
|
||||
@@ -11,5 +8,3 @@
|
||||
"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