rainforest-cli 1.10.4 → 1.11.0

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: 192f7e0575ed3b8e2a790d514816f81a2cd98dfb
4
- data.tar.gz: 11f021face63574272a30382144def1a06f7355f
3
+ metadata.gz: 3eea3ded8136b1db14a83589961e477828630f43
4
+ data.tar.gz: c4ddb62a796a3e979c276fb7433e662042bae7ba
5
5
  SHA512:
6
- metadata.gz: b46770a727a8614482a68fe966a628ed814835c3b1c852658251d6d28b23597824ae2a1047bd2120e7bedb07338cfce45d906568830a15af54ef5c3c8873f488
7
- data.tar.gz: 2f0628e2fdeca4061782b02016f59abceb81d6c69ae4f6632994b5ab13a7d87e1e4a8db66aef33ce817b2ccb581dedd3a647b624a8347279cadc2e16ed13cd6b
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
@@ -1,4 +1,4 @@
1
- Copyright (c) 2013 Simon Mathieu
1
+ Copyright (c) 2016 Rainforest QA Inc.
2
2
 
3
3
  MIT License
4
4
 
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 `import-variable-csv-file` to upload
237
- new tabular variable values before your run to specify the name of your tabular variable.
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
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module RainforestCli
3
- VERSION = '1.10.4'
3
+ VERSION = '1.11.0'
4
4
  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
- context 'without variable overwriting' do
56
- let(:overwrite_variable) { nil }
57
-
58
- it_behaves_like 'it properly uploads variables'
59
-
60
- context 'tabular variable with given name already exists' do
61
- let(:existing_generators) do
62
- [
63
- {
64
- 'id' => 98765,
65
- 'name' => 'existing',
66
- },
67
- {
68
- 'id' => generator_id,
69
- 'name' => 'variables',
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
- it_behaves_like 'it properly uploads variables'
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.10.4
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-10-31 00:00:00.000000000 Z
12
+ date: 2016-11-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: httparty