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

service stop should not trigger daily checks and tasks. Closes #745 #748

Merged
merged 5 commits into from
Aug 5, 2021

Conversation

binaek
Copy link
Contributor

@binaek binaek commented Aug 5, 2021

No description provided.

@binaek binaek added the house-keeping General stuff which take time, but doesn't necessarily require new knowledge or is high priority label Aug 5, 2021
@binaek binaek requested a review from kaidaguerre August 5, 2021 09:09
@binaek binaek self-assigned this Aug 5, 2021
@binaek binaek linked an issue Aug 5, 2021 that may be closed by this pull request
task/runner.go Outdated
@@ -93,6 +93,10 @@ func (r *Runner) shouldRun() bool {
// we will not run scheduled tasks in this mode
return false
}
if cmd.Parent() != nil && cmd.Parent().Name() == "service" && cmd.Name() == "stop" {
Copy link
Contributor

@kaidaguerre kaidaguerre Aug 5, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wrap

cmd.Name() == "query" && len(cmdArgs) > 0 

and

cmd.Parent() != nil && cmd.Parent().Name() == "service" && cmd.Name() == "stop"

into functions
isQueryInBatchMode() and isServiceStop

@pskrbasu
Copy link
Contributor

pskrbasu commented Aug 5, 2021

pskrbasu@Puskars-MacBook-Pro steampipe (service_stop_no_checks_745) $ ./tests/acceptance/run-local.sh
 ____  _             _   _               _____         _       
/ ___|| |_ __ _ _ __| |_(_)_ __   __ _  |_   _|__  ___| |_ ___ 
\___ \| __/ _` | '__| __| | '_ \ / _` |   | |/ _ \/ __| __/ __|
 ___) | || (_| | |  | |_| | | | | (_| |   | |  __/\__ \ |_\__ \
|____/ \__\__,_|_|   \__|_|_| |_|\__, |   |_|\___||___/\__|___/
                                 |___/                         
Running with STEAMPIPE_INSTALL_DIR set to /var/folders/50/55rzkdc54sz_08406wysm8l00000gn/T/tmp.VrrOz3Fx
1..70
ok 1 steampipe install
ok 2 steampipe plugin help is displayed when no sub command given
ok 3 steampipe service help is displayed when no sub command given
ok 4 scheduled task run - no update check when disabled in config - TEST DISABLED
ok 5 scheduled task run - no update check when disabled in ENV - TEST DISABLED
ok 6 steampipe install
ok 7 steampipe service start
ok 8 steampipe service restart
ok 9 steampipe service stop
ok 10 steampipe service start --database-port 8765
ok 11 steampipe service start --database-listen local --database-port 8765
ok 12 steampipe service stop should not trigger daily checks and tasks
ok 13 steampipe plugin install
ok 14 steampipe plugin list
ok 15 steampipe plugin uninstall
ok 16 steampipe query chaos
ok 17 public schema insert select all types
ok 18 query json
ok 19 query csv
ok 20 query line
ok 21 query line long
ok 22 query csv header off
ok 23 query table header off
ok 24 select * from chaos.chaos_high_row_count order by column_0
ok 25 select id, string_column, json_column, boolean_column from chaos.chaos_all_column_types where id='0'
ok 26 select * from chaos.chaos_high_column_count order by column_0
ok 27 select * from chaos.chaos_hydrate_columns_dependency where id='0'
ok 28 select * from chaos.chaos_list_error
ok 29 select panic from chaos.chaos_get_errors where id=0
ok 30 select error from chaos_transform_error
ok 31 select * from chaos.chaos_hydrate_delay
ok 32 select * from chaos.chaos_parallel_hydrate_columns  where id='0'
ok 33 select float32_data, id, int64_data, uint16_data from chaos.chaos_all_numeric_column  where id='31'
ok 34 select transform_method_column from chaos_transforms order by id
ok 35 select parent_should_ignore_error from chaos.chaos_list_parent_child
ok 36 select from_qual_column from chaos_transforms where id=2
ok 37 service start, no config, add connection, query
ok 38 service start, no config, delete connection, query with no restart
ok 39 service start, no config, add connection, query with prefix
ok 40 service start, no config, delete connection, query with prefix
ok 41 service start, no config, query with prefix, add connection, query with prefix
ok 42 service start, no config, query with prefix, delete connection, query with prefix
ok 43 table with header
ok 44 table no header
ok 45 csv header
ok 46 csv no header
ok 47 csv | separator
ok 48 csv | separator no header
ok 49 json
ok 50 line
ok 51 timer on
ok 52 select query install directory
ok 53 named query current folder
ok 54 named query workspace folder
ok 55 sql file
ok 56 sql glob
ok 57 sql glob csv no header
ok 58 steampipe check cis_v130
ok 59 steampipe check cis_v130 - output csv
ok 60 steampipe check cis_v130 - output csv - | separator
ok 61 steampipe check cis_v130 - output csv - no header
ok 62 steampipe check cis_v130 - output json
ok 63 steampipe check cis_v130 - export csv
ok 64 steampipe check cis_v130 - export json
ok 65 steampipe check search_path_prefix when passed through command line
ok 66 steampipe check search_path when passed through command line
ok 67 steampipe check search_path and search_path_prefix when passed through command line
ok 68 steampipe check search_path_prefix when passed in the control
ok 69 steampipe check search_path when passed in the control
ok 70 steampipe check search_path and search_path_prefix when passed in the control

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
house-keeping General stuff which take time, but doesn't necessarily require new knowledge or is high priority
Projects
None yet
Development

Successfully merging this pull request may close these issues.

service stop should not check for updates
3 participants