Add deprecation warnings for Mod commands

* print errors and warnings to stderr
* fix tests
* Update description
* update sample workspace profile content
* Changelog for v0.22.0
This commit is contained in:
Puskar Basu
2024-03-06 16:43:17 +05:30
committed by GitHub
parent b4f15ebfd4
commit 410fe9ef6f
13 changed files with 136 additions and 99 deletions

View File

@@ -262,48 +262,6 @@
"watch": false
}
},
{
"test": "options set in default workspace profile(2) and check cmd is run(same test as above but tests check args)",
"description": "",
"cmd": "check",
"setup": {
"env": [
"STEAMPIPE_WORKSPACE_PROFILES_LOCATION=workspace_profiles_options"
],
"args": []
},
"expected": {
"check.header": false,
"check.output": "json",
"check.separator": "|",
"check.timing": true,
"query-timeout": 240,
"search-path": "[ ]",
"search-path-prefix": "[ abc ]",
"telemetry": "info",
"update-check": "false",
"watch": false
}
},
{
"test": "options set in default workspace profile(2) and dashboard cmd is run(same test as above but tests dashboard args)",
"description": "",
"cmd": "dashboard",
"setup": {
"env": [
"STEAMPIPE_WORKSPACE_PROFILES_LOCATION=workspace_profiles_options"
],
"args": []
},
"expected": {
"browser": true,
"search-path": "[ ]",
"search-path-prefix": "[ abc ]",
"telemetry": "info",
"update-check": "false",
"watch": false
}
},
{
"test": "default workspace location set and env variables set(3)",
"description": "",

View File

@@ -40,7 +40,7 @@ load "$LIB_BATS_SUPPORT/load.bash"
cd $CONTROL_RENDERING_TEST_MOD
export STEAMPIPE_DISPLAY_WIDTH=100
run steampipe check control.control_long_title --progress=false --theme=plain
assert_equal "$output" "$(cat $TEST_DATA_DIR/expected_long_title.txt)"
assert_output --partial "$(cat $TEST_DATA_DIR/expected_long_title.txt)"
cd -
}
@@ -48,7 +48,7 @@ load "$LIB_BATS_SUPPORT/load.bash"
cd $CONTROL_RENDERING_TEST_MOD
export STEAMPIPE_DISPLAY_WIDTH=100
run steampipe check control.control_short_title --progress=false --theme=plain
assert_equal "$output" "$(cat $TEST_DATA_DIR/expected_short_title.txt)"
assert_output --partial "$(cat $TEST_DATA_DIR/expected_short_title.txt)"
cd -
}
@@ -56,7 +56,7 @@ load "$LIB_BATS_SUPPORT/load.bash"
cd $CONTROL_RENDERING_TEST_MOD
export STEAMPIPE_DISPLAY_WIDTH=100
run steampipe check control.control_unicode_title --progress=false --theme=plain
assert_equal "$output" "$(cat $TEST_DATA_DIR/expected_unicode_title.txt)"
assert_output --partial "$(cat $TEST_DATA_DIR/expected_unicode_title.txt)"
cd -
}
@@ -64,7 +64,7 @@ load "$LIB_BATS_SUPPORT/load.bash"
cd $CONTROL_RENDERING_TEST_MOD
export STEAMPIPE_DISPLAY_WIDTH=100
run steampipe check control.control_long_short_unicode_reasons --progress=false --theme=plain
assert_equal "$output" "$(cat $TEST_DATA_DIR/expected_reasons.txt)"
assert_output --partial "$(cat $TEST_DATA_DIR/expected_reasons.txt)"
cd -
}
@@ -72,7 +72,7 @@ load "$LIB_BATS_SUPPORT/load.bash"
cd $CONTROL_RENDERING_TEST_MOD
export STEAMPIPE_DISPLAY_WIDTH=100
run steampipe check control.sample_control_mixed_results_1 --progress=false --theme=plain
assert_equal "$output" "$(cat $TEST_DATA_DIR/expected_mixed_results.txt)"
assert_output --partial "$(cat $TEST_DATA_DIR/expected_mixed_results.txt)"
cd -
}
@@ -80,7 +80,7 @@ load "$LIB_BATS_SUPPORT/load.bash"
cd $CONTROL_RENDERING_TEST_MOD
export STEAMPIPE_DISPLAY_WIDTH=100
run steampipe check control.sample_control_all_alarms --progress=false --theme=plain
assert_equal "$output" "$(cat $TEST_DATA_DIR/expected_all_alarm.txt)"
assert_output --partial "$(cat $TEST_DATA_DIR/expected_all_alarm.txt)"
cd -
}
@@ -88,21 +88,21 @@ load "$LIB_BATS_SUPPORT/load.bash"
cd $BLANK_DIMENSION_VALUE_TEST_MOD
export STEAMPIPE_DISPLAY_WIDTH=100
run steampipe check all --progress=false --theme=plain
assert_equal "$output" "$(cat $TEST_DATA_DIR/expected_blank_dimension.txt)"
assert_output --partial "$(cat $TEST_DATA_DIR/expected_blank_dimension.txt)"
cd -
}
@test "steampipe check - output csv - no header" {
cd $CONTROL_RENDERING_TEST_MOD
run steampipe check control.sample_control_mixed_results_1 --output=csv --progress=false --header=false
assert_equal "$output" "$(cat $TEST_DATA_DIR/expected_check_csv_noheader.csv)"
assert_output --partial "$(cat $TEST_DATA_DIR/expected_check_csv_noheader.csv)"
cd -
}
@test "steampipe check - output csv(check tags and dimensions sorting)" {
cd $CONTROL_RENDERING_TEST_MOD
run steampipe check control.sample_control_sorted_tags_and_dimensions --output=csv --progress=false
assert_equal "$output" "$(cat $TEST_DATA_DIR/expected_check_csv_sorted_tags.csv)"
assert_output --partial "$(cat $TEST_DATA_DIR/expected_check_csv_sorted_tags.csv)"
cd -
}

