Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Add config tests. Closes #3702 #3708

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/release_cli_and_assets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ jobs:
- "service"
- "settings"
- "search_path"
- "config"
- "chaos_and_query"
- "dynamic_schema"
- "dynamic_aggregators"
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ jobs:
- "installation"
- "service_and_plugin"
- "blank_aggregators"
- "config"
- "service"
- "settings"
- "search_path"
Expand Down
7 changes: 7 additions & 0 deletions pkg/cmdconfig/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ package cmdconfig

import (
"fmt"
"os"

"github.com/spf13/cobra"
"github.com/spf13/pflag"
"github.com/spf13/viper"
"github.com/turbot/steampipe/pkg/constants"
"github.com/turbot/steampipe/pkg/utils"
)

Expand Down Expand Up @@ -46,6 +48,11 @@ func OnCmd(cmd *cobra.Command) *CmdBuilder {
utils.LogTime(fmt.Sprintf("cmd.%s.Run start", cmd.CommandPath()))
defer utils.LogTime(fmt.Sprintf("cmd.%s.Run end", cmd.CommandPath()))

// if diagnostic mode is set, print out config and return
if _, ok := os.LookupEnv(constants.EnvDiagnostics); ok {
DisplayConfig()
return
}
// run the original Run
if originalRun != nil {
originalRun(cmd, args)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
options "database" {
port = 9193
listen = "local"
search_path = "abc,def"
search_path_prefix = "def"
start_timeout = 30
cache = true
cache_max_ttl = 900
cache_max_size_mb = 1024
}

options "dashboard" {
port = 9193
listen = "local"
}

options "general" {
update_check = true
telemetry = "info"
max_parallel = 1
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This is a test directory created to run acceptance tests.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This is a test directory created to run acceptance tests.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This is a test directory created to run acceptance tests.
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
workspace "default" {
cloud_host = "latestpipe.turbot.io/"
cloud_token = "spt_012faketoken34567890_012faketoken3456789099999"
mod_location = "sp_install_dir_default"
snapshot_location = "snaps"
workspace_database = "fk43e7"
search_path = ""
search_path_prefix = "abc"
watch = false
introspection = "info"
query_timeout = 180
max_parallel = 1
install_dir = "sp_install_dir_default"
theme = "plain"
progress = true
input = false
options "query" {
autocomplete = false
header = false
multi = true
output = "json"
separator = "|"
timing = true
}
options "check" {
header = false
output = "json"
separator = "|"
timing = true
}
options "dashboard" {
browser = true
}
}

workspace "sample" {
cloud_host = "testpipe.turbot.io/"
cloud_token = "spt_012faketoken34567890_012faketoken3456789099998"
mod_location = "sp_install_dir_sample"
snapshot_location = "snaps2"
workspace_database = "fk43e6"
search_path = "abc,def"
search_path_prefix = "abc"
watch = true
introspection = "control"
query_timeout = 200
max_parallel = 2
install_dir = "sp_install_dir_sample"
theme = "dark"
progress = false
input = true
options "query" {
autocomplete = true
header = true
multi = false
output = "csv"
separator = ","
timing = false
}
options "check" {
header = true
output = "csv"
separator = ","
timing = false
}
options "dashboard" {
browser = false
}
}
Loading
Loading