hiptest-publisher 1.23.3 → 1.23.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/hiptest-publisher +14 -9
- data/config/i18n-tasks.yml +137 -0
- data/config/locales/en.yml +236 -0
- data/lib/hiptest-publisher.rb +21 -64
- data/lib/hiptest-publisher/cli_options_checker.rb +35 -69
- data/lib/hiptest-publisher/client.rb +6 -6
- data/lib/hiptest-publisher/formatters/console_formatter.rb +3 -1
- data/lib/hiptest-publisher/formatters/diff_displayer.rb +15 -27
- data/lib/hiptest-publisher/options_parser.rb +68 -67
- data/lib/hiptest-publisher/version_checker.rb +41 -0
- data/lib/hiptest-publisher/xml_parser.rb +1 -1
- metadata +33 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: facac5ecbee2fc12798c6222775b2cdbbd85a6ca
|
4
|
+
data.tar.gz: ee39de0817a8b872bb8e726456ea62ee2ab74cb2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5a6c95bce7bd68e993e8b220c254938fbb328f14a8b72cabab06d95e6d747ba56e7a993146e50b035a0b157998851a9942503a474bb97e45f64f3ce570d2acc4
|
7
|
+
data.tar.gz: 3dfaaca32b03b4a15987d4627b948a912f8fad5c37526413e4af7da4977df6b0225dd1f2395e8d27b5fff7a2f50375903fb96e3b0ab5e2e143a88036975242e1
|
data/bin/hiptest-publisher
CHANGED
@@ -13,26 +13,31 @@
|
|
13
13
|
#
|
14
14
|
|
15
15
|
require 'ruby_version'
|
16
|
+
require 'i18n'
|
17
|
+
require 'hiptest-publisher/utils'
|
18
|
+
|
19
|
+
I18n.load_path << Dir["#{hiptest_publisher_path}/config/locales/*.yml"]
|
16
20
|
|
17
21
|
# Ensure ruby version >= 2
|
18
22
|
if RubyVersion < '2.1.0'
|
19
|
-
STDERR.puts
|
20
|
-
STDERR.puts
|
21
|
-
STDERR.puts
|
23
|
+
STDERR.puts(I18n.t('ruby_version.required_version', version: '2.1.0'))
|
24
|
+
STDERR.puts(I18n.t('ruby_version.current_version', engine: RUBY_ENGINE, version: RUBY_VERSION))
|
25
|
+
STDERR.puts(I18n.t('ruby_version.use_more_recent'))
|
26
|
+
|
22
27
|
if RubyVersion.is? 2.0
|
23
|
-
STDERR.puts
|
28
|
+
STDERR.puts(I18n.('ruby_version.support_ended', version: '2.0.0', year: '2016', month: '02', day: '24'))
|
24
29
|
elsif RubyVersion.is? '1.9.3'
|
25
|
-
STDERR.puts
|
30
|
+
STDERR.puts(I18n.('ruby_version.support_ended', version: '1.9.3', year: '2015', month: '02', day: '23'))
|
26
31
|
elsif RubyVersion.is? '1.9.2'
|
27
|
-
STDERR.puts
|
32
|
+
STDERR.puts(I18n.('ruby_version.support_ended', version: '1.9.2', year: '2014', month: '07', day: '31'))
|
28
33
|
end
|
29
34
|
exit 1
|
30
35
|
end
|
31
36
|
|
32
37
|
if RubyVersion < '2.3'
|
33
|
-
STDERR.puts
|
34
|
-
STDERR.puts
|
35
|
-
STDERR.puts
|
38
|
+
STDERR.puts(I18n.t('ruby_version.current_version', engine: RUBY_ENGINE, version: RUBY_VERSION))
|
39
|
+
STDERR.puts(I18n.t('ruby_version.deprecation_warning', version: '2.2'))
|
40
|
+
STDERR.puts(I18n.t('ruby_version.support_ended', version: '2.2', year: '2018', month: '03', day: '31'))
|
36
41
|
end
|
37
42
|
|
38
43
|
require 'hiptest-publisher'
|
@@ -0,0 +1,137 @@
|
|
1
|
+
# i18n-tasks finds and manages missing and unused translations: https://github.com/glebm/i18n-tasks
|
2
|
+
|
3
|
+
# The "main" locale.
|
4
|
+
base_locale: en
|
5
|
+
## All available locales are inferred from the data by default. Alternatively, specify them explicitly:
|
6
|
+
# locales: [es, fr]
|
7
|
+
## Reporting locale, default: en. Available: en, ru.
|
8
|
+
# internal_locale: en
|
9
|
+
|
10
|
+
# Read and write translations.
|
11
|
+
data:
|
12
|
+
## Translations are read from the file system. Supported format: YAML, JSON.
|
13
|
+
## Provide a custom adapter:
|
14
|
+
# adapter: I18n::Tasks::Data::FileSystem
|
15
|
+
|
16
|
+
# Locale files or `File.find` patterns where translations are read from:
|
17
|
+
read:
|
18
|
+
## Default:
|
19
|
+
# - config/locales/%{locale}.yml
|
20
|
+
## More files:
|
21
|
+
# - config/locales/**/*.%{locale}.yml
|
22
|
+
|
23
|
+
# Locale files to write new keys to, based on a list of key pattern => file rules. Matched from top to bottom:
|
24
|
+
# `i18n-tasks normalize -p` will force move the keys according to these rules
|
25
|
+
write:
|
26
|
+
## For example, write devise and simple form keys to their respective files:
|
27
|
+
# - ['{devise, simple_form}.*', 'config/locales/\1.%{locale}.yml']
|
28
|
+
## Catch-all default:
|
29
|
+
# - config/locales/%{locale}.yml
|
30
|
+
|
31
|
+
# External locale data (e.g. gems).
|
32
|
+
# This data is not considered unused and is never written to.
|
33
|
+
external:
|
34
|
+
## Example (replace %#= with %=):
|
35
|
+
# - "<%#= %x[bundle show vagrant].chomp %>/templates/locales/%{locale}.yml"
|
36
|
+
|
37
|
+
## Specify the router (see Readme for details). Valid values: conservative_router, pattern_router, or a custom class.
|
38
|
+
# router: conservative_router
|
39
|
+
|
40
|
+
yaml:
|
41
|
+
write:
|
42
|
+
# do not wrap lines at 80 characters
|
43
|
+
line_width: -1
|
44
|
+
|
45
|
+
## Pretty-print JSON:
|
46
|
+
# json:
|
47
|
+
# write:
|
48
|
+
# indent: ' '
|
49
|
+
# space: ' '
|
50
|
+
# object_nl: "\n"
|
51
|
+
# array_nl: "\n"
|
52
|
+
|
53
|
+
# Find translate calls
|
54
|
+
search:
|
55
|
+
paths:
|
56
|
+
- bin/hiptest-publisher
|
57
|
+
- lib/
|
58
|
+
- lib/**
|
59
|
+
## Paths or `File.find` patterns to search in:
|
60
|
+
# paths:
|
61
|
+
# - app/
|
62
|
+
|
63
|
+
## Root directories for relative keys resolution.
|
64
|
+
# relative_roots:
|
65
|
+
# - app/controllers
|
66
|
+
# - app/helpers
|
67
|
+
# - app/mailers
|
68
|
+
# - app/presenters
|
69
|
+
# - app/views
|
70
|
+
|
71
|
+
## Files or `File.fnmatch` patterns to exclude from search. Some files are always excluded regardless of this setting:
|
72
|
+
## %w(*.jpg *.png *.gif *.svg *.ico *.eot *.otf *.ttf *.woff *.woff2 *.pdf *.css *.sass *.scss *.less *.yml *.json)
|
73
|
+
exclude:
|
74
|
+
- app/assets/images
|
75
|
+
- app/assets/fonts
|
76
|
+
- app/assets/videos
|
77
|
+
|
78
|
+
## Alternatively, the only files or `File.fnmatch patterns` to search in `paths`:
|
79
|
+
## If specified, this settings takes priority over `exclude`, but `exclude` still applies.
|
80
|
+
# only: ["*.rb", "*.html.slim"]
|
81
|
+
|
82
|
+
## If `strict` is `false`, guess usages such as t("categories.#{category}.title"). The default is `true`.
|
83
|
+
# strict: true
|
84
|
+
|
85
|
+
## Multiple scanners can be used. Their results are merged.
|
86
|
+
## The options specified above are passed down to each scanner. Per-scanner options can be specified as well.
|
87
|
+
## See this example of a custom scanner: https://github.com/glebm/i18n-tasks/wiki/A-custom-scanner-example
|
88
|
+
|
89
|
+
## Translation Services
|
90
|
+
# translation:
|
91
|
+
# # Google Translate
|
92
|
+
# # Get an API key and set billing info at https://code.google.com/apis/console to use Google Translate
|
93
|
+
# google_translate_api_key: "AbC-dEf5"
|
94
|
+
# # DeepL Pro Translate
|
95
|
+
# # Get an API key and subscription at https://www.deepl.com/pro to use DeepL Pro
|
96
|
+
# deepl_api_key: "48E92789-57A3-466A-9959-1A1A1A1A1A1A"
|
97
|
+
|
98
|
+
## Do not consider these keys missing:
|
99
|
+
# ignore_missing:
|
100
|
+
# - 'errors.messages.{accepted,blank,invalid,too_short,too_long}'
|
101
|
+
# - '{devise,simple_form}.*'
|
102
|
+
|
103
|
+
## Consider these keys used:
|
104
|
+
# ignore_unused:
|
105
|
+
# - 'activerecord.attributes.*'
|
106
|
+
# - '{devise,kaminari,will_paginate}.*'
|
107
|
+
# - 'simple_form.{yes,no}'
|
108
|
+
# - 'simple_form.{placeholders,hints,labels}.*'
|
109
|
+
# - 'simple_form.{error_notification,required}.:'
|
110
|
+
|
111
|
+
## Exclude these keys from the `i18n-tasks eq-base' report:
|
112
|
+
# ignore_eq_base:
|
113
|
+
# all:
|
114
|
+
# - common.ok
|
115
|
+
# fr,es:
|
116
|
+
# - common.brand
|
117
|
+
|
118
|
+
## Exclude these keys from the `i18n-tasks check-consistent-interpolations` report:
|
119
|
+
# ignore_inconsistent_interpolations:
|
120
|
+
# - 'activerecord.attributes.*'
|
121
|
+
|
122
|
+
## Ignore these keys completely:
|
123
|
+
# ignore:
|
124
|
+
# - kaminari.*
|
125
|
+
|
126
|
+
## Sometimes, it isn't possible for i18n-tasks to match the key correctly,
|
127
|
+
## e.g. in case of a relative key defined in a helper method.
|
128
|
+
## In these cases you can use the built-in PatternMapper to map patterns to keys, e.g.:
|
129
|
+
#
|
130
|
+
# <%# I18n::Tasks.add_scanner 'I18n::Tasks::Scanners::PatternMapper',
|
131
|
+
# only: %w(*.html.haml *.html.slim),
|
132
|
+
# patterns: [['= title\b', '.page_title']] %>
|
133
|
+
#
|
134
|
+
# The PatternMapper can also match key literals via a special %{key} interpolation, e.g.:
|
135
|
+
#
|
136
|
+
# <%# I18n::Tasks.add_scanner 'I18n::Tasks::Scanners::PatternMapper',
|
137
|
+
# patterns: [['\bSpree\.t[( ]\s*%{key}', 'spree.%{key}']] %>
|
@@ -0,0 +1,236 @@
|
|
1
|
+
---
|
2
|
+
en:
|
3
|
+
actionwords_diff:
|
4
|
+
exporting_diff_title: Exporting actionwords diff
|
5
|
+
exporting_title: Exporting actionword signature
|
6
|
+
loading_previous_definition: Loading previous definition
|
7
|
+
summary:
|
8
|
+
created:
|
9
|
+
one: |
|
10
|
+
One action word created,
|
11
|
+
run '%{command_line} --show-actionwords-created' to get the definition
|
12
|
+
%{list}
|
13
|
+
other: |
|
14
|
+
%{count} action words created,
|
15
|
+
run '%{command_line} --show-actionwords-created' to get the definitions
|
16
|
+
%{list}
|
17
|
+
definition_changed:
|
18
|
+
one: |
|
19
|
+
One action word which definition changed,
|
20
|
+
run '%{command_line} --show-actionwords-definition-changed' to get the new definition
|
21
|
+
%{list}
|
22
|
+
other: |
|
23
|
+
%{count} action words which definition changed,
|
24
|
+
run '%{command_line} --show-actionwords-definition-changed' to get the new definitions
|
25
|
+
%{list}
|
26
|
+
deleted:
|
27
|
+
one: |
|
28
|
+
One action word deleted,
|
29
|
+
run '%{command_line} --show-actionwords-deleted' to list the name in the code
|
30
|
+
%{list}
|
31
|
+
other: |
|
32
|
+
%{count} action words deleted,
|
33
|
+
run '%{command_line} --show-actionwords-deleted' to list the names in the code
|
34
|
+
%{list}
|
35
|
+
empty: No action words changed
|
36
|
+
renamed:
|
37
|
+
one: |
|
38
|
+
One action word renamed,
|
39
|
+
run '%{command_line} --show-actionwords-renamed' to get the new name
|
40
|
+
%{list}
|
41
|
+
other: |
|
42
|
+
%{count} action words renamed,
|
43
|
+
run '%{command_line} --show-actionwords-renamed' to get the new names
|
44
|
+
%{list}
|
45
|
+
signature_changed:
|
46
|
+
one: |
|
47
|
+
One action word which signature changed,
|
48
|
+
run '%{command_line} --show-actionwords-signature-changed' to get the new signature
|
49
|
+
%{list}
|
50
|
+
other: |
|
51
|
+
%{count} action words which signature changed,
|
52
|
+
run '%{command_line} --show-actionwords-signature-changed' to get the new signatures
|
53
|
+
%{list}
|
54
|
+
analyzing_data: Analyzing data
|
55
|
+
build_data:
|
56
|
+
error: |
|
57
|
+
Unable to build:
|
58
|
+
%{node}
|
59
|
+
title: Extracting data
|
60
|
+
check_version:
|
61
|
+
error: Unable to connect to Rubygem
|
62
|
+
outdated: |
|
63
|
+
Your current install of hiptest-publisher (%{current}) is outdated, version %{latest} is available
|
64
|
+
run 'gem install hiptest-publisher' to get the latest version."
|
65
|
+
title: Checking latest version on Rubygem
|
66
|
+
up_to_date: Your current install of hiptest-publisher (%{current}) is up-to-date.
|
67
|
+
default: default
|
68
|
+
errors:
|
69
|
+
api_error: HipTest API returned error %{code}
|
70
|
+
cli_options:
|
71
|
+
actionwords_signature_directory: 'Bad Action Words signature file: the file "%{path}" is a directory'
|
72
|
+
filter_status_without_test_run: |
|
73
|
+
You need to specify a test run when filtering on test status.
|
74
|
+
Use options test_run_id or test_run_name.
|
75
|
+
filter_with_test_run: Filtering can not be applied when exporting from a test run
|
76
|
+
invalid_category:
|
77
|
+
one: 'Error with --only: the category %{invalid_categories} does not exist for language %{language}. Available categories are %{available_categories}.'
|
78
|
+
other: 'Error with --only: the categories %{invalid_categories} do not exist for language %{language}. Available categories are %{available_categories}.'
|
79
|
+
invalid_execution_environment: 'Error with --execution-environment: the name of the execution environment must be less than 255 characters'
|
80
|
+
invalid_meta: |
|
81
|
+
meta should be a list of comma separated key:value items (eg. OS:Linux,CI:Jenkins)
|
82
|
+
|
83
|
+
Found: %{incorrect_value}
|
84
|
+
invalid_numeric_value_list: |
|
85
|
+
%{option} should be a list of comma separated numeric values
|
86
|
+
|
87
|
+
Found: %{incorrect_value}
|
88
|
+
invalid_tag_value_list: |
|
89
|
+
%{option} should be a list of comma separated tags in HipTest
|
90
|
+
|
91
|
+
Found: %{incorrect_value}
|
92
|
+
invalid_test_run_id: 'Invalid format --test-run-id="%{test_run_id}": the test run id must be numeric'
|
93
|
+
invalid_token: 'Invalid format --token="%{token}": the project secret token must be numeric'
|
94
|
+
irregular_report_file: 'Error with --push: the file "%{path}" is not a regular file'
|
95
|
+
irregular_xml_file: 'Error with --xml-file: the file "%{path}" is not a regular file'
|
96
|
+
missing_actionwords_signature_file: |
|
97
|
+
Missing Action Words signature file: the file "actionwords_signature.yaml" could not be found in directory "%{directory_path}"
|
98
|
+
Use --actionwords-signature to generate the file "%{directory_path}/actionwords_signature.yaml"
|
99
|
+
missing_config_file: 'Error with --config: the file "%{config_file}" does not exist or is not readable'
|
100
|
+
missing_token: |
|
101
|
+
Missing argument --token: you must specify project secret token with --token=<project-token>
|
102
|
+
|
103
|
+
The project secret token can be found on HipTest in the settings section, under
|
104
|
+
'Test code generation'. It is a sequence of numbers uniquely identifying your
|
105
|
+
project.
|
106
|
+
|
107
|
+
Note that settings section is available only to administrators of the project.
|
108
|
+
multiple_filters: |
|
109
|
+
You specified multiple filters for the export.
|
110
|
+
|
111
|
+
Only one filter can be applied.
|
112
|
+
output_directory_not_directory: 'Error with --output-directory: the file "%{output_dir}" is not a directory'
|
113
|
+
output_directory_not_writable: 'Error with --output-directory: the directory "%{output_dir}" is not writable'
|
114
|
+
output_directory_parent_not_writable: 'Error with --output-directory: the directory "%{output_dir}" can not be created because "%{realpath}" is not writable'
|
115
|
+
unreadable_report_file: 'Error with --push: the file "%{path}" does not exist or is not readable'
|
116
|
+
unreadable_xml_file: 'Error with --xml-file: the file "%{path}" does not exist or is not readable'
|
117
|
+
default: |
|
118
|
+
An error has occured, sorry for the inconvenience.
|
119
|
+
Try running the command again with --verbose for detailed output
|
120
|
+
invalid_config_file: cannot find configuration file in "%{hiptest_publisher_path}/lib/config" for language %{language} and framework %{framework}
|
121
|
+
invalid_config_file_no_framework: cannot find configuration file in "%{hiptest_publisher_path}/lib/config" for language %{language}
|
122
|
+
invalid_node: Invalid node_name %{name} in language group [%{group_name}]
|
123
|
+
no_matching_test_run: |
|
124
|
+
No matching test run found. Available test runs for this project are:
|
125
|
+
%{test_runs}
|
126
|
+
no_test_runs: 'No matching test run found: this project does not have any test runs.'
|
127
|
+
project_not_found: No project found with this secret token.
|
128
|
+
template_not_found: no template with name %{template_name} in dirs %{dirs}
|
129
|
+
test_run_list_unavailable: Cannot get the list of available test runs from HipTest. Try using --test-run-id instead of --test-run-name
|
130
|
+
exporting_file: Exporting %{name}
|
131
|
+
fetching_data: Fetching data from HipTest
|
132
|
+
help:
|
133
|
+
categories:
|
134
|
+
title: For language %{language}, available file groups are
|
135
|
+
usage_example: |2
|
136
|
+
|
137
|
+
Usage examples:
|
138
|
+
|
139
|
+
To export only %{first} files:
|
140
|
+
hiptest-publisher --language=%{language} --only=%{first}
|
141
|
+
|
142
|
+
To export both %{first} and %{second} files:
|
143
|
+
hiptest-publisher --language=%{language} --only=%{first},%{second}
|
144
|
+
description: |2
|
145
|
+
|
146
|
+
Exports tests from HipTest for automation.
|
147
|
+
|
148
|
+
Specific options:
|
149
|
+
header: 'Usage: hiptest-publisher [options]'
|
150
|
+
languages:
|
151
|
+
no_framework_available: " no framework option available %{language}"
|
152
|
+
supported_languages: 'Supported languages:'
|
153
|
+
options:
|
154
|
+
nomalized_options: 'Options have been normalized. Values updated:'
|
155
|
+
options:
|
156
|
+
actionwords_diff: Show actionwords diff since last update (summary)
|
157
|
+
actionwords_diff_json: Show actionwords diff since last update (JSON output)
|
158
|
+
actionwords_only: "(deprecated) alias for --only=actionwords"
|
159
|
+
actionwords_signature: Export actionwords signature
|
160
|
+
aw_created: Output code for new action words
|
161
|
+
aw_definition_changed: Output action words for which definition changed
|
162
|
+
aw_deleted: Output signature of deleted action words
|
163
|
+
aw_renamed: Output signatures of renamed action words
|
164
|
+
aw_signature_changed: Output signatures of action words for which signature changed
|
165
|
+
check_version: Check if a new release of hiptest-publisher is available
|
166
|
+
config: Configuration file
|
167
|
+
empty_folders: Export empty folders
|
168
|
+
execution_environment: Name of the execution environment
|
169
|
+
filename_pattern: Filename pattern (containing %s)
|
170
|
+
filter_on_folder_ids: Filter on folder ids (use commas to separate ids when fetching multiple folders)
|
171
|
+
filter_on_folder_name: Filter on folder name (only one name is accepted)
|
172
|
+
filter_on_scenario_ids: Filter on scenario ids (use commas to separate ids when fetching multiple scenarios)
|
173
|
+
filter_on_scenario_name: Filter on scenario name (only one name is accepted)
|
174
|
+
filter_on_status: Filter on test status in last build (use in conjunction with a test run)
|
175
|
+
filter_on_tags: Filter on scenarios and folder tags (use commas to separate tags when using multiple tags)
|
176
|
+
force_overwrite: Force overwrite of existing files (do not apply to test files)
|
177
|
+
framework: Test framework to use
|
178
|
+
global_failure_on_missing_reports: When there is no results file to push, report a global failure
|
179
|
+
help: Show this message
|
180
|
+
keep_filenames: 'Keep the same name as in HipTest for the test files (note: may cause encoding issues)'
|
181
|
+
keep_foldernames: 'Keep the same name as in HipTest for the folders (note: may cause encoding issues)'
|
182
|
+
language: Target language
|
183
|
+
languages_help: Show languages and framework options
|
184
|
+
leafless_export: Use only last level action word
|
185
|
+
library_name: 'Use in conjunction with show-actionwords-*: show the diff for the specified library'
|
186
|
+
meta: Meta informations that can be used for customizing templates
|
187
|
+
not_recursive: 'Used in conjunction with filter-on-folder-ids or filter-on-folder-name: only exports those folders, not their children'
|
188
|
+
only: Restrict export to given file categories (--only=list to list them)
|
189
|
+
output_directory: Output directory
|
190
|
+
overriden_templates: Folder for overriden templates
|
191
|
+
parameter_delimiter: Parameter delimiter (for Gherkin based export only)
|
192
|
+
parent_folder_tags: 'Export tags from parent folders (note: if set to false, those tags are never rendered. Only available for Gherkin base exports)'
|
193
|
+
push: Push a results file to the server
|
194
|
+
push_format: Format of the test results (cucumber-json, junit, nunit, robot, tap)
|
195
|
+
site: Site to fetch from
|
196
|
+
sort: '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'
|
197
|
+
split_scenarios: Export each scenario in a single file (except for Gherkin based languages)
|
198
|
+
test_run_id: Export data from a test run identified by its id
|
199
|
+
test_run_name: Export data from a test run identified by its name
|
200
|
+
tests_only: "(deprecated) alias for --only=tests"
|
201
|
+
token: Secret token (available in your project settings)
|
202
|
+
uids: 'Export UIDs (note: can be disabled only for Gherkin-based exports, may cause issue when pushing results back)'
|
203
|
+
verbose: Run verbosely
|
204
|
+
with_dataset_names: 'Export dataset name when creating feature files (note: available only for Gherkin-based exports)'
|
205
|
+
with_folders: Use folders hierarchy to export files in respective directories
|
206
|
+
without: Exclude file categories from import (--only=list to list them)
|
207
|
+
xml_file: XML file to use instead of fetching it from HipTest
|
208
|
+
overwrite:
|
209
|
+
ask_confirmation: 'File %{path} exists, do you want to overwrite it? [y/N] '
|
210
|
+
warning_message: File %{path} already exists, skipping. Use --force to overwrite it.
|
211
|
+
push:
|
212
|
+
empty_results: |
|
213
|
+
Possible causes for the lack of imported tests:
|
214
|
+
|
215
|
+
* Did you run the following command before executing your tests?
|
216
|
+
%{enhanced_command}
|
217
|
+
|
218
|
+
* Did you specify the correct push format?
|
219
|
+
Use push_format=<format> in your config file or option --push-format=<format> in the command line
|
220
|
+
Available formats are: cucumber-json, junit, nunit, robot, tap
|
221
|
+
posting_results: Posting %{file} to %{site}
|
222
|
+
test_imported: " Test '%{name}' imported"
|
223
|
+
test_run_id: the ID of the test run you want to push the results to
|
224
|
+
tests_imported_summary:
|
225
|
+
one: One test imported
|
226
|
+
other: "%{count} tests imported"
|
227
|
+
zero: No tests imported
|
228
|
+
readable_list: "%{first_items} and %{last_item}"
|
229
|
+
request_sent: 'Request sent to: %{uri}'
|
230
|
+
ruby_version:
|
231
|
+
current_version: You are using %{engine} %{version}.
|
232
|
+
deprecation_warning: Ruby %{version} support is deprecated and will be removed in later version of hiptest-publisher
|
233
|
+
required_version: hiptest-publisher requires Ruby version >= %{version}.
|
234
|
+
support_ended: Official support for Ruby %{version} ended on %{year}-%{month}-%{day}
|
235
|
+
use_more_recent: Please use a more recent ruby release to run hiptest-publisher.
|
236
|
+
verbose_header: 'Running hiptest-publisher %{version} with:'
|
data/lib/hiptest-publisher.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'i18n'
|
1
2
|
require 'colorize'
|
2
3
|
require 'json'
|
3
4
|
require 'yaml'
|
@@ -15,6 +16,7 @@ require 'hiptest-publisher/signature_differ'
|
|
15
16
|
require 'hiptest-publisher/signature_exporter'
|
16
17
|
require 'hiptest-publisher/string'
|
17
18
|
require 'hiptest-publisher/utils'
|
19
|
+
require 'hiptest-publisher/version_checker'
|
18
20
|
require 'hiptest-publisher/xml_parser'
|
19
21
|
|
20
22
|
module Hiptest
|
@@ -33,8 +35,7 @@ module Hiptest
|
|
33
35
|
|
34
36
|
def run
|
35
37
|
if @cli_options.check_version
|
36
|
-
check_version
|
37
|
-
return
|
38
|
+
return VersionChecker.check_version
|
38
39
|
end
|
39
40
|
|
40
41
|
begin
|
@@ -82,7 +83,7 @@ module Hiptest
|
|
82
83
|
end
|
83
84
|
|
84
85
|
def fetch_xml_file
|
85
|
-
reporter.with_status_message
|
86
|
+
reporter.with_status_message I18n.t(:fetching_data) do
|
86
87
|
@client.fetch_project_export
|
87
88
|
end
|
88
89
|
rescue ClientError => err
|
@@ -92,13 +93,12 @@ module Hiptest
|
|
92
93
|
raise
|
93
94
|
end
|
94
95
|
rescue => err
|
95
|
-
puts ("
|
96
|
-
"Try running the command again with --verbose for detailed output").red
|
96
|
+
puts I18n.t("errors.default").red
|
97
97
|
reporter.dump_error(err)
|
98
98
|
end
|
99
99
|
|
100
100
|
def get_project(xml)
|
101
|
-
reporter.with_status_message
|
101
|
+
reporter.with_status_message I18n.t('build_data.title') do
|
102
102
|
parser = Hiptest::XMLParser.new(xml, reporter)
|
103
103
|
return parser.build_project
|
104
104
|
end
|
@@ -117,11 +117,11 @@ module Hiptest
|
|
117
117
|
|
118
118
|
if $stdout.isatty
|
119
119
|
STDOUT.print "\n"
|
120
|
-
STDOUT.print "[#{"?".yellow}]
|
120
|
+
STDOUT.print "[#{"?".yellow}] #{I18n.t('overwrite.ask_confirmation', path: path)}"
|
121
121
|
answer = $stdin.gets.chomp.downcase.strip
|
122
122
|
return ['y', 'yes'].include?(answer)
|
123
123
|
else
|
124
|
-
reporter.warning_message(
|
124
|
+
reporter.warning_message(I18n.t('overwrite.warning_message', path: path))
|
125
125
|
return false
|
126
126
|
end
|
127
127
|
end
|
@@ -146,7 +146,7 @@ module Hiptest
|
|
146
146
|
node_rendering_context.path,
|
147
147
|
node_rendering_context.node,
|
148
148
|
node_rendering_context,
|
149
|
-
|
149
|
+
I18n.t(:exporting_file, name: node_rendering_context.description),
|
150
150
|
ask_overwrite: ask_overwrite
|
151
151
|
)
|
152
152
|
end
|
@@ -158,14 +158,14 @@ module Hiptest
|
|
158
158
|
|
159
159
|
write_to_file(
|
160
160
|
"#{@cli_options.output_directory}/actionwords_signature.yaml",
|
161
|
-
|
161
|
+
I18n.t('actionwords_diff.exporting_title'),
|
162
162
|
ask_overwrite: true
|
163
163
|
) { Hiptest::SignatureExporter.export_actionwords(@project).to_yaml }
|
164
164
|
end
|
165
165
|
|
166
166
|
def compute_actionwords_diff
|
167
167
|
old = nil
|
168
|
-
reporter.with_status_message
|
168
|
+
reporter.with_status_message I18n.t('actionwords_diff.loading_previous_definition') do
|
169
169
|
old = YAML.load_file("#{@cli_options.output_directory}/actionwords_signature.yaml")
|
170
170
|
end
|
171
171
|
|
@@ -183,7 +183,7 @@ module Hiptest
|
|
183
183
|
|
184
184
|
def analyze_project_data
|
185
185
|
return if @project_data_analyzed
|
186
|
-
reporter.with_status_message
|
186
|
+
reporter.with_status_message I18n.t(:analyzing_data) do
|
187
187
|
@language_config = LanguageConfigParser.new(@cli_options)
|
188
188
|
Hiptest::NodeModifiers.add_all(@project, @cli_options.sort)
|
189
189
|
end
|
@@ -201,49 +201,16 @@ module Hiptest
|
|
201
201
|
def print_categories
|
202
202
|
language_config = LanguageConfigParser.new(@cli_options)
|
203
203
|
group_names = language_config.group_names
|
204
|
-
puts
|
204
|
+
puts I18n.t('help.categories.title', language: @cli_options.language)
|
205
205
|
group_names.each do |group_name|
|
206
206
|
puts " - #{group_name}"
|
207
207
|
end
|
208
|
-
puts [
|
209
|
-
"",
|
210
|
-
"Usage examples:",
|
211
|
-
"",
|
212
|
-
"To export only #{group_names.first} files:",
|
213
|
-
" hiptest-publisher --language=#{@cli_options.language} --only=#{group_names.first}",
|
214
|
-
"",
|
215
|
-
"To export both #{group_names.first} and #{group_names[1]} files:",
|
216
|
-
" hiptest-publisher --language=#{@cli_options.language} --only=#{group_names.take(2).join(",")}"
|
217
|
-
].join("\n")
|
218
|
-
end
|
219
|
-
|
220
|
-
def check_version
|
221
|
-
latest = nil
|
222
|
-
reporter.with_status_message "Checking latest version on Rubygem" do
|
223
|
-
latest_gem = Gem.latest_version_for('hiptest-publisher')
|
224
|
-
|
225
|
-
raise RuntimeError, "Unable to connect to Rubygem" if latest_gem.nil?
|
226
|
-
|
227
|
-
latest = latest_gem.version
|
228
|
-
end
|
229
|
-
|
230
|
-
return if latest.nil?
|
231
|
-
|
232
|
-
current = hiptest_publisher_version
|
233
|
-
|
234
|
-
if latest == current
|
235
|
-
puts "Your current install of hiptest-publisher (#{current}) is up-to-date."
|
236
|
-
else
|
237
|
-
puts [
|
238
|
-
"Your current install of hiptest-publisher (#{current}) is outdated, version #{latest} is available",
|
239
|
-
"run 'gem install hiptest-publisher' to get the latest version."
|
240
|
-
].join("\n")
|
241
|
-
end
|
208
|
+
puts I18n.t('help.categories.usage_example', language: @cli_options.language, first: group_names.first, second: group_names[1])
|
242
209
|
end
|
243
210
|
|
244
211
|
def post_results
|
245
212
|
response = nil
|
246
|
-
reporter.with_status_message
|
213
|
+
reporter.with_status_message I18n.t('push.posting_results', file: @cli_options.push, site: @cli_options.site) do
|
247
214
|
response = @client.push_results
|
248
215
|
end
|
249
216
|
if valid_hiptest_api_response?(response)
|
@@ -265,10 +232,10 @@ module Hiptest
|
|
265
232
|
reported_tests = json.has_key?('test_import') ? json['test_import'] : []
|
266
233
|
passed_count = reported_tests.size
|
267
234
|
|
268
|
-
reporter.with_status_message
|
235
|
+
reporter.with_status_message I18n.t('push.tests_imported_summary', count: passed_count) do
|
269
236
|
if @cli_options.verbose
|
270
237
|
reported_tests.each do |imported_test|
|
271
|
-
puts
|
238
|
+
puts I18n.t('push.test_imported', name: imported_test['name'])
|
272
239
|
end
|
273
240
|
end
|
274
241
|
end
|
@@ -277,11 +244,11 @@ module Hiptest
|
|
277
244
|
end
|
278
245
|
|
279
246
|
def report_hiptest_api_error(response)
|
280
|
-
reporter.failure_message(
|
247
|
+
reporter.failure_message(I18n.t('errors.api_error', code: response.code))
|
281
248
|
if response.code == "422" && response.body.start_with?("Unknown format")
|
282
249
|
STDERR.print response.body.chomp + "\n"
|
283
250
|
elsif response.code == "404"
|
284
|
-
STDERR.print
|
251
|
+
STDERR.print I18n.t('errors.project_not_found')
|
285
252
|
end
|
286
253
|
end
|
287
254
|
|
@@ -289,20 +256,10 @@ module Hiptest
|
|
289
256
|
command = @cli_options.command_line_used(exclude: [:push, :push_format, :execution_environment])
|
290
257
|
enhanced_command = "#{command} --without=actionwords"
|
291
258
|
if @cli_options.test_run_id.nil? || @cli_options.test_run_id.empty?
|
292
|
-
enhanced_command += " --test-run-id
|
259
|
+
enhanced_command += " --test-run-id=<#{I18n.t('push.test_run_id')}>"
|
293
260
|
end
|
294
261
|
|
295
|
-
puts
|
296
|
-
"Possible causes for the lack of imported tests:",
|
297
|
-
"",
|
298
|
-
" * Did you run the following command before executing your tests?",
|
299
|
-
" #{enhanced_command}",
|
300
|
-
"",
|
301
|
-
" * Did you specify the correct push format?",
|
302
|
-
" Use push_format=<format> in your config file or option --push-format=<format> in the command line",
|
303
|
-
" Available formats are: cucumber-json, junit, nunit, robot, tap",
|
304
|
-
""
|
305
|
-
].join("\n")
|
262
|
+
puts I18n.t('push.empty_results', enhanced_command: enhanced_command)
|
306
263
|
end
|
307
264
|
end
|
308
265
|
end
|