View File

@@ -3,7 +3,7 @@ load "$LIB_BATS_SUPPORT/load.bash"
@test "list with no mods installed" {
run steampipe mod list
assert_output 'No mods installed.'
assert_output --partial 'No mods installed.'
}
@test "install latest(plugin requirement not satisfied)" {
@@ -23,13 +23,13 @@ local
@test "install latest and then run install" {
steampipe mod install github.com/turbot/steampipe-mod-aws-compliance --force
run steampipe mod install
assert_output 'All mods are up to date'
assert_output --partial 'All mods are up to date'
}
@test "install mod and list" {
steampipe mod install github.com/turbot/steampipe-mod-aws-compliance@0.10 --force
run steampipe mod list
assert_output '
assert_output --partial '
local
└── github.com/turbot/steampipe-mod-aws-compliance@v0.10.0'
}
@@ -37,7 +37,7 @@ local
@test "install old version when latest already installed" {
steampipe mod install github.com/turbot/steampipe-mod-aws-compliance --force
run steampipe mod install github.com/turbot/steampipe-mod-aws-compliance@0.1
assert_output '
assert_output --partial '
Downgraded 1 mod:
local
@@ -52,7 +52,7 @@ local
# should install the same cached version
# better message
assert_output '
assert_output --partial '
Installed 1 mod:
local
@@ -67,7 +67,7 @@ local
# should install the same cached version
# better message
assert_output '
assert_output --partial '
Installed 1 mod:
local
@@ -80,9 +80,10 @@ local
}
@test "install a mod with protocol in url" {
run steampipe mod install https://github.com/turbot/steampipe-mod-hackernews-insights@0.4.0 --force
skip
run steampipe mod install https://github.com/turbot/steampipe-mod-hackernews-insights@0.4.0
# should install with the protocol in the url prefix
assert_output '
assert_output --partial '
Installed 1 mod:
local
@@ -99,7 +100,7 @@ local
@test "complex mod dependency resolution - test tree structure" {
run steampipe mod install github.com/pskrbasu/steampipe-mod-top-level
# test the tree structure output
assert_output '
assert_output --partial '
Installed 4 mods:
local
@@ -120,7 +121,7 @@ local
# +--------+----------+--------+
# | 4 | 4 | alarm |
# +--------+----------+--------+
assert_output 'group_id,title,description,control_id,control_title,control_description,reason,resource,status,severity
assert_output --partial 'group_id,title,description,control_id,control_title,control_description,reason,resource,status,severity
top_level.benchmark.bm_version_dependency_mod_1,Benchmark version dependency mod 1,,dependency_1.control.version,,,4,4,alarm,'
}
@@ -135,7 +136,7 @@ top_level.benchmark.bm_version_dependency_mod_1,Benchmark version dependency mod
# +--------+----------+--------+
# | 3 | 3 | ok |
# +--------+----------+--------+
assert_output 'group_id,title,description,control_id,control_title,control_description,reason,resource,status,severity
assert_output --partial 'group_id,title,description,control_id,control_title,control_description,reason,resource,status,severity
top_level.benchmark.bm_version_dependency_mod_2,Benchmark version dependency mod 2,,dependency_2.control.version,,,3,3,ok,'
}