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

Add config file flag to archive command #568

Merged
merged 1 commit into from Apr 4, 2018
Merged

Add config file flag to archive command #568

merged 1 commit into from Apr 4, 2018

Conversation

antekresic
Copy link
Contributor

Closes #519 and supersedes #520

There might be another issue here, the global flags set for all commands don't make sense all the time. For instance, archive command has support for address flag (or that's what --help shows). It would probably be better to refactor cmd/root.go in a separate PR.

$ ./k6 archive --help
Create an archive.

An archive is a fully self-contained test run, and can be executed identically elsewhere.

Usage:
  k6 archive [flags]

Examples:
  # Archive a test run.
  k6 archive -u 10 -d 10s -O myarchive.tar script.js

  # Run the resulting archive.
  k6 run myarchive.tar

Flags:
  -u, --vus int                         number of virtual users (default 1)
  -m, --max int                         max available virtual users
  -d, --duration duration               test duration limit
  -i, --iterations int                  script iteration limit
  -s, --stage stage                     add a stage, as `[duration]:[target]`
  -p, --paused                          start the test in a paused state
      --max-redirects int               follow at most n redirects (default 10)
      --batch int                       max parallel batch reqs (default 10)
      --batch-per-host int              max parallel batch reqs per host
      --rps int                         limit requests per second
      --user-agent string               user agent for http requests (default "k6/0.20.0 (https://k6.io/);")
      --http-debug string[="headers"]   log all HTTP requests and responses. Excludes body by default. To include body use '---http-debug=full'
      --insecure-skip-tls-verify        skip verification of TLS certificates
      --no-connection-reuse             don't reuse connections between iterations
  -w, --throw                           throw warnings (like failed http requests) as errors
      --blacklist-ip ip range           blacklist an ip range from being called
      --summary-trend-stats stats       define stats for trend metrics (response times), one or more as 'avg,p(95),...'
      --system-tags stringSlice         only include these system tags in metrics (default [proto,subproto,status,method,url,name,group,check,error,tls_version])
      --tag tag                         add a tag to be applied to all samples, as `[name]=[value]`
      --include-system-env-vars         pass the real system environment variables to the runtime
  -e, --env VAR=value                   add/override environment variable with VAR=value
  -O, --archive-out string              archive output filename (default "archive.tar")
  -h, --help                            help for archive

Global Flags:
  -a, --address string     address for the api server (default "localhost:6565")
  -c, --config string      config file (default ./k6.yaml or ~/.config/k6.yaml)
      --logformat string   log output format
      --no-color           disable colored output
  -q, --quiet              disable progress updates
  -v, --verbose            enable debug logging```

Copy link
Member

@na-- na-- left a comment

Choose a reason for hiding this comment

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

LGTM, and I agree that --address probably shouldn't be a global parameter, it doesn't apply for at least archive, inspect, convert and login

@codecov-io
Copy link

Codecov Report

Merging #568 into master will decrease coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #568      +/-   ##
==========================================
- Coverage   63.18%   63.18%   -0.01%     
==========================================
  Files          97       97              
  Lines        7307     7312       +5     
==========================================
+ Hits         4617     4620       +3     
- Misses       2443     2445       +2     
  Partials      247      247
Impacted Files Coverage Δ
cmd/archive.go 18.42% <100%> (+2.2%) ⬆️
cmd/config.go 37.5% <100%> (+4.16%) ⬆️
core/engine.go 89.39% <0%> (-1.02%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b9fb8ef...1d61eb6. Read the comment docs.

@luizbafilho luizbafilho merged commit dccb254 into grafana:master Apr 4, 2018
@antekresic antekresic deleted the fix/archiveConfigFlag branch April 5, 2018 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants