hiptest-publisher 0.9.8 → 0.9.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dafc5dfdf0de42de34e5dba12de8ac5d2b3463e1
4
- data.tar.gz: 600001c5fc8d3cf9a398e54d76a18527bc5b25a5
3
+ metadata.gz: a733baff130f78a8a1695ca9e8e15380dda70da0
4
+ data.tar.gz: 9fc7f0cdbac553dd37ca9f726f98731c18ac0646
5
5
  SHA512:
6
- metadata.gz: e30f8008bfcf48ad8c14d2d96df8b6a942808ad4c5289d7639be1717aec9c48154856e1bf47db5ebaf415d0fec2bfe66ed1328929569fe34b8cb25c38afe4025
7
- data.tar.gz: 4918aab98a0caa979804da35d431da6e7f74f4edfb4f68a72f9ddd25ee1835233215eb0ed271c712824ede6fc81251b9fec7065a55c5ebcb0e6c52f566ec24fe
6
+ metadata.gz: 2355912ebe0c855c052a0964ebf6d2a4a0f015522bf46a609943e1c586a5110f20f5eb285dfc2a46b4a2c7081741c181d6c9a134448e05e41cc797c35a635bf2
7
+ data.tar.gz: a4f75d9273d04286526362fe1de6709b6cbac851d132102184958c86cd3ccb275e012a0095d5160aa30152740e2f80754dab97f8064c8bc4663f01bc57120a53
data/README.md CHANGED
@@ -71,7 +71,6 @@ You could obtain for example:
71
71
 
