cloudfactory 0.1.9 → 0.1.10
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.
- data/cf.gemspec +1 -0
- data/features/error_custom_task_form.feature +117 -0
- data/features/error_form_field.feature +58 -0
- data/features/error_task_form.feature +64 -0
- data/features/errors.feature +192 -0
- data/features/run.feature +136 -121
- data/features/support/cli_steps.rb +44 -0
- data/features/support/env.rb +2 -2
- data/lib/cf.rb +3 -4
- data/lib/cf/account.rb +12 -1
- data/lib/cf/cli.rb +2 -2
- data/lib/cf/cli/config.rb +2 -2
- data/lib/cf/cli/form.rb +5 -5
- data/lib/cf/cli/line.rb +40 -16
- data/lib/cf/cli/production.rb +50 -18
- data/lib/cf/cli/templates/sample-line/form.css +41 -17
- data/lib/cf/cli/templates/sample-line/form.html +27 -18
- data/lib/cf/cli/templates/sample-line/form.js +12 -3
- data/lib/cf/cli/templates/sample-line/line.yml.erb +42 -32
- data/lib/cf/client.rb +3 -3
- data/lib/cf/custom_task_form.rb +21 -91
- data/lib/cf/department.rb +1 -10
- data/lib/cf/final_output.rb +2 -16
- data/lib/cf/form_field.rb +11 -6
- data/lib/cf/human_worker.rb +93 -1
- data/lib/cf/input_format.rb +10 -62
- data/lib/cf/line.rb +46 -37
- data/lib/cf/robot_worker.rb +63 -2
- data/lib/cf/run.rb +37 -66
- data/lib/cf/station.rb +42 -104
- data/lib/cf/task_form.rb +17 -56
- data/lib/cf/version.rb +2 -2
- data/lib/generators/cf/form/form_generator.rb +3 -3
- data/lib/generators/cf/install/install_generator.rb +3 -3
- data/spec/custom_task_form_spec.rb +169 -1
- data/spec/generators/form_generator_spec.rb +2 -2
- data/spec/generators/install_generator_spec.rb +2 -2
- data/spec/run_spec.rb +3 -3
- data/spec/spec_helper.rb +1 -0
- data/spec/station_spec.rb +13 -1
- data/spec/task_form_spec.rb +38 -6
- metadata +63 -44
data/cf.gemspec
CHANGED
@@ -0,0 +1,117 @@
|
|
1
|
+
Feature: CLI Errors
|
2
|
+
In order to show the intuitive errors
|
3
|
+
As a CLI user
|
4
|
+
I want to get clear error messages in CLI
|
5
|
+
|
6
|
+
@announce, @too_slow_process
|
7
|
+
Scenario: Invalid Task Form, without form_title and instruction
|
8
|
+
Given a file named ".cf_credentials" with:
|
9
|
+
"""
|
10
|
+
---
|
11
|
+
:target_url: http://lvh.me:3000/api/
|
12
|
+
:api_version: v1
|
13
|
+
:api_key: 89ceebf739adbf59d34911f4f28b2fa0e1564fb6
|
14
|
+
|
15
|
+
"""
|
16
|
+
And a file named "dater3/station_2/form.html" with:
|
17
|
+
"""
|
18
|
+
<div id="station_2_instructions" class="station_2 cf_form_instruction">
|
19
|
+
<ul>
|
20
|
+
<li>Go to the <a href="http://www.facebook.com/search.php?type=users">people search in Facebook</a>.</li>
|
21
|
+
<li>Enter the <strong>location</strong> below and hit enter to search</li>
|
22
|
+
<li>Now go through and find the hottest date that is <span id="gender">{{gender}}</span> and looks about <span id="age">{{age}}</span> years old.</li>
|
23
|
+
<li>After you have searched through many and found the best date, paste their Facebook URL into the field below.</li>
|
24
|
+
</ul>
|
25
|
+
</div>
|
26
|
+
|
27
|
+
<div id="station_2_form" class="station_2 cf_form_content">
|
28
|
+
<div id = "field-panel">
|
29
|
+
<p>
|
30
|
+
<form>
|
31
|
+
<label>Facebook Profile URL of hottest date found</label><br />
|
32
|
+
<input id="fb_url" type="text" name="output[fb_url]" data-valid-type="general" /></br>
|
33
|
+
<input type="submit" value="submit" />
|
34
|
+
</form>
|
35
|
+
</p>
|
36
|
+
</div>
|
37
|
+
</div>
|
38
|
+
"""
|
39
|
+
And a file named "dater3/station_2/form.css" with:
|
40
|
+
"""
|
41
|
+
body { background: #e0e0d8; color: #000; }
|
42
|
+
"""
|
43
|
+
And a file named "dater3/station_2/form.js" with:
|
44
|
+
"""
|
45
|
+
$(document).ready(function() {
|
46
|
+
($('span#gender').text().toLowerCase() == "female") ? "MALE":"FEMALE"
|
47
|
+
});
|
48
|
+
"""
|
49
|
+
|
50
|
+
And a file named "dater3/line.yml" with:
|
51
|
+
"""
|
52
|
+
title: dater3
|
53
|
+
department: Web Research
|
54
|
+
input_formats:
|
55
|
+
- name: email
|
56
|
+
required: true
|
57
|
+
valid_type: email # email, url, number, date, phone
|
58
|
+
- name: location
|
59
|
+
required: true
|
60
|
+
valid_type: text # email, url, number, date, phone
|
61
|
+
- name: photo
|
62
|
+
required: true
|
63
|
+
valid_type: url # email, url, number, date, phone
|
64
|
+
stations:
|
65
|
+
- station:
|
66
|
+
station_index: 1
|
67
|
+
station_type: work # work, improve, tournament
|
68
|
+
worker:
|
69
|
+
worker_type: human # "human" or name of robot (google_translate_robot, etc)
|
70
|
+
num_workers: 1
|
71
|
+
reward: 5
|
72
|
+
task_form:
|
73
|
+
form_title: Look at a photo to determine the person's gender and approximate age
|
74
|
+
instruction: Click the photo link and then enter the person's gender and approximate age in the form below
|
75
|
+
form_fields:
|
76
|
+
- label: Gender
|
77
|
+
field_type: radio_button
|
78
|
+
required: true
|
79
|
+
option_values:
|
80
|
+
- male
|
81
|
+
- female
|
82
|
+
- not sure
|
83
|
+
- label: Age
|
84
|
+
field_type: select_box
|
85
|
+
required: true
|
86
|
+
option_values:
|
87
|
+
- Under 18
|
88
|
+
- 18 to 30
|
89
|
+
- 30 to 45
|
90
|
+
- 45 to 60
|
91
|
+
- Over 60
|
92
|
+
|
93
|
+
- station:
|
94
|
+
station_index: 2
|
95
|
+
station_type: tournament
|
96
|
+
jury_worker:
|
97
|
+
max_judges: 8
|
98
|
+
reward: 3
|
99
|
+
auto_judge:
|
100
|
+
enabled: true
|
101
|
+
worker:
|
102
|
+
worker_type: human
|
103
|
+
num_workers: 3
|
104
|
+
reward: 3
|
105
|
+
custom_task_form:
|
106
|
+
form_title: Title of form
|
107
|
+
instruction:
|
108
|
+
html: form.html
|
109
|
+
css: form.css
|
110
|
+
js: form.js
|
111
|
+
"""
|
112
|
+
And I cd to "dater3"
|
113
|
+
When I run `cf line create`
|
114
|
+
Then the output should match:
|
115
|
+
"""
|
116
|
+
["Title can't be blank", "Instruction can't be blank", "Raw html is required"]
|
117
|
+
"""
|
@@ -0,0 +1,58 @@
|
|
1
|
+
Feature: CLI Errors
|
2
|
+
In order to show the intuitive errors
|
3
|
+
As a CLI user
|
4
|
+
I want to get clear error messages in CLI
|
5
|
+
|
6
|
+
@announce, @too_slow_process
|
7
|
+
Scenario: Invalid Form Field
|
8
|
+
Given a file named ".cf_credentials" with:
|
9
|
+
"""
|
10
|
+
---
|
11
|
+
:target_url: http://lvh.me:3000/api/
|
12
|
+
:api_version: v1
|
13
|
+
:api_key: 89ceebf739adbf59d34911f4f28b2fa0e1564fb6
|
14
|
+
|
15
|
+
"""
|
16
|
+
And a file named "dater/line.yml" with:
|
17
|
+
"""
|
18
|
+
title: dater
|
19
|
+
department: Web Research
|
20
|
+
input_formats:
|
21
|
+
- name: email
|
22
|
+
required: true
|
23
|
+
valid_type: email
|
24
|
+
stations:
|
25
|
+
- station:
|
26
|
+
station_index: 1
|
27
|
+
station_type: work
|
28
|
+
worker:
|
29
|
+
worker_type: human
|
30
|
+
num_workers: 1
|
31
|
+
reward: 5
|
32
|
+
task_form:
|
33
|
+
form_title: Look at a photo to determine the person's gender and approximate age
|
34
|
+
instruction: Click the photo link and then enter the person's gender and approximate age in the form below
|
35
|
+
form_fields:
|
36
|
+
- label: Gender
|
37
|
+
field_type: INVALID_TYPE
|
38
|
+
required: true
|
39
|
+
option_values:
|
40
|
+
- male
|
41
|
+
- female
|
42
|
+
- not sure
|
43
|
+
- label: Age
|
44
|
+
field_type: SB
|
45
|
+
required: true
|
46
|
+
option_values:
|
47
|
+
- Under 18
|
48
|
+
- 18 to 30
|
49
|
+
- 30 to 45
|
50
|
+
- 45 to 60
|
51
|
+
- Over 60
|
52
|
+
"""
|
53
|
+
And I cd to "dater"
|
54
|
+
When I run `cf line create`
|
55
|
+
Then the output should match:
|
56
|
+
"""
|
57
|
+
Field type cannot be INVALID_TYPE
|
58
|
+
"""
|
@@ -0,0 +1,64 @@
|
|
1
|
+
Feature: CLI Errors
|
2
|
+
In order to show the intuitive errors
|
3
|
+
As a CLI user
|
4
|
+
I want to get clear error messages in CLI
|
5
|
+
|
6
|
+
@announce, @too_slow_process
|
7
|
+
Scenario: Invalid Task Form, without form_title and instruction
|
8
|
+
Given a file named ".cf_credentials" with:
|
9
|
+
"""
|
10
|
+
---
|
11
|
+
:target_url: http://lvh.me:3000/api/
|
12
|
+
:api_version: v1
|
13
|
+
:api_key: 89ceebf739adbf59d34911f4f28b2fa0e1564fb6
|
14
|
+
|
15
|
+
"""
|
16
|
+
And a file named "dater2/line.yml" with:
|
17
|
+
"""
|
18
|
+
title: dater2
|
19
|
+
department: Web Research
|
20
|
+
input_formats:
|
21
|
+
- name: email
|
22
|
+
required: true
|
23
|
+
valid_type: email # email, url, number, date, phone
|
24
|
+
- name: location
|
25
|
+
required: true
|
26
|
+
valid_type: text # email, url, number, date, phone
|
27
|
+
- name: photo
|
28
|
+
required: true
|
29
|
+
valid_type: url # email, url, number, date, phone
|
30
|
+
stations:
|
31
|
+
- station:
|
32
|
+
station_index: 1
|
33
|
+
station_type: work # work, improve, tournament
|
34
|
+
worker:
|
35
|
+
worker_type: human # "human" or name of robot (google_translate_robot, etc)
|
36
|
+
num_workers: 1
|
37
|
+
reward: 5
|
38
|
+
task_form:
|
39
|
+
form_title:
|
40
|
+
instruction:
|
41
|
+
form_fields:
|
42
|
+
- label: Gender
|
43
|
+
field_type: radio_button
|
44
|
+
required: true
|
45
|
+
option_values:
|
46
|
+
- male
|
47
|
+
- female
|
48
|
+
- not sure
|
49
|
+
- label: Age
|
50
|
+
field_type: select_box
|
51
|
+
required: true
|
52
|
+
option_values:
|
53
|
+
- Under 18
|
54
|
+
- 18 to 30
|
55
|
+
- 30 to 45
|
56
|
+
- 45 to 60
|
57
|
+
- Over 60
|
58
|
+
"""
|
59
|
+
And I cd to "dater2"
|
60
|
+
When I run `cf line create`
|
61
|
+
Then the output should match:
|
62
|
+
"""
|
63
|
+
["Title can't be blank", "Instruction can't be blank"]
|
64
|
+
"""
|
@@ -0,0 +1,192 @@
|
|
1
|
+
Feature: CLI Errors
|
2
|
+
In order to show the intuitive errors
|
3
|
+
As a CLI user
|
4
|
+
I want to get clear error messages in CLI
|
5
|
+
|
6
|
+
@announce, @too_slow_process
|
7
|
+
Scenario: Line with invalid department
|
8
|
+
Given a file named ".cf_credentials" with:
|
9
|
+
"""
|
10
|
+
---
|
11
|
+
:target_url: http://lvh.me:3000/api/
|
12
|
+
:api_version: v1
|
13
|
+
:api_key: 89ceebf739adbf59d34911f4f28b2fa0e1564fb6
|
14
|
+
|
15
|
+
"""
|
16
|
+
And a file named "eazytizer1/line.yml" with:
|
17
|
+
"""
|
18
|
+
title: eazytizer1
|
19
|
+
department: NoDept
|
20
|
+
|
21
|
+
"""
|
22
|
+
And I cd to "eazytizer1"
|
23
|
+
When I run `cf line create`
|
24
|
+
Then the output should match:
|
25
|
+
"""
|
26
|
+
Department not found for NoDept
|
27
|
+
"""
|
28
|
+
|
29
|
+
@announce, @too_slow_process
|
30
|
+
Scenario: Invalid line input format
|
31
|
+
Given a file named ".cf_credentials" with:
|
32
|
+
"""
|
33
|
+
---
|
34
|
+
:target_url: http://lvh.me:3000/api/
|
35
|
+
:api_version: v1
|
36
|
+
:api_key: 89ceebf739adbf59d34911f4f28b2fa0e1564fb6
|
37
|
+
|
38
|
+
"""
|
39
|
+
And a file named "eazytizer2/line.yml" with:
|
40
|
+
"""
|
41
|
+
title: eazytizer2
|
42
|
+
department: Web Research
|
43
|
+
input_formats:
|
44
|
+
- name: email
|
45
|
+
required: true
|
46
|
+
valid_type: noemail
|
47
|
+
|
48
|
+
"""
|
49
|
+
And I cd to "eazytizer2"
|
50
|
+
When I run `cf line create`
|
51
|
+
Then the output should match:
|
52
|
+
"""
|
53
|
+
Valid type cannot be noemail
|
54
|
+
"""
|
55
|
+
|
56
|
+
@announce, @too_slow_process
|
57
|
+
Scenario: Invalid station
|
58
|
+
Given a file named ".cf_credentials" with:
|
59
|
+
"""
|
60
|
+
---
|
61
|
+
:target_url: http://lvh.me:3000/api/
|
62
|
+
:api_version: v1
|
63
|
+
:api_key: 89ceebf739adbf59d34911f4f28b2fa0e1564fb6
|
64
|
+
|
65
|
+
"""
|
66
|
+
And a file named "eazytizer3/line.yml" with:
|
67
|
+
"""
|
68
|
+
title: eazytizer3
|
69
|
+
department: Web Research
|
70
|
+
input_formats:
|
71
|
+
- name: email
|
72
|
+
required: true
|
73
|
+
valid_type: email
|
74
|
+
stations:
|
75
|
+
- station:
|
76
|
+
station_index: 1
|
77
|
+
station_type: bad-station
|
78
|
+
|
79
|
+
"""
|
80
|
+
And I cd to "eazytizer3"
|
81
|
+
When I run `cf line create`
|
82
|
+
Then the output should match:
|
83
|
+
"""
|
84
|
+
The Station type Bad-station is invalid.
|
85
|
+
"""
|
86
|
+
|
87
|
+
@announce, @too_slow_process
|
88
|
+
Scenario: Invalid worker type
|
89
|
+
Given a file named ".cf_credentials" with:
|
90
|
+
"""
|
91
|
+
---
|
92
|
+
:target_url: http://lvh.me:3000/api/
|
93
|
+
:api_version: v1
|
94
|
+
:api_key: 89ceebf739adbf59d34911f4f28b2fa0e1564fb6
|
95
|
+
|
96
|
+
"""
|
97
|
+
And a file named "eazytizer4/line.yml" with:
|
98
|
+
"""
|
99
|
+
title: eazytizer4
|
100
|
+
department: Web Research
|
101
|
+
input_formats:
|
102
|
+
- name: email
|
103
|
+
required: true
|
104
|
+
valid_type: email
|
105
|
+
stations:
|
106
|
+
- station:
|
107
|
+
station_index: 1
|
108
|
+
station_type: work
|
109
|
+
worker:
|
110
|
+
worker_type: no-human
|
111
|
+
num_workers: 100000
|
112
|
+
reward: 5
|
113
|
+
|
114
|
+
"""
|
115
|
+
And I cd to "eazytizer4"
|
116
|
+
When I run `cf line create`
|
117
|
+
Then the output should match:
|
118
|
+
"""
|
119
|
+
Invalid worker type: no-human.
|
120
|
+
"""
|
121
|
+
|
122
|
+
@announce, @too_slow_process
|
123
|
+
Scenario: Invalid worker number
|
124
|
+
Given a file named ".cf_credentials" with:
|
125
|
+
"""
|
126
|
+
---
|
127
|
+
:target_url: http://lvh.me:3000/api/
|
128
|
+
:api_version: v1
|
129
|
+
:api_key: 89ceebf739adbf59d34911f4f28b2fa0e1564fb6
|
130
|
+
|
131
|
+
"""
|
132
|
+
And a file named "eazytizer5/line.yml" with:
|
133
|
+
"""
|
134
|
+
title: eazytizer5
|
135
|
+
department: Web Research
|
136
|
+
input_formats:
|
137
|
+
- name: email
|
138
|
+
required: true
|
139
|
+
valid_type: email
|
140
|
+
stations:
|
141
|
+
- station:
|
142
|
+
station_index: 1
|
143
|
+
station_type: work
|
144
|
+
worker:
|
145
|
+
worker_type: human
|
146
|
+
num_workers: 0
|
147
|
+
reward: 5
|
148
|
+
|
149
|
+
"""
|
150
|
+
And I cd to "eazytizer5"
|
151
|
+
When I run `cf line create`
|
152
|
+
Then the output should match:
|
153
|
+
"""
|
154
|
+
Number must be greater than or equal to 1
|
155
|
+
"""
|
156
|
+
|
157
|
+
@announce, @too_slow_process
|
158
|
+
Scenario: Invalid Robot worker
|
159
|
+
Given a file named ".cf_credentials" with:
|
160
|
+
"""
|
161
|
+
---
|
162
|
+
:target_url: http://lvh.me:3000/api/
|
163
|
+
:api_version: v1
|
164
|
+
:api_key: 89ceebf739adbf59d34911f4f28b2fa0e1564fb6
|
165
|
+
|
166
|
+
"""
|
167
|
+
And a file named "eazytizer6/line.yml" with:
|
168
|
+
"""
|
169
|
+
title: eazytizer6
|
170
|
+
department: Web Research
|
171
|
+
input_formats:
|
172
|
+
- name: email
|
173
|
+
required: true
|
174
|
+
valid_type: email
|
175
|
+
stations:
|
176
|
+
- station:
|
177
|
+
station_index: 1
|
178
|
+
station_type: work
|
179
|
+
worker:
|
180
|
+
worker_type: mailer_robot
|
181
|
+
settings:
|
182
|
+
to: {{email}}
|
183
|
+
template_variables:
|
184
|
+
fb_url: {{fb_url}}
|
185
|
+
|
186
|
+
"""
|
187
|
+
And I cd to "eazytizer6"
|
188
|
+
When I run `cf line create`
|
189
|
+
Then the output should match:
|
190
|
+
"""
|
191
|
+
Template can't be blank
|
192
|
+
"""
|
data/features/run.feature
CHANGED
@@ -3,139 +3,154 @@ Feature: Create a production run on CF
|
|
3
3
|
As a CLI user
|
4
4
|
I want to make a production run
|
5
5
|
|
6
|
-
|
7
|
-
Scenario: Creating a production run without run title
|
8
|
-
Given an empty file named "brandiator/line.yml"
|
9
|
-
And I cd to "brandiator"
|
10
|
-
When I run `cf production start`
|
11
|
-
Then the output should contain:
|
12
|
-
"""
|
13
|
-
The run title is required to start the production.
|
14
|
-
"""
|
15
|
-
|
16
|
-
@announce
|
17
|
-
Scenario: Warn about the missing input/input_data.csv input file if not present
|
18
|
-
Given a file named "brandiator/line.yml" with:
|
19
|
-
"""
|
20
|
-
api_key: 89ceebf739adbf59d34911f4f28b2fa0e1564fb6
|
21
|
-
title: brandiator
|
22
|
-
"""
|
23
|
-
And I cd to "brandiator"
|
24
|
-
And a directory named "input"
|
25
|
-
When I run `cf production start my_first-run -i input_data.csv`
|
26
|
-
Then the output should contain:
|
27
|
-
"""
|
28
|
-
The input data csv file named input/input_data.csv is missing.
|
29
|
-
"""
|
30
|
-
|
31
|
-
@announce
|
32
|
-
Scenario: Warn about the missing input/run-title.csv input file if not present when -i optional value is not passed
|
33
|
-
Given a file named "brandiator/line.yml" with:
|
34
|
-
"""
|
35
|
-
api_key: 89ceebf739adbf59d34911f4f28b2fa0e1564fb6
|
36
|
-
title: brandiator
|
37
|
-
"""
|
38
|
-
And I cd to "brandiator"
|
39
|
-
And a directory named "input"
|
40
|
-
When I run `cf production start my_first-run`
|
41
|
-
Then the output should contain:
|
42
|
-
"""
|
43
|
-
The input data csv file named input/my-first-run.csv is missing.
|
44
|
-
"""
|
45
|
-
|
46
|
-
@announce, @too_slow_process
|
47
|
-
Scenario: Starting a production
|
6
|
+
Background:
|
48
7
|
Given a file named ".cf_credentials" with:
|
49
8
|
"""
|
50
9
|
---
|
51
10
|
:target_url: http://lvh.me:3000/api/
|
52
11
|
:api_version: v1
|
12
|
+
:api_key: 89ceebf739adbf59d34911f4f28b2fa0e1564fb6
|
53
13
|
|
54
14
|
"""
|
55
|
-
And a file named "brandiator/station_2/form.html" with:
|
56
|
-
"""
|
57
|
-
<div id="my_form_instructions" class="brandiator cf_form_instruction">
|
58
|
-
<ul>
|
59
|
-
<li>Sample bullet list of instruction</li>
|
60
|
-
</ul>
|
61
|
-
</div>
|
62
|
-
<div id="my_form" class="brandiator cf_form_content">
|
63
|
-
<label>{{company}}</label>
|
64
|
-
<label>{{website}}</label>
|
65
|
-
<div id = "field-panel">
|
66
|
-
<p><label>ceo</label><input id="ceo" type="text" name="output[ceo]" data-valid-type="string" /></p>
|
67
|
-
<p><label>email</label><input id="email" type="text" name="output[email]" data-valid-type="email" /></p>
|
68
|
-
</div>
|
69
|
-
</div>
|
70
|
-
"""
|
71
|
-
And a file named "brandiator/station_2/form.css" with:
|
72
|
-
"""
|
73
|
-
body { background: #e0e0d8; color: #000; }
|
74
|
-
"""
|
75
|
-
And a file named "brandiator/station_2/form.js" with:
|
76
|
-
"""
|
77
|
-
<script type="text/javascript">
|
78
|
-
$(document).ready(function(){
|
79
|
-
//do your stuff here
|
80
|
-
});
|
81
|
-
</script>
|
82
|
-
"""
|
83
|
-
|
84
|
-
And a file named "brandiator/line.yml" with:
|
85
|
-
"""
|
86
|
-
api_key: 89ceebf739adbf59d34911f4f28b2fa0e1564fb6
|
87
|
-
title: brandiator
|
88
|
-
description: Describe the line what its purpose is and what it does. You got the idea, right?
|
89
|
-
department: Survey
|
90
|
-
|
91
|
-
input_formats:
|
92
|
-
- name: company
|
93
|
-
required: true
|
94
|
-
valid_type: general
|
95
|
-
- name: website
|
96
|
-
required: false
|
97
|
-
valid_type: url
|
98
15
|
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
worker:
|
104
|
-
worker_type: human
|
105
|
-
num_workers: 2
|
106
|
-
reward: 5
|
107
|
-
task_form:
|
108
|
-
form_title: Enter text from a business card image for TASKFORM
|
109
|
-
instruction: Read the business card image and the fill the fields for TASKFORM
|
110
|
-
form_fields:
|
111
|
-
- label: CEO Name
|
112
|
-
field_type: short_answer
|
113
|
-
required: true
|
114
|
-
- label: CEO Email
|
115
|
-
field_type: email
|
116
|
-
required: true
|
117
|
-
- station:
|
118
|
-
station_index: 2
|
119
|
-
station_type: work
|
120
|
-
worker:
|
121
|
-
worker_type: human
|
122
|
-
num_workers: 1
|
123
|
-
reward: 3
|
124
|
-
custom_task_form:
|
125
|
-
form_title: Enter text from a business card image for CUSTOMTASKFORM
|
126
|
-
instruction: Read the business card image and the fill the fields for CUSTOMTASKFORM
|
127
|
-
html: form.html
|
128
|
-
css: form.css
|
129
|
-
js: form.js
|
130
|
-
"""
|
131
|
-
And a file named "brandiator/input/my-run-title.csv" with:
|
16
|
+
@announce, @moderate_slow_process
|
17
|
+
Scenario: Creating a production run without run title should be created using the "line-title-11aug10-hhmmss"
|
18
|
+
Given a line exists with title "brandiator"
|
19
|
+
And a file named "brandiator/input/input-data.csv" with:
|
132
20
|
"""
|
133
21
|
company,website,meta_data_company
|
134
22
|
Apple,apple.com,Apple
|
135
23
|
"""
|
136
24
|
And I cd to "brandiator"
|
137
|
-
When I run `cf production start
|
138
|
-
Then the output should
|
25
|
+
When I run `cf production start` for cf
|
26
|
+
Then the output should contain:
|
139
27
|
"""
|
140
|
-
A run with title
|
28
|
+
A run with title brandiator- using the line brandiator was successfully created.
|
141
29
|
"""
|
30
|
+
|
31
|
+
# @announce
|
32
|
+
# Scenario: Warn about the missing input/input_data.csv input file if not present
|
33
|
+
# Given a file named "brandiator/line.yml" with:
|
34
|
+
# """
|
35
|
+
# api_key: 89ceebf739adbf59d34911f4f28b2fa0e1564fb6
|
36
|
+
# title: brandiator
|
37
|
+
# """
|
38
|
+
# And I cd to "brandiator"
|
39
|
+
# And a directory named "input"
|
40
|
+
# When I run `cf production start my_first-run -i input_data.csv`
|
41
|
+
# Then the output should contain:
|
42
|
+
# """
|
43
|
+
# The input data csv file named input/input_data.csv is missing.
|
44
|
+
# """
|
45
|
+
#
|
46
|
+
# @announce
|
47
|
+
# Scenario: Warn about the missing input/run-title.csv input file if not present when -i optional value is not passed
|
48
|
+
# Given a file named "brandiator/line.yml" with:
|
49
|
+
# """
|
50
|
+
# api_key: 89ceebf739adbf59d34911f4f28b2fa0e1564fb6
|
51
|
+
# title: brandiator
|
52
|
+
# """
|
53
|
+
# And I cd to "brandiator"
|
54
|
+
# And a directory named "input"
|
55
|
+
# When I run `cf production start my_first-run`
|
56
|
+
# Then the output should contain:
|
57
|
+
# """
|
58
|
+
# The input data csv file named input/my-first-run.csv is missing.
|
59
|
+
# """
|
60
|
+
#
|
61
|
+
# @announce, @too_slow_process
|
62
|
+
# Scenario: Starting a production
|
63
|
+
# Given a file named ".cf_credentials" with:
|
64
|
+
# """
|
65
|
+
# ---
|
66
|
+
# :target_url: http://lvh.me:3000/api/
|
67
|
+
# :api_version: v1
|
68
|
+
#
|
69
|
+
# """
|
70
|
+
# And a file named "brandiator/station_2/form.html" with:
|
71
|
+
# """
|
72
|
+
# <form>
|
73
|
+
# <div id="my_form_instructions" class="brandiator cf_form_instruction">
|
74
|
+
# <ul>
|
75
|
+
# <li>Sample bullet list of instruction</li>
|
76
|
+
# </ul>
|
77
|
+
# </div>
|
78
|
+
# <div id="my_form" class="brandiator cf_form_content">
|
79
|
+
# <label>{{company}}</label>
|
80
|
+
# <label>{{website}}</label>
|
81
|
+
# <div id = "field-panel">
|
82
|
+
# <p><label>ceo</label><input id="ceo" type="text" name="output[ceo]" data-valid-type="string" /></p>
|
83
|
+
# <p><label>email</label><input id="email" type="text" name="output[email]" data-valid-type="email" /></p>
|
84
|
+
# </div>
|
85
|
+
# </div>
|
86
|
+
# </form>
|
87
|
+
# """
|
88
|
+
# And a file named "brandiator/station_2/form.css" with:
|
89
|
+
# """
|
90
|
+
# body { background: #e0e0d8; color: #000; }
|
91
|
+
# """
|
92
|
+
# And a file named "brandiator/station_2/form.js" with:
|
93
|
+
# """
|
94
|
+
# $(document).ready(function(){
|
95
|
+
# //do your stuff here
|
96
|
+
# });
|
97
|
+
# """
|
98
|
+
#
|
99
|
+
# And a file named "brandiator/line.yml" with:
|
100
|
+
# """
|
101
|
+
# api_key: 89ceebf739adbf59d34911f4f28b2fa0e1564fb6
|
102
|
+
# title: brandiator
|
103
|
+
# description: Describe the line what its purpose is and what it does. You got the idea, right?
|
104
|
+
# department: Survey
|
105
|
+
#
|
106
|
+
# input_formats:
|
107
|
+
# - name: company
|
108
|
+
# required: true
|
109
|
+
# valid_type: general
|
110
|
+
# - name: website
|
111
|
+
# required: false
|
112
|
+
# valid_type: url
|
113
|
+
#
|
114
|
+
# stations:
|
115
|
+
# - station:
|
116
|
+
# station_index: 1
|
117
|
+
# station_type: work
|
118
|
+
# worker:
|
119
|
+
# worker_type: human
|
120
|
+
# num_workers: 2
|
121
|
+
# reward: 5
|
122
|
+
# task_form:
|
123
|
+
# form_title: Enter text from a business card image for TASKFORM
|
124
|
+
# instruction: Read the business card image and the fill the fields for TASKFORM
|
125
|
+
# form_fields:
|
126
|
+
# - label: CEO Name
|
127
|
+
# field_type: short_answer
|
128
|
+
# required: true
|
129
|
+
# - label: CEO Email
|
130
|
+
# field_type: email
|
131
|
+
# required: true
|
132
|
+
# - station:
|
133
|
+
# station_index: 2
|
134
|
+
# station_type: work
|
135
|
+
# worker:
|
136
|
+
# worker_type: human
|
137
|
+
# num_workers: 1
|
138
|
+
# reward: 3
|
139
|
+
# custom_task_form:
|
140
|
+
# form_title: Enter text from a business card image for CUSTOMTASKFORM
|
141
|
+
# instruction: Read the business card image and the fill the fields for CUSTOMTASKFORM
|
142
|
+
# html: form.html
|
143
|
+
# css: form.css
|
144
|
+
# js: form.js
|
145
|
+
# """
|
146
|
+
# And a file named "brandiator/input/my-run-title.csv" with:
|
147
|
+
# """
|
148
|
+
# company,website,meta_data_company
|
149
|
+
# Apple,apple.com,Apple
|
150
|
+
# """
|
151
|
+
# And I cd to "brandiator"
|
152
|
+
# When I run `cf production start my_run_title`
|
153
|
+
# Then the output should match:
|
154
|
+
# """
|
155
|
+
# A run with title my-run-title using the line brandiator was successfully created.
|
156
|
+
# """
|