rainforest-cli 1.10.4 → 1.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/LICENSE.txt +1 -1
- data/README.md +3 -3
- data/lib/rainforest_cli/csv_importer.rb +3 -2
- data/lib/rainforest_cli/options.rb +5 -1
- data/lib/rainforest_cli/version.rb +1 -1
- data/spec/rainforest_cli/csv_importer_spec.rb +41 -24
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3eea3ded8136b1db14a83589961e477828630f43
|
4
|
+
data.tar.gz: c4ddb62a796a3e979c276fb7433e662042bae7ba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f4aee39f29541cd65b8952073f97566708a993f046ef1d03cde128ed66591254a8602a9897f69280a2e6b9085c991c193ecfdebb20299c6485dc60d55e5e6634
|
7
|
+
data.tar.gz: ad432b0a9c7b73b0be7bb7b50bafec82f7b8c1020a967e61b61a40d91aab491f6054a665ec7bc2a72e40004d8e6d6f00f8e9929a16c853f871ccdfad989539c3
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
# Rainforest CLI Changelog
|
2
2
|
|
3
|
+
## 1.11.0 - 4th November 2016
|
4
|
+
- Add `--single-use` flag for CSV uploads. (17a19694a788365beb59e634bd7286c86528484b, @epaulet)
|
5
|
+
|
3
6
|
## 1.10.4 - 31st October 2016
|
4
7
|
- Do not upload test metadata as test description. (1c8b46d2156da17be939ac67edefe2bd2b56af47, @epaulet)
|
5
8
|
|
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -232,9 +232,9 @@ steps of an embedded test.
|
|
232
232
|
- `--junit-file` - Create a junit xml report file with the specified name. Must be run in foreground mode, or with the report command. Uses the rainforest
|
233
233
|
api to construct a junit report. This is useful to track tests in CI such as Jenkins or Bamboo.
|
234
234
|
- `--run-id` - Only used with the report command. Specify a past rainforest run by ID number to generate a report for.
|
235
|
-
- `--import-variable-csv-file /path/to/csv/file.csv` - Use with `run` and `--import-variable-name` to upload new tabular variable values before your run to specify the path to your CSV file.
|
236
|
-
- `--import-variable-name NAME` - Use with `run` and
|
237
|
-
|
235
|
+
- `--import-variable-csv-file /path/to/csv/file.csv` - Use with `run` and `--import-variable-name` to upload new tabular variable values before your run to specify the path to your CSV file. You may also use this with the `csv-upload` command to update your variable before a run.
|
236
|
+
- `--import-variable-name NAME` - Use with `run` and `--import-variable-csv-file` to upload new tabular variable values before your run to specify the name of your tabular variable. You may also use this with the `csv-upload` command to update your variable before a run.
|
237
|
+
- `--single-use` - Use with `run` or `csv-upload` to flag your variable upload as `single-use`. See `--import-variable-csv-file` and `--import-variable-name` options as well.
|
238
238
|
|
239
239
|
###Site-ID
|
240
240
|
Only run tests for a specific site. Get in touch with us for help on getting that you site id if you are unable to.
|
@@ -10,6 +10,7 @@ module RainforestCli
|
|
10
10
|
@generator_name = options.import_name
|
11
11
|
@file = options.import_file_name
|
12
12
|
@overwrite_variable = options.overwrite_variable
|
13
|
+
@single_use = options.single_use_tabular_variable || false
|
13
14
|
end
|
14
15
|
|
15
16
|
def row_data columns, values
|
@@ -43,8 +44,8 @@ module RainforestCli
|
|
43
44
|
puts 'Creating new tabular variable'
|
44
45
|
response = http_client.post(
|
45
46
|
'/generators',
|
46
|
-
{ name: @generator_name, description: @generator_name, columns: columns },
|
47
|
-
{ retries_on_failures: true }
|
47
|
+
{ name: @generator_name, description: @generator_name, columns: columns, single_use: @single_use },
|
48
|
+
{ retries_on_failures: true }
|
48
49
|
)
|
49
50
|
raise "Error creating tabular variable: #{response['error']}" if response['error']
|
50
51
|
puts "\t[OK]"
|
@@ -7,7 +7,7 @@ module RainforestCli
|
|
7
7
|
attr_reader :command, :token, :tags, :conflict, :browsers, :site_id, :environment_id,
|
8
8
|
:import_file_name, :import_name, :custom_url, :description, :folder,
|
9
9
|
:debug, :file_name, :test_folder, :embed_tests, :app_source_url, :crowd, :run_id,
|
10
|
-
:junit_file, :overwrite_variable
|
10
|
+
:junit_file, :overwrite_variable, :single_use_tabular_variable
|
11
11
|
|
12
12
|
TOKEN_NOT_REQUIRED = %w{new validate}.freeze
|
13
13
|
|
@@ -50,6 +50,10 @@ module RainforestCli
|
|
50
50
|
@import_name = value
|
51
51
|
end
|
52
52
|
|
53
|
+
opts.on('--single-use', 'Flag your tabular variable as single use.') do
|
54
|
+
@single_use_tabular_variable = true
|
55
|
+
end
|
56
|
+
|
53
57
|
opts.on('--overwrite-variable', 'Import tabular step variables: overwrite existing variable if desired variable name is taken') do
|
54
58
|
@overwrite_variable = true
|
55
59
|
end
|
@@ -8,8 +8,22 @@ describe RainforestCli::CSVImporter do
|
|
8
8
|
end
|
9
9
|
|
10
10
|
describe '.import' do
|
11
|
-
let(:options) { instance_double('RainforestCli::Options', import_name: 'variables', import_file_name: csv_file, overwrite_variable: overwrite_variable) }
|
12
11
|
subject { described_class.new(options) }
|
12
|
+
|
13
|
+
let(:options) do
|
14
|
+
instance_double(
|
15
|
+
'RainforestCli::Options',
|
16
|
+
{
|
17
|
+
import_name: 'variables',
|
18
|
+
import_file_name: csv_file,
|
19
|
+
overwrite_variable: overwrite_variable,
|
20
|
+
single_use_tabular_variable: single_use_tabular_variable,
|
21
|
+
})
|
22
|
+
end
|
23
|
+
|
24
|
+
let(:overwrite_variable) { nil }
|
25
|
+
let(:single_use_tabular_variable) { nil }
|
26
|
+
|
13
27
|
let(:columns) { %w(email pass) }
|
14
28
|
let(:generator_id) { 12345 }
|
15
29
|
let(:existing_generators) { [] }
|
@@ -32,6 +46,7 @@ describe RainforestCli::CSVImporter do
|
|
32
46
|
name: 'variables',
|
33
47
|
description: 'variables',
|
34
48
|
columns: columns,
|
49
|
+
single_use: (single_use_tabular_variable || false),
|
35
50
|
}, retries_on_failures: true)
|
36
51
|
.and_return success_response
|
37
52
|
|
@@ -52,31 +67,27 @@ describe RainforestCli::CSVImporter do
|
|
52
67
|
end
|
53
68
|
end
|
54
69
|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
},
|
71
|
-
]
|
72
|
-
end
|
73
|
-
|
74
|
-
before do
|
75
|
-
expect(http_client).to_not receive(:delete)
|
76
|
-
end
|
70
|
+
it_behaves_like 'it properly uploads variables'
|
71
|
+
|
72
|
+
context 'tabular variable with given name already exists' do
|
73
|
+
let(:existing_generators) do
|
74
|
+
[
|
75
|
+
{
|
76
|
+
'id' => 98765,
|
77
|
+
'name' => 'existing',
|
78
|
+
},
|
79
|
+
{
|
80
|
+
'id' => generator_id,
|
81
|
+
'name' => 'variables',
|
82
|
+
},
|
83
|
+
]
|
84
|
+
end
|
77
85
|
|
78
|
-
|
86
|
+
before do
|
87
|
+
expect(http_client).to_not receive(:delete)
|
79
88
|
end
|
89
|
+
|
90
|
+
it_behaves_like 'it properly uploads variables'
|
80
91
|
end
|
81
92
|
|
82
93
|
context 'with variable overwriting' do
|
@@ -105,5 +116,11 @@ describe RainforestCli::CSVImporter do
|
|
105
116
|
it_behaves_like 'it properly uploads variables'
|
106
117
|
end
|
107
118
|
end
|
119
|
+
|
120
|
+
context 'with single-use flag' do
|
121
|
+
let(:single_use_tabular_variable) { true }
|
122
|
+
|
123
|
+
it_behaves_like 'it properly uploads variables'
|
124
|
+
end
|
108
125
|
end
|
109
126
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rainforest-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.11.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Russell Smith
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-11-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: httparty
|