72
72
  ```shell
73
73
  Exports tests from Hiptest for automation.
74
-
75
74
  Specific options:
76
75
  -t, --token=TOKEN Secret token (available in your project settings)
77
76
  -l, --language=LANG Target language (default: ruby)
@@ -80,9 +79,8 @@ Specific options:
80
79
  -c, --config-file=PATH Configuration file
81
80
  --overriden-templates=PATH Folder for overriden templates
82
81
  --test-run-id=ID Export data from a test run
83
- --scenario-ids=IDS Filter scenarios by ids
84
- --scenario-tags=TAGS Filter scenarios by tags
85
82
  --only=CATEGORIES Restrict export to given file categories (--only=list to list them)
83
+ -x, --xml-file=PROJECT_XML XML file to use instead of fetching it from Hiptest
86
84
  --tests-only (deprecated) alias for --only=tests (default: false)
87
85
  --actionwords-only (deprecated) alias for --only=actionwords (default: false)
88
86
  --actionwords-signature Export actionwords signature (default: false)
@@ -92,12 +90,13 @@ Specific options:
92
90
  --show-actionwords-renamed Output signatures of renamed action words (default: false)
93
91
  --show-actionwords-signature-changed
94
92
  Output signatures of action words for which signature changed (default: false)
95
- --with-folders Use folders hierarchy to export files in respective directories, to be used with --split-scenarios (default: false)
93
+ --with-folders Use folders hierarchy to export files in respective directories (default: false)
96
94
  --split-scenarios Export each scenario in a single file (default: false)
97
95
  --leafless-export Use only last level action word (default: false)
98
96
  -s, --site=SITE Site to fetch from (default: https://hiptest.net)
99
97
  -p, --push=FILE.TAP Push a results file to the server
100
98
  --push-format=tap Format of the test results (tap, junit, robot) (default: tap)
99
+ --sort=[id,order,alpha] Sorting of tests in output: id will sort them by age, order will keep the same order than in hiptest (only with --with-folders option, will fallback to id otherwise), alpha will sort them by name (default: order)
101
100
  -v, --verbose Run verbosely (default: false)
102
101
  -H, --languages-help Show languages and framework options
103
102
  -F, --filters-help Show help about scenario filtering
@@ -6,16 +6,26 @@ require 'hiptest-publisher/formatters/console_formatter'
6
6
  require 'hiptest-publisher/utils'
7
7
 
8
8
  class FileConfigParser
9
+ FALSY_VALUE_PATTERN = /\A(false|no|0)\Z/i
10
+
9
11
  def self.update_options(options, reporter)
10
12
  config = ParseConfig.new(options.config)
11
13
  config.get_params.each do |param|
12
14
  next if options.__cli_args && options.__cli_args.include?(param.to_sym)
13
- options[param] = config[param]
15
+ if falsy?(config[param])
16
+ options[param] = false
17
+ else
18
+ options[param] = config[param]
19
+ end
14
20
  options.__config_args << param.to_sym if options.__config_args
15
21
  end
16
22
  rescue => err
17
23
  reporter.dump_error(err)
18
24
  end
25
+
26
+ def self.falsy?(value)
27
+ FALSY_VALUE_PATTERN.match(value)
28
+ end
19
29
  end
20
30
 
21
31
  class Option
@@ -138,8 +148,6 @@ class OptionsParser
138
148
  Option.new('c', 'config-file=PATH', nil, String, "Configuration file", :config),
139
149
  Option.new(nil, 'overriden-templates=PATH', '', String, "Folder for overriden templates", :overriden_templates),
140
150
  Option.new(nil, 'test-run-id=ID', '', String, "Export data from a test run", :test_run_id),
141
- Option.new(nil, 'scenario-ids=IDS', '', String, "Filter scenarios by ids", :filter_ids),
142
- Option.new(nil, 'scenario-tags=TAGS', '', String, "Filter scenarios by tags", :filter_tags),
143
151
  Option.new(nil, 'only=CATEGORIES', nil, String, "Restrict export to given file categories (--only=list to list them)", :only),
144
152
  Option.new('x', 'xml-file=PROJECT_XML', nil, String, "XML file to use instead of fetching it from Hiptest", :xml_file),
145
153
  Option.new(nil, 'tests-only', false, nil, "(deprecated) alias for --only=tests", :tests_only),
@@ -150,13 +158,13 @@ class OptionsParser
150
158
  Option.new(nil, 'show-actionwords-created', false, nil, "Output code for new action words", :aw_created),
151
159
  Option.new(nil, 'show-actionwords-renamed', false, nil, "Output signatures of renamed action words", :aw_renamed),
152
160
  Option.new(nil, 'show-actionwords-signature-changed', false, nil, "Output signatures of action words for which signature changed", :aw_signature_changed),
153
- Option.new(nil, 'with-folders', false, nil, "Use folders hierarchy to export files in respective directories, to be used with --split-scenarios", :with_folders),
161
+ Option.new(nil, 'with-folders', false, nil, "Use folders hierarchy to export files in respective directories", :with_folders),
154
162
  Option.new(nil, 'split-scenarios', false, nil, "Export each scenario in a single file", :split_scenarios),
155
163
  Option.new(nil, 'leafless-export', false, nil, "Use only last level action word", :leafless_export),
156
164
  Option.new('s', 'site=SITE', 'https://hiptest.net', String, "Site to fetch from", :site),
157
165
  Option.new('p', 'push=FILE.TAP', '', String, "Push a results file to the server", :push),
158
166
  Option.new(nil, 'push-format=tap', 'tap', String, "Format of the test results (tap, junit, robot)", :push_format),
159
- Option.new(nil, 'sort=[id,order,alpha]', 'order', String, "Sorting of tests in output: id will sort them by age, order will keep the same order than in hiptest, alpha will sort them by name", :sort),
167
+ Option.new(nil, 'sort=[id,order,alpha]', 'order', String, "Sorting of tests in output: id will sort them by age, order will keep the same order than in hiptest (only with --with-folders option, will fallback to id otherwise), alpha will sort them by name", :sort),
160
168
  Option.new('v', 'verbose', false, nil, "Run verbosely", :verbose)
161
169
  ]
162
170
  end
@@ -35,21 +35,13 @@ def singularize(name)
35
35
  name.to_s.chomp("s")
36
36
  end
37
37
 
38
- def make_filter(options)
39
- ids = options.filter_ids.split(',').map {|id| "filter[]=id:#{id}"}
40
- tags = options.filter_tags.split(',').map {|tag| "filter[]=tag:#{tag}"}
41
-
42
- filter = (ids + tags).join("&")
43
- filter.empty? ? '' : "?#{filter}"
44
- end
45
-
46
38
  def make_url(options)
47
39
  if push?(options)
48
40
  "#{options.site}/import_test_results/#{options.token}/#{options.push_format}"
49
41
  else
50
42
  base_url = "#{options.site}/publication/#{options.token}"
51
43
  if options.test_run_id.nil? || options.test_run_id.empty?
52
- "#{base_url}/#{options.leafless_export ? 'leafless_tests' : 'project'}#{make_filter(options)}"
44
+ "#{base_url}/#{options.leafless_export ? 'leafless_tests' : 'project'}"
53
45
  else
54
46
  "#{base_url}/test_run/#{options.test_run_id}"
55
47
  end
@@ -1,4 +1 @@
1
- {{{ underscore rendered_children.name }}}{{#if rendered_children.uid}}_uid{{{ normalize rendered_children.uid}}}{{/if}}{{#indent}}
2
- {{#if has_parameters?}}[Arguments]{{{ tab }}}{{{ join rendered_children.parameters "\t"}}}
3
- {{/if}}{{#each rendered_children.body}}{{{ this }}}
4
- {{/each}}{{/indent}}
1
+ {{{ underscore rendered_children.name }}}{{#if rendered_children.uid}}_uid{{{ normalize rendered_children.uid}}}{{/if}}{{> keyword_body}}
@@ -0,0 +1,4 @@
1
+ {{#indent}}
2
+ {{#if has_parameters?}}[Arguments]{{{ tab }}}{{{ join rendered_children.parameters "\t"}}}
3
+ {{/if}}{{#each rendered_children.body}}{{{ this }}}
4
+ {{/each}}{{/indent}}
@@ -1 +1 @@
1
- {{> keyword}}
1
+ {{{ underscore rendered_children.name }}}{{> keyword_body}}
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hiptest-publisher
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.8
4
+ version: 0.9.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hiptest R&D
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-26 00:00:00.000000000 Z
11
+ date: 2016-01-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize
@@ -488,6 +488,7 @@ files:
488
488
  - lib/templates/python/unaryexpression.hbs
489
489
  - lib/templates/python/while.hbs
490
490
  - lib/templates/robotframework/_keyword.hbs
491
+ - lib/templates/robotframework/_keyword_body.hbs
491
492
  - lib/templates/robotframework/_scenario.hbs
492
493
  - lib/templates/robotframework/actionword.hbs
493
494
  - lib/templates/robotframework/actionwords.hbs