@suffolklitlab/alkiln 4.2.1-custom-setup-timeout.1 → 4.3.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.
- package/.github/workflows/test_tests.yml +3 -3
- package/CHANGELOG.md +10 -2
- package/action.yml +1 -1
- package/lib/docassemble/docassemble_api_interface.js +15 -16
- package/lib/scope.js +1 -1
- package/lib/steps.js +1 -1
- package/lib/utils/session_vars.js +1 -1
- package/package.json +11 -11
|
@@ -78,12 +78,12 @@ jobs:
|
|
|
78
78
|
with:
|
|
79
79
|
name: report
|
|
80
80
|
path: ./**/*_report_*
|
|
81
|
-
- name:
|
|
81
|
+
- name: upload debug_log artifact
|
|
82
82
|
uses: actions/upload-artifact@v2
|
|
83
83
|
if: ${{ always() }}
|
|
84
84
|
with:
|
|
85
|
-
name:
|
|
86
|
-
path: ./
|
|
85
|
+
name: debug_log file
|
|
86
|
+
path: ./debug_log.txt
|
|
87
87
|
- name: Cleanup
|
|
88
88
|
if: ${{ always() }}
|
|
89
89
|
run: npm run takedown
|
package/CHANGELOG.md
CHANGED
|
@@ -38,9 +38,17 @@ Format:
|
|
|
38
38
|
### Security
|
|
39
39
|
-
|
|
40
40
|
-->
|
|
41
|
-
## [Unreleased]
|
|
41
|
+
<!-- ## [Unreleased] -->
|
|
42
|
+
|
|
43
|
+
## [4.3.0] - 2022-04-07
|
|
42
44
|
### Added
|
|
43
|
-
- GitHub environment variable MAX_SECONDS_FOR_SETUP to set a custom maximum time for setup and takedown for packages that take a long time to load.
|
|
45
|
+
- GitHub environment variable `MAX_SECONDS_FOR_SETUP` to set a custom maximum time for setup and takedown for packages that take a long time to load.
|
|
46
|
+
|
|
47
|
+
## [4.2.0] - 2022-04-05
|
|
48
|
+
### Changed
|
|
49
|
+
- Pin versions of dependencies in action.yml and package.json
|
|
50
|
+
- Change log.txt file to debug_log.txt and upload as github artifact.
|
|
51
|
+
- Update cheerio version to remove vulnerabilities.
|
|
44
52
|
|
|
45
53
|
## [4.1.1] - 2022-04-01
|
|
46
54
|
### Added
|
package/action.yml
CHANGED
|
@@ -181,10 +181,9 @@ da_i.loop_to_create_project = async function( creation_options ) {
|
|
|
181
181
|
|
|
182
182
|
// Defaults
|
|
183
183
|
creation_options = creation_options || {};
|
|
184
|
-
let
|
|
185
|
-
let
|
|
186
|
-
let
|
|
187
|
-
let wait_seconds = creation_options.wait_seconds || default_opts.wait_seconds;
|
|
184
|
+
let timeout = creation_options.timeout || DEFAULT_MAX_REQUEST_MS;
|
|
185
|
+
let max_tries = creation_options.max_tries || 15;
|
|
186
|
+
let wait_seconds = creation_options.wait_seconds || 5;
|
|
188
187
|
|
|
189
188
|
let project_name = null;
|
|
190
189
|
let name_incrementor = 0;
|
|
@@ -353,13 +352,14 @@ da_i.wait_for_server_to_restart = async ( task_id, options ) => {
|
|
|
353
352
|
// Base default
|
|
354
353
|
options = options || {};
|
|
355
354
|
// Default timeout
|
|
356
|
-
let
|
|
357
|
-
let timeout = options.timeout || default_timeout;
|
|
355
|
+
let timeout = options.timeout || DEFAULT_MAX_REQUEST_MS;
|
|
358
356
|
// Other defaults
|
|
359
|
-
let
|
|
360
|
-
let
|
|
357
|
+
let default_wait_between_loops = 4 * 1000;
|
|
358
|
+
let default_wait_for_response = 1 * 1000;
|
|
359
|
+
let default_max_loops = timeout/( default_wait_between_loops + default_wait_for_response );
|
|
361
360
|
// Actual values
|
|
362
|
-
let
|
|
361
|
+
let wait_between_loops = options.wait_between_loops || default_wait_between_loops;
|
|
362
|
+
let wait_for_response = options.wait_for_response || default_wait_for_response;
|
|
363
363
|
let max_loops = options.max_loops || default_max_loops;
|
|
364
364
|
|
|
365
365
|
// Flags for stopping the `while` loop
|
|
@@ -372,7 +372,7 @@ da_i.wait_for_server_to_restart = async ( task_id, options ) => {
|
|
|
372
372
|
while ( !done_restarting && num_tries <= max_loops ) {
|
|
373
373
|
num_tries++;
|
|
374
374
|
// Wait only a short time for the task to finish, not the full default timeout
|
|
375
|
-
done_restarting = await da_i.has_task_finished( task_id, { timeout:
|
|
375
|
+
done_restarting = await da_i.has_task_finished( task_id, { timeout: wait_for_response } );
|
|
376
376
|
if ( !done_restarting ) {
|
|
377
377
|
if ( num_tries < max_loops ) {
|
|
378
378
|
// Show a slightly different message after a number of tries to reassure
|
|
@@ -381,16 +381,17 @@ da_i.wait_for_server_to_restart = async ( task_id, options ) => {
|
|
|
381
381
|
if ( num_tries > 3 ) { msg_start = `Still not complete`; }
|
|
382
382
|
|
|
383
383
|
// When the server is busy, the task timeout causes this loop to actually
|
|
384
|
-
// take
|
|
384
|
+
// take 5 seconds to complete, but this only waits for 4. I'm not sure how
|
|
385
|
+
// to make that clear
|
|
385
386
|
log.info({ pre: `${ msg_start }. Check ${ num_tries } of ${ max_loops }. `
|
|
386
|
-
+ `Will check again in ${
|
|
387
|
+
+ `Will check again in ${( wait_between_loops + wait_for_response )/1000 } seconds.`
|
|
387
388
|
});
|
|
388
|
-
await time.waitForTimeout(
|
|
389
|
+
await time.waitForTimeout( wait_between_loops );
|
|
389
390
|
|
|
390
391
|
} else {
|
|
391
392
|
// This is our last round, let's wrap it up
|
|
392
393
|
let server_msg = `ALKiln setup: It seems like the docassemble server `
|
|
393
|
-
+ `didn't finish uploading the code after ${
|
|
394
|
+
+ `didn't finish uploading the code after ${ timeout/1000 } `
|
|
394
395
|
+ `seconds. Some things you can try: check your server is up, try `
|
|
395
396
|
+ `re-running the test, and try pulling the package manually `
|
|
396
397
|
+ `into the playground.`;
|
|
@@ -421,8 +422,6 @@ da_i.delete_project = async function ( delete_options ) {
|
|
|
421
422
|
log.info({ pre: `Deleted Project "${ project_name }"` });
|
|
422
423
|
|
|
423
424
|
} catch ( error ) {
|
|
424
|
-
// TODO: Add more useful error messages, like project doesn't exist. The devs
|
|
425
|
-
// shouldn't be deleting projects by hand, but it's still very possible they would
|
|
426
425
|
// Status 400
|
|
427
426
|
log.error({ pre: `Ran into an error when deleting Project "${ project_name }"` });
|
|
428
427
|
log.debug({ pre: `See https://docassemble.org/docs/api.html#playground_delete_project.` });
|
package/lib/scope.js
CHANGED
|
@@ -60,7 +60,7 @@ module.exports = {
|
|
|
60
60
|
let scenario = await scope.makeSureReportPartsExist( scope );
|
|
61
61
|
scenario.lines.push({ type, value });
|
|
62
62
|
|
|
63
|
-
fs.appendFileSync('
|
|
63
|
+
fs.appendFileSync('debug_log.txt', `Report:\ntype: ${ type }, value: ${ value }`);
|
|
64
64
|
return scenario;
|
|
65
65
|
|
|
66
66
|
}, // Ends scope.addToReport()
|
package/lib/steps.js
CHANGED
|
@@ -20,7 +20,7 @@ const session_vars = {};
|
|
|
20
20
|
|
|
21
21
|
module.exports = session_vars;
|
|
22
22
|
|
|
23
|
-
//
|
|
23
|
+
// These default to null
|
|
24
24
|
session_vars.get_debug = function () { return process.env.DEBUG || null; };
|
|
25
25
|
session_vars.get_dev_api_key = function () { return process.env.DOCASSEMBLE_DEVELOPER_API_KEY || null; };
|
|
26
26
|
session_vars.get_repo_url = function () { return process.env.REPO_URL || null; };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@suffolklitlab/alkiln",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.3.0",
|
|
4
4
|
"description": "Integrated automated end-to-end testing with docassemble, puppeteer, and cucumber.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -34,16 +34,16 @@
|
|
|
34
34
|
},
|
|
35
35
|
"homepage": "https://suffolklitlab.org/docassemble-AssemblyLine-documentation/docs/automated_integrated_testing/",
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@cucumber/cucumber": "
|
|
38
|
-
"axios": "
|
|
39
|
-
"chai": "
|
|
40
|
-
"cheerio": "
|
|
41
|
-
"dotenv": "
|
|
42
|
-
"mocha": "
|
|
43
|
-
"puppeteer": "
|
|
44
|
-
"qs": "
|
|
45
|
-
"sanitize-filename": "
|
|
46
|
-
"uuid": "
|
|
37
|
+
"@cucumber/cucumber": "7.3.2",
|
|
38
|
+
"axios": "0.24.0",
|
|
39
|
+
"chai": "4.2.0",
|
|
40
|
+
"cheerio": "1.0.0-rc.10",
|
|
41
|
+
"dotenv": "8.2.0",
|
|
42
|
+
"mocha": "9.2.0",
|
|
43
|
+
"puppeteer": "13.1.3",
|
|
44
|
+
"qs": "6.10.2",
|
|
45
|
+
"sanitize-filename": "1.6.3",
|
|
46
|
+
"uuid": "8.3.2"
|
|
47
47
|
},
|
|
48
48
|
"bin": {
|
|
49
49
|
"alkiln-setup": "./lib/docassemble/setup.js",
|