@suffolklitlab/alkiln 5.13.2 → 5.13.3-feat-random-2
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.
- package/.github/workflows/github_server.yml +10 -8
- package/.github/workflows/playground.yml +5 -2
- package/.github/workflows/unit_tests.yml +1 -1
- package/CHANGELOG.md +32 -1
- package/_alkiln_meta/shift_logs.js +75 -0
- package/action.yml +89 -31
- package/action_for_github_server/action.yml +65 -29
- package/docs/4_environments.md +243 -0
- package/docs/artifacts_folder_name.md +135 -0
- package/docs/constrained_random_tests.md +254 -0
- package/docs/decisions/006_which_log_level_to_pick_2024_09_5.md +70 -0
- package/docs/decisions/007_getting_and_storing_logs.md +179 -0
- package/docs/decisions/move_runtime_config_to_sources_folder.md +5 -0
- package/docs/decisions/reports_and_logs_2024_08_11.md +161 -0
- package/docs/kinds_of_errors.md +26 -0
- package/docs/prioritize_constrained_random_tests.md +60 -0
- package/lib/docassemble/docassemble_api_interface.js +77 -51
- package/lib/docassemble/server_install.js +32 -9
- package/lib/docassemble/setup.js +40 -25
- package/lib/docassemble/takedown.js +33 -10
- package/lib/globals.js +10 -0
- package/lib/run_cucumber.js +141 -69
- package/lib/scope.js +101 -77
- package/lib/setup/TestGenerator.js +1755 -0
- package/lib/setup/artifacts.js +20 -0
- package/lib/setup/generate.js +42 -0
- package/lib/setup/get_Gherkin_AST.js +26 -0
- package/lib/setup/validate.js +89 -0
- package/lib/steps.js +132 -54
- package/lib/utils/Log.js +1145 -0
- package/lib/utils/_alkiln-constrained_random_tests_old.js +1776 -0
- package/lib/utils/files.js +18 -11
- package/lib/utils/get_error_stacks.js +16 -0
- package/lib/utils/reports.js +100 -34
- package/lib/utils/session_vars.js +107 -73
- package/lib/utils/set_sources_paths.js +98 -0
- package/lib/utils/time.js +44 -0
- package/package.json +18 -7
- package/tests/log_codes/check_codes.sh +18 -13
- package/tests/log_codes/log_code_expected_instances.txt +91 -9
- package/tests/unit_tests/constrained_random_answers/invalid.fixtures.js +177 -0
- package/tests/unit_tests/constrained_random_answers/invalid.test.js +251 -0
- package/tests/unit_tests/constrained_random_answers/valid.fixtures.js +936 -0
- package/tests/unit_tests/constrained_random_answers/valid.test.js +541 -0
- package/tests/unit_tests/example_of_chai_test_lifecycle.js +78 -0
- package/tests/unit_tests/getAllFields.test.js +5 -0
- package/tests/unit_tests/getMatchingRows.test.js +5 -0
- package/tests/unit_tests/log.test.js +557 -0
- package/tests/unit_tests/normalizeTable.test.js +5 -0
- package/lib/utils/log.js +0 -96
- /package/docs/{expected_inernal_results.md → expected_internal_results.md} +0 -0
package/lib/utils/time.js
CHANGED
|
@@ -24,3 +24,47 @@ time.waitForTimeout = function( milliseconds ) {
|
|
|
24
24
|
setTimeout(resolve, milliseconds);
|
|
25
25
|
});
|
|
26
26
|
};
|
|
27
|
+
time.sleep = time.waitForTimeout;
|
|
28
|
+
time.wait = time.waitForTimeout;
|
|
29
|
+
|
|
30
|
+
time.filename_date = function() {
|
|
31
|
+
/** Return the current timestamp in a human-readable
|
|
32
|
+
* filename-safe format to match the workflow artifact
|
|
33
|
+
* date format.
|
|
34
|
+
* See https://stackoverflow.com/a/48729396/14144258 and https://stackoverflow.com/a/6040556/14144258
|
|
35
|
+
*/
|
|
36
|
+
// let date = new Date(); // now
|
|
37
|
+
// let day = ("0" + date.getUTCDate()).slice(-2);
|
|
38
|
+
// let month = ("0" + (date.getUTCMonth() + 1)).slice(-2);
|
|
39
|
+
// let year = date.getUTCFullYear();
|
|
40
|
+
// let hours = ("0" + date.getUTCHours()).slice(-2);
|
|
41
|
+
// let mins = ("0" + date.getUTCMinutes()).slice(-2);
|
|
42
|
+
// let secs = ("0" + date.getUTCSeconds()).slice(-2);
|
|
43
|
+
|
|
44
|
+
let dt = time.get_time_parts();
|
|
45
|
+
let safe_date = `${ dt.y }-${ dt.mon }-${ dt.d } at ${ dt.h }h${ dt.min }m${ dt.s }sUTC`;
|
|
46
|
+
return safe_date;
|
|
47
|
+
}; // Ends time.filename_date()
|
|
48
|
+
|
|
49
|
+
time.log_date = function () {
|
|
50
|
+
/** Return the current timestamp in a human-readable
|
|
51
|
+
* more compact log format.
|
|
52
|
+
* See https://stackoverflow.com/a/48729396/14144258 and https://stackoverflow.com/a/6040556/14144258
|
|
53
|
+
*/
|
|
54
|
+
let dt = time.get_time_parts();
|
|
55
|
+
let short_date = `${ dt.y }-${ dt.mon }-${ dt.d } ${ dt.h }:${ dt.min }:${ dt.s }UTC`;
|
|
56
|
+
return short_date;
|
|
57
|
+
}; // Ends time.log_date()
|
|
58
|
+
|
|
59
|
+
time.get_time_parts = function () {
|
|
60
|
+
/** Get all the parts of the date as numbers. */
|
|
61
|
+
let date = new Date(); // now
|
|
62
|
+
return ({
|
|
63
|
+
y: date.getUTCFullYear(),
|
|
64
|
+
mon: ("0" + (date.getUTCMonth() + 1)).slice(-2),
|
|
65
|
+
d: ("0" + date.getUTCDate()).slice(-2),
|
|
66
|
+
h: ("0" + date.getUTCHours()).slice(-2),
|
|
67
|
+
min: ("0" + date.getUTCMinutes()).slice(-2),
|
|
68
|
+
s: ("0" + date.getUTCSeconds()).slice(-2),
|
|
69
|
+
});
|
|
70
|
+
}
|
package/package.json
CHANGED
|
@@ -1,18 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@suffolklitlab/alkiln",
|
|
3
|
-
"version": "5.13.2",
|
|
3
|
+
"version": "5.13.3-feat-random-2",
|
|
4
4
|
"description": "Integrated automated end-to-end testing with docassemble, puppeteer, and cucumber.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"test": "npm run unit && npm run codes && npm run cucumber",
|
|
8
|
-
"cucumber": "./lib/run_cucumber.js",
|
|
9
8
|
"local": "npm run setup && npm run cucumber; npm run takedown",
|
|
10
|
-
|
|
11
|
-
"fail": "npm run cucumber '@error'",
|
|
12
|
-
"setup": "./lib/docassemble/setup.js",
|
|
9
|
+
|
|
13
10
|
"takedown": "./lib/docassemble/takedown.js",
|
|
11
|
+
"setup": "./lib/docassemble/setup.js",
|
|
14
12
|
"server_install": "./lib/docassemble/server_install.js",
|
|
15
|
-
|
|
13
|
+
|
|
14
|
+
"pass": "npm run cucumber 'not @error and not @temp_error'",
|
|
15
|
+
"fail": "npm run cucumber '@error'",
|
|
16
|
+
"cucumber": "npm run build && ./lib/run_cucumber.js",
|
|
17
|
+
|
|
18
|
+
"build": "npm run artifacts && npm run validate && npm run generate",
|
|
19
|
+
"validate": "./lib/setup/validate.js",
|
|
20
|
+
"generate": "./lib/setup/generate.js",
|
|
21
|
+
"artifacts": "./lib/setup/artifacts.js",
|
|
22
|
+
|
|
23
|
+
"unit": "npm run artifacts && mocha --recursive 'tests/unit_tests/**/*.test.*'",
|
|
16
24
|
"codes": "tests/log_codes/check_codes.sh ."
|
|
17
25
|
},
|
|
18
26
|
"repository": {
|
|
@@ -57,6 +65,9 @@
|
|
|
57
65
|
"alkiln-server-install": "./lib/docassemble/server_install.js",
|
|
58
66
|
"alkiln-setup": "./lib/docassemble/setup.js",
|
|
59
67
|
"alkiln-takedown": "./lib/docassemble/takedown.js",
|
|
60
|
-
"alkiln-run": "./lib/run_cucumber.js"
|
|
68
|
+
"alkiln-run": "./lib/run_cucumber.js",
|
|
69
|
+
"alkiln-artifacts": "./lib/setup/artifacts.js",
|
|
70
|
+
"alkiln-validate": "./lib/setup/validate.js",
|
|
71
|
+
"alkiln-generate": "./lib/setup/generate.js"
|
|
61
72
|
}
|
|
62
73
|
}
|
|
@@ -11,12 +11,13 @@ exit_code=0
|
|
|
11
11
|
|
|
12
12
|
echo " -------------------------------------------------------
|
|
13
13
|
| Usage: |
|
|
14
|
-
| bash $(basename $0) [dir] [c file] [c folder]
|
|
14
|
+
| bash $(basename $0) [dir] [c file] [c folder] |
|
|
15
15
|
| dir: The directory in which to search for logs |
|
|
16
16
|
| c file: Name of the log instance counter file |
|
|
17
17
|
| c folder: Path to the folder of the log counter file |
|
|
18
|
-
| -l arg: \"1\" prints extra logs |
|
|
19
18
|
-------------------------------------------------------"
|
|
19
|
+
# | bash $(basename $0) [dir] [c file] [c folder] [-l arg]
|
|
20
|
+
# | -l arg: \"1\" prints extra logs |
|
|
20
21
|
|
|
21
22
|
# Get flags and their values
|
|
22
23
|
loudness="0"
|
|
@@ -55,7 +56,8 @@ fi
|
|
|
55
56
|
|
|
56
57
|
# removed and are no longer used. Syntax used works with GitHub cli - [[:digit:]]
|
|
57
58
|
# https://stackoverflow.com/a/6901221
|
|
58
|
-
|
|
59
|
+
# Exclude files and paths
|
|
60
|
+
instances=$(find "$where_to_look" -type f ! -name "CONTRIBUTING.md" ! -name "$expected_instances_file" ! -name "debug_log.txt" ! -name "cucumber-report.txt" ! -name "_alkiln*" ! -path "*/tests/*" ! -path "*/node_modules/*" ! -path "*/ALKilnTests/*" ! -path "*/alkiln-*/*" ! -path "*/_alkiln*/*" ! -path "*/docs/*" ! -path "*/\.*" -print0 | xargs -0 -P 4 grep -0 -ro 'ALK[[:digit:]][[:digit:]][[:digit:]][[:digit:]]' | grep -v -- '--' )
|
|
59
61
|
|
|
60
62
|
if [[ "$loudness" != "0" ]]; then
|
|
61
63
|
total_instances=$(echo "$instances" | wc -l)
|
|
@@ -100,7 +102,7 @@ fi
|
|
|
100
102
|
indx=0
|
|
101
103
|
too_many=()
|
|
102
104
|
missing=()
|
|
103
|
-
while [ "$indx" -
|
|
105
|
+
while [ "$indx" -le "$highest_code" ]; do
|
|
104
106
|
# Turn the index into a log code by prepending ALK and adding leading zeros
|
|
105
107
|
log_code=$(printf "ALK%04d" "$indx")
|
|
106
108
|
# Count ";" - a stand-in for the number of
|
|
@@ -125,24 +127,27 @@ while [ "$indx" -lt "$highest_code" ]; do
|
|
|
125
127
|
# To add to the list of strings to print later
|
|
126
128
|
short_msg="$log_code $num_paths/$num_expected"
|
|
127
129
|
long_msg="$log_code act/exp "
|
|
128
|
-
long_msg+="$num_paths/$num_expected
|
|
130
|
+
long_msg+="$num_paths/$num_expected"
|
|
131
|
+
if [ "$num_paths" -gt "$num_expected" ]; then
|
|
132
|
+
long_msg+=":"
|
|
133
|
+
fi
|
|
129
134
|
long_msg+=$(echo "${codes_unique_paths[$indx]}" | sed 's/;/\n - /g')
|
|
130
135
|
|
|
131
136
|
# missing
|
|
132
137
|
if [ "$num_paths" -lt "$num_expected" ]; then
|
|
133
|
-
if [[ "$loudness" != "0" ]]; then
|
|
138
|
+
# if [[ "$loudness" != "0" ]]; then
|
|
134
139
|
missing+=("$long_msg")
|
|
135
|
-
else
|
|
136
|
-
|
|
137
|
-
fi
|
|
140
|
+
# else
|
|
141
|
+
# missing+=("$short_msg")
|
|
142
|
+
# fi
|
|
138
143
|
|
|
139
144
|
# too_many
|
|
140
145
|
elif [ "$num_paths" -gt "$num_expected" ]; then
|
|
141
|
-
if [[ "$loudness" != "0" ]]; then
|
|
146
|
+
# if [[ "$loudness" != "0" ]]; then
|
|
142
147
|
too_many+=("$long_msg")
|
|
143
|
-
else
|
|
144
|
-
|
|
145
|
-
fi
|
|
148
|
+
# else
|
|
149
|
+
# too_many+=("$short_msg")
|
|
150
|
+
# fi
|
|
146
151
|
fi
|
|
147
152
|
|
|
148
153
|
let indx++
|
|
@@ -4,7 +4,14 @@ Why we need duplicate codes sometimes: GitHub actions sometimes don't have ways
|
|
|
4
4
|
|
|
5
5
|
The script that tests the log codes will ignore this file (or any file with this name), and any file with these names: check_codes.sh, debug_log.txt, cucumber-report.txt. It will also ignore files in folders with these names:, node_modules, ALKilnTests, alkiln-*, _alkiln*. That list might get updated, so for an up-to-date list, always check the file check_codes.sh where we use `--exclude=` and such.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Reasons for deletion:
|
|
8
|
+
0000 - unknown
|
|
9
|
+
0053 - duplicate log
|
|
10
|
+
0173 - redundant
|
|
11
|
+
0181 - unknown
|
|
12
|
+
0223 - changed Log behavior ("Only logs that throw should give a value to `error`.")
|
|
13
|
+
|
|
14
|
+
ALK0000:0
|
|
8
15
|
ALK0001:1
|
|
9
16
|
ALK0002:2
|
|
10
17
|
ALK0003:2
|
|
@@ -22,7 +29,7 @@ ALK0014:1
|
|
|
22
29
|
ALK0015:1
|
|
23
30
|
ALK0016:1
|
|
24
31
|
ALK0017:1
|
|
25
|
-
ALK0018:
|
|
32
|
+
ALK0018:1
|
|
26
33
|
ALK0019:2
|
|
27
34
|
ALK0020:1
|
|
28
35
|
ALK0021:1
|
|
@@ -33,10 +40,10 @@ ALK0025:1
|
|
|
33
40
|
ALK0026:2
|
|
34
41
|
ALK0027:2
|
|
35
42
|
ALK0028:3
|
|
36
|
-
ALK0029:
|
|
43
|
+
ALK0029:2
|
|
37
44
|
ALK0030:2
|
|
38
|
-
ALK0031:
|
|
39
|
-
ALK0032:
|
|
45
|
+
ALK0031:2
|
|
46
|
+
ALK0032:2
|
|
40
47
|
ALK0033:1
|
|
41
48
|
ALK0034:1
|
|
42
49
|
ALK0035:1
|
|
@@ -57,7 +64,7 @@ ALK0049:1
|
|
|
57
64
|
ALK0050:1
|
|
58
65
|
ALK0051:1
|
|
59
66
|
ALK0052:1
|
|
60
|
-
ALK0053:
|
|
67
|
+
ALK0053:0
|
|
61
68
|
ALK0054:1
|
|
62
69
|
ALK0055:1
|
|
63
70
|
ALK0056:1
|
|
@@ -177,7 +184,7 @@ ALK0169:1
|
|
|
177
184
|
ALK0170:1
|
|
178
185
|
ALK0171:1
|
|
179
186
|
ALK0172:1
|
|
180
|
-
ALK0173:
|
|
187
|
+
ALK0173:0
|
|
181
188
|
ALK0174:1
|
|
182
189
|
ALK0175:1
|
|
183
190
|
ALK0176:1
|
|
@@ -185,7 +192,7 @@ ALK0177:1
|
|
|
185
192
|
ALK0178:1
|
|
186
193
|
ALK0179:1
|
|
187
194
|
ALK0180:1
|
|
188
|
-
ALK0181:
|
|
195
|
+
ALK0181:0
|
|
189
196
|
ALK0182:1
|
|
190
197
|
ALK0183:1
|
|
191
198
|
ALK0184:2
|
|
@@ -206,4 +213,79 @@ ALK0198:1
|
|
|
206
213
|
ALK0199:1
|
|
207
214
|
ALK0200:1
|
|
208
215
|
ALK0201:1
|
|
209
|
-
ALK0202:1
|
|
216
|
+
ALK0202:1
|
|
217
|
+
ALK0203:1
|
|
218
|
+
ALK0204:1
|
|
219
|
+
ALK0205:1
|
|
220
|
+
ALK0206:1
|
|
221
|
+
ALK0207:1
|
|
222
|
+
ALK0208:1
|
|
223
|
+
ALK0209:1
|
|
224
|
+
ALK0210:1
|
|
225
|
+
ALK0211:1
|
|
226
|
+
ALK0212:1
|
|
227
|
+
ALK0213:1
|
|
228
|
+
ALK0214:1
|
|
229
|
+
ALK0215:1
|
|
230
|
+
ALK0216:1
|
|
231
|
+
ALK0217:1
|
|
232
|
+
ALK0218:1
|
|
233
|
+
ALK0219:1
|
|
234
|
+
ALK0220:1
|
|
235
|
+
ALK0221:1
|
|
236
|
+
ALK0222:1
|
|
237
|
+
ALK0223:0
|
|
238
|
+
ALK0224:1
|
|
239
|
+
ALK0225:1
|
|
240
|
+
ALK0226:1
|
|
241
|
+
ALK0227:1
|
|
242
|
+
ALK0228:1
|
|
243
|
+
ALK0229:1
|
|
244
|
+
ALK0230:1
|
|
245
|
+
ALK0231:1
|
|
246
|
+
ALK0232:1
|
|
247
|
+
ALK0233:1
|
|
248
|
+
ALK0234:1
|
|
249
|
+
ALK0235:1
|
|
250
|
+
ALK0236:1
|
|
251
|
+
ALK0237:1
|
|
252
|
+
ALK0238:1
|
|
253
|
+
ALK0239:1
|
|
254
|
+
ALK0240:1
|
|
255
|
+
ALK0241:1
|
|
256
|
+
ALK0242:1
|
|
257
|
+
ALK0243:1
|
|
258
|
+
ALK0244:1
|
|
259
|
+
ALK0245:1
|
|
260
|
+
ALK0246:1
|
|
261
|
+
ALK0247:1
|
|
262
|
+
ALK0248:1
|
|
263
|
+
ALK0249:1
|
|
264
|
+
ALK0250:1
|
|
265
|
+
ALK0251:1
|
|
266
|
+
ALK0252:1
|
|
267
|
+
ALK0253:1
|
|
268
|
+
ALK0254:1
|
|
269
|
+
ALK0255:1
|
|
270
|
+
ALK0256:1
|
|
271
|
+
ALK0257:1
|
|
272
|
+
ALK0258:1
|
|
273
|
+
ALK0259:1
|
|
274
|
+
ALK0260:1
|
|
275
|
+
ALK0261:1
|
|
276
|
+
ALK0262:1
|
|
277
|
+
ALK0263:1
|
|
278
|
+
ALK0264:1
|
|
279
|
+
ALK0265:1
|
|
280
|
+
ALK0266:1
|
|
281
|
+
ALK0267:1
|
|
282
|
+
ALK0268:1
|
|
283
|
+
ALK0269:1
|
|
284
|
+
ALK0270:1
|
|
285
|
+
ALK0271:1
|
|
286
|
+
ALK0272:1
|
|
287
|
+
ALK0273:1
|
|
288
|
+
ALK0274:1
|
|
289
|
+
ALK0275:1
|
|
290
|
+
ALK0276:1
|
|
291
|
+
ALK0277:1
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
/** Actual and expected values for INvalid constrained random answer tests. */
|
|
2
|
+
|
|
3
|
+
module.exports = fixts = {};
|
|
4
|
+
|
|
5
|
+
/** Research notes
|
|
6
|
+
*
|
|
7
|
+
* Valid: A feature is valid without a description
|
|
8
|
+
* Valid: A scenario is valid without a description
|
|
9
|
+
*
|
|
10
|
+
* TODO
|
|
11
|
+
* Research: Can we get back null or undefined without syntax errors? (unlikely)
|
|
12
|
+
* Research: Can feature.children[0] exist without a `.scenario` prop? (unlikely)
|
|
13
|
+
* */
|
|
14
|
+
|
|
15
|
+
fixts.generator_missing_Feature = {};
|
|
16
|
+
fixts.generator_missing_Feature.arg = `Scenario: Invalid feature file`;
|
|
17
|
+
fixts.generator_missing_Feature.expected = null;
|
|
18
|
+
fixts.generator_missing_Feature.error_codes = [ `ALK0232` ];
|
|
19
|
+
fixts.generator_missing_Feature.log_codes = [ `ALK0232` ];
|
|
20
|
+
|
|
21
|
+
fixts.generator_missing_contents = {};
|
|
22
|
+
fixts.generator_missing_contents.arg = ``;
|
|
23
|
+
fixts.generator_missing_contents.expected = null;
|
|
24
|
+
fixts.generator_missing_contents.error_codes = [ `ALK0233` ];
|
|
25
|
+
fixts.generator_missing_contents.log_codes = [ `ALK0233` ];
|
|
26
|
+
|
|
27
|
+
fixts.generator_0_Scenarios = {};
|
|
28
|
+
fixts.generator_0_Scenarios.arg = `Feature: No scenarios`;
|
|
29
|
+
fixts.generator_0_Scenarios.expected = null;
|
|
30
|
+
fixts.generator_0_Scenarios.error_codes = [ `ALK0235` ];
|
|
31
|
+
fixts.generator_0_Scenarios.log_codes = [ `ALK0235` ];
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Missing fore_Step keywords
|
|
36
|
+
* Missing constraints Step keywords
|
|
37
|
+
* */
|
|
38
|
+
|
|
39
|
+
fixts.missing_fore_Step_keywords = {};
|
|
40
|
+
fixts.missing_fore_Step_keywords.arg =
|
|
41
|
+
`Feature: I generate constrained random tests
|
|
42
|
+
|
|
43
|
+
Scenario: I fail with missing keywords for a fore Step
|
|
44
|
+
Given ALKiln makes 2
|
|
45
|
+
Given the final Scenario status should be "failed"
|
|
46
|
+
Given I start the interview at "test_kickout"
|
|
47
|
+
And ALKiln tests get to "end" with:
|
|
48
|
+
| var | possible_values |
|
|
49
|
+
| user_choice | correct;; wrong |
|
|
50
|
+
`;
|
|
51
|
+
fixts.missing_fore_Step_keywords.expected = null;
|
|
52
|
+
fixts.missing_fore_Step_keywords.error_codes = [ `ALK0242`, `ALK0263` ];
|
|
53
|
+
fixts.missing_fore_Step_keywords.log_codes = [
|
|
54
|
+
`ALK0237`,
|
|
55
|
+
`ALK0242`,
|
|
56
|
+
`ALK0263`,
|
|
57
|
+
];
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
fixts.missing_constraints_Step_keywords = {};
|
|
61
|
+
fixts.missing_constraints_Step_keywords.arg =
|
|
62
|
+
`Feature: I generate constrained random tests
|
|
63
|
+
|
|
64
|
+
Scenario: I fail with missing keywords for a constraints Step
|
|
65
|
+
Given ALKiln makes 2 constrained random answers tests
|
|
66
|
+
Given the final Scenario status should be "failed"
|
|
67
|
+
Given I start the interview at "test_kickout"
|
|
68
|
+
And tests get to "end" with:
|
|
69
|
+
| var | possible_values |
|
|
70
|
+
| user_choice | correct;; wrong |
|
|
71
|
+
`;
|
|
72
|
+
fixts.missing_constraints_Step_keywords.expected = null;
|
|
73
|
+
fixts.missing_constraints_Step_keywords.error_codes = [ `ALK0256`, `ALK0263` ];
|
|
74
|
+
fixts.missing_constraints_Step_keywords.log_codes = [
|
|
75
|
+
`ALK0237`, `ALK0243`, `ALK0244`,
|
|
76
|
+
`ALK0245`, `ALK0248`, `ALK0249`,
|
|
77
|
+
`ALK0256`,
|
|
78
|
+
`ALK0263`,
|
|
79
|
+
];
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
fixts.missing_table = {};
|
|
83
|
+
fixts.missing_table.arg =
|
|
84
|
+
`Feature: I generate constrained random tests
|
|
85
|
+
|
|
86
|
+
Scenario: I fail with the first missing table
|
|
87
|
+
Given ALKiln makes 2 constrained random answers tests
|
|
88
|
+
Given the final Scenario status should be "failed"
|
|
89
|
+
Given I start the interview at "test_kickout"
|
|
90
|
+
And ALKiln tests get to "end" with:
|
|
91
|
+
And ALKiln tests get to "end" with:
|
|
92
|
+
`;
|
|
93
|
+
// ======= ENDS ARG ======= //
|
|
94
|
+
fixts.missing_table.expected = null;
|
|
95
|
+
fixts.missing_table.error_codes = [ `ALK0251`, `ALK0263` ];
|
|
96
|
+
fixts.missing_table.log_codes = [
|
|
97
|
+
`ALK0237`, `ALK0243`, `ALK0244`,
|
|
98
|
+
`ALK0245`, `ALK0248`, `ALK0249`, `ALK0246`,
|
|
99
|
+
`ALK0251`,
|
|
100
|
+
`ALK0263`,
|
|
101
|
+
];
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
fixts.missing_ids = {};
|
|
105
|
+
fixts.missing_ids.arg =
|
|
106
|
+
`Feature: I generate constrained random tests
|
|
107
|
+
|
|
108
|
+
Scenario: I fail with missing quoted ids in constrained random answers
|
|
109
|
+
Given ALKiln makes 2 constrained random answers tests
|
|
110
|
+
Given the final Scenario status should be "failed"
|
|
111
|
+
Given I start the interview at "test_kickout"
|
|
112
|
+
And ALKiln will get to end with:
|
|
113
|
+
| var | possible_values |
|
|
114
|
+
| user_choice | correct;; wrong |
|
|
115
|
+
`;
|
|
116
|
+
// ======= ENDS ARG ======= //
|
|
117
|
+
fixts.missing_ids.expected = null;
|
|
118
|
+
fixts.missing_ids.error_codes = [ `ALK0250`, `ALK0263` ];
|
|
119
|
+
fixts.missing_ids.log_codes = [
|
|
120
|
+
`ALK0237`, `ALK0243`, `ALK0244`,
|
|
121
|
+
`ALK0245`, `ALK0248`, `ALK0249`, `ALK0246`,
|
|
122
|
+
`ALK0250`,
|
|
123
|
+
`ALK0263`,
|
|
124
|
+
];
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
// A valid generator Scenario, but an erroring test when run in cucumber, so it
|
|
128
|
+
// will error here instead
|
|
129
|
+
fixts.only_row_is_header = {};
|
|
130
|
+
fixts.only_row_is_header.arg =
|
|
131
|
+
`Feature: I generate constrained random tests
|
|
132
|
+
|
|
133
|
+
Scenario: Non-table row after table header
|
|
134
|
+
Given ALKiln makes 2 constrained random answers tests
|
|
135
|
+
Given the final Scenario status should be "failed"
|
|
136
|
+
Given I start the interview at "test_kickout"
|
|
137
|
+
And ALKiln will get to "end" with:
|
|
138
|
+
| var | possible_values |
|
|
139
|
+
Then non-table line
|
|
140
|
+
| user_choice | correct;; wrong |
|
|
141
|
+
`;
|
|
142
|
+
fixts.only_row_is_header.expected = null;
|
|
143
|
+
fixts.only_row_is_header.error_codes = [`ALK0252`, `ALK0263`];
|
|
144
|
+
fixts.only_row_is_header.log_codes = [
|
|
145
|
+
`ALK0237`, `ALK0243`, `ALK0244`,
|
|
146
|
+
`ALK0245`, `ALK0248`, `ALK0249`, `ALK0246`,
|
|
147
|
+
`ALK0252`,
|
|
148
|
+
`ALK0263`,
|
|
149
|
+
];
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* No test for a table interrupted in the middle of regular rows (the parser
|
|
153
|
+
* can't detect it)
|
|
154
|
+
* */
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
fixts.multiple_scenarios = {};
|
|
158
|
+
fixts.multiple_scenarios.arg =
|
|
159
|
+
`Feature: It is invalid to have multiple Scenarios in one generator file
|
|
160
|
+
|
|
161
|
+
Scenario: The first of 2 Scenarios
|
|
162
|
+
Given ALKiln makes 1 constrained random answers tests
|
|
163
|
+
Given I start the interview at "test_kickout"
|
|
164
|
+
And ALKiln will get to "end" with:
|
|
165
|
+
| var | possible_values |
|
|
166
|
+
| user_choice | correct;; wrong |
|
|
167
|
+
|
|
168
|
+
Scenario: The second of 2 Scenarios
|
|
169
|
+
Given ALKiln makes 1 constrained random answers tests
|
|
170
|
+
Given I start the interview at "test_kickout"
|
|
171
|
+
And ALKiln will get to "end" with:
|
|
172
|
+
| var | possible_values |
|
|
173
|
+
| user_choice | correct;; wrong |
|
|
174
|
+
`;
|
|
175
|
+
fixts.multiple_scenarios.expected = null;
|
|
176
|
+
fixts.multiple_scenarios.error_codes = [`ALK0236`];
|
|
177
|
+
fixts.multiple_scenarios.log_codes = [`ALK0236`];
|