@suffolklitlab/alkiln 5.0.2-feat-github-server-12 → 5.0.2-feat-github-server-14
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 +2 -2
- package/CONTRIBUTING.md +1 -1
- package/github_server/action.yml +2 -5
- package/lib/docassemble/docassemble_api_REST.js +0 -16
- package/lib/docassemble/docassemble_api_interface.js +0 -21
- package/lib/docassemble/server_install.js +0 -9
- package/package.json +1 -1
- package/setup.py +3 -3
|
@@ -59,7 +59,7 @@ jobs:
|
|
|
59
59
|
if: ${{ failure() }}
|
|
60
60
|
uses: mxschmitt/action-tmate@v3
|
|
61
61
|
|
|
62
|
-
- name:
|
|
62
|
+
- name: Env vars from server output
|
|
63
63
|
run: |
|
|
64
64
|
echo "USER1_EMAIL=${{ steps.github_server.outputs.DA_ADMIN_EMAIL }}" >> $GITHUB_ENV
|
|
65
65
|
echo "USER1_PASSWORD=${{ steps.github_server.outputs.DA_ADMIN_PASSWORD }}" >> $GITHUB_ENV
|
|
@@ -78,6 +78,6 @@ jobs:
|
|
|
78
78
|
DOCASSEMBLE_DEVELOPER_API_KEY: "${{ steps.github_server.outputs.DOCASSEMBLE_DEVELOPER_API_KEY }}"
|
|
79
79
|
INSTALL_METHOD: "server"
|
|
80
80
|
# TODO: See what happens if this is an empty string
|
|
81
|
-
ALKILN_VERSION: "5.0.2-feat-github-server-
|
|
81
|
+
ALKILN_VERSION: "5.0.2-feat-github-server-14"
|
|
82
82
|
- run: echo "Finished running ALKiln tests"
|
|
83
83
|
|
package/CONTRIBUTING.md
CHANGED
|
@@ -194,7 +194,7 @@ Our `./action.yml` is a [composite action](https://docs.github.com/en/actions/cr
|
|
|
194
194
|
|
|
195
195
|
### Internal tests
|
|
196
196
|
|
|
197
|
-
We have our own docassemble package in our repo to test our own end-to-end tests. Most of what the package needs is in `./docassemble`. That docassemble package is what the test setup pulls into the docassemble server. Our internal end-to-end cucumber tests are `.feature` files that are stored in `./docassemble/
|
|
197
|
+
We have our own docassemble package in our repo to test our own end-to-end tests. Most of what the package needs is in `./docassemble`. That docassemble package is what the test setup pulls into the docassemble server. Our internal end-to-end cucumber tests are `.feature` files that are stored in `./docassemble/ALKilnTests/data/sources`. The interview (online form) `.yml` files that those `.feature` files use are also deep in the `./docassemble` package. You probably won't be touching the interview files. If you get curious, feel free to ask us.
|
|
198
198
|
|
|
199
199
|
There are other files the docassemble package needs, like `./setup.py`, so if you see them around, don't worry about them.
|
|
200
200
|
|
package/github_server/action.yml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
name: "ALKiln/github_server: Isolated docassemble tests"
|
|
2
2
|
description: "Download and start up a temporary docassemble server on GitHub's servers, in an isolated environment. Avoids docassemble reload errors and other external factors."
|
|
3
3
|
|
|
4
|
-
#
|
|
4
|
+
# Bug? Race condition? Exit with 52 when waiting for container to finish starting
|
|
5
5
|
# https://github.com/SuffolkLITLab/ALKiln/actions/runs/5912900256/job/16036751264#step:4:188
|
|
6
6
|
# Had no completion messages, but it exited with an error anyway
|
|
7
7
|
# Took 121 seconds
|
|
@@ -53,9 +53,6 @@ runs:
|
|
|
53
53
|
run: |
|
|
54
54
|
echo "DA_ADMIN_API_KEY=abcd1234abcd1234abcd5678abdc5678" >> $GITHUB_ENV
|
|
55
55
|
echo "MAX_SECONDS_FOR_DOCKER=${{ inputs.MAX_SECONDS_FOR_DOCKER }}" >> $GITHUB_ENV
|
|
56
|
-
echo "CLONE_URL=${{ github.server_url }}/${{ github.repository }}.git" >> $GITHUB_ENV
|
|
57
|
-
echo "OWNER_AND_REPO_NAME=${{ github.repository }}" >> $GITHUB_ENV
|
|
58
|
-
echo "BRANCH_REF=${{ github.ref }}" >> $GITHUB_ENV
|
|
59
56
|
echo "DA_ADMIN_EMAIL=admin@example.com" >> $GITHUB_ENV
|
|
60
57
|
# Login will fail if this is "password"
|
|
61
58
|
echo "DA_ADMIN_PASSWORD=@123abcdefg" >> $GITHUB_ENV
|
|
@@ -76,7 +73,7 @@ runs:
|
|
|
76
73
|
shell: bash
|
|
77
74
|
- name: "ALKiln github_server: Wait for server to start"
|
|
78
75
|
run: |
|
|
79
|
-
# github_server: Wait for server to start
|
|
76
|
+
# ALKiln github_server: Wait for server to start
|
|
80
77
|
|
|
81
78
|
# Reset the SECONDS variable
|
|
82
79
|
SECONDS=0
|
|
@@ -54,22 +54,6 @@ da.create_project = async function ( project_name, timeout ) {
|
|
|
54
54
|
}
|
|
55
55
|
}; // Ends da.create_project()
|
|
56
56
|
|
|
57
|
-
da.install_on_server = async function ( github_repo, branch_name, timeout ) {
|
|
58
|
-
let options = {
|
|
59
|
-
method: 'POST',
|
|
60
|
-
url: `${ session_vars.get_da_server_url() }/api/package`,
|
|
61
|
-
data: qs.stringify( {
|
|
62
|
-
key: session_vars.get_dev_api_key(),
|
|
63
|
-
github_url: github_repo,
|
|
64
|
-
branch: branch_name
|
|
65
|
-
}),
|
|
66
|
-
timeout: timeout,
|
|
67
|
-
};
|
|
68
|
-
console.log("%o", options);
|
|
69
|
-
|
|
70
|
-
return await axios.request(options);
|
|
71
|
-
};
|
|
72
|
-
|
|
73
57
|
|
|
74
58
|
// node -e 'require("./lib/docassemble/docassemble_api_REST.js").pull()'
|
|
75
59
|
da.pull = async function ( timeout ) {
|
|
@@ -329,27 +329,6 @@ da_i.pull = async function ( pull_options ) {
|
|
|
329
329
|
}
|
|
330
330
|
}; // Ends da_i.pull()
|
|
331
331
|
|
|
332
|
-
|
|
333
|
-
da_i.install_on_server = async function ( install_options ) {
|
|
334
|
-
let { timeout } = install_options || { timeout: DEFAULT_MAX_REQUEST_MS };
|
|
335
|
-
|
|
336
|
-
try {
|
|
337
|
-
let response = await _da_REST.install_on_server(
|
|
338
|
-
session_vars.get_repo_url(),
|
|
339
|
-
session_vars.get_branch_name(),
|
|
340
|
-
timeout
|
|
341
|
-
);
|
|
342
|
-
if ( response && response.status === 200 ) {
|
|
343
|
-
log.debug({ pre: `install task id: ${ response.data.task_id }` });
|
|
344
|
-
return response.data.task_id;
|
|
345
|
-
}
|
|
346
|
-
return null;
|
|
347
|
-
} catch (error ) {
|
|
348
|
-
log.error({ pre: `Installing on the docassemble serve ran into an unexpected error.`, data: error.toJSON()});
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
};
|
|
352
|
-
|
|
353
332
|
// node -e 'require("./lib/docassemble/docassemble_api_interface.js").has_task_finished()'
|
|
354
333
|
da_i.has_task_finished = async function ( api_endpoint, task_id, options ) {
|
|
355
334
|
/** Check task status if it exists. If not, return true as task did
|
|
@@ -1,18 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
//const da_i = require('./docassemble_api_interface');
|
|
4
3
|
const session_vars = require('../utils/session_vars');
|
|
5
4
|
|
|
6
5
|
const server_install = async () => {
|
|
7
|
-
// let task_id = await da_i.install_on_server();
|
|
8
|
-
// if (task_id) {
|
|
9
|
-
// console.log("Waiting...")
|
|
10
|
-
// await da_i.wait_for_package_to_restart(task_id);
|
|
11
|
-
// }
|
|
12
|
-
// console.log("Done!")
|
|
13
|
-
|
|
14
6
|
session_vars.save_install_type("server");
|
|
15
|
-
|
|
16
7
|
}; // Ends server_install();
|
|
17
8
|
|
|
18
9
|
server_install();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@suffolklitlab/alkiln",
|
|
3
|
-
"version": "5.0.2-feat-github-server-
|
|
3
|
+
"version": "5.0.2-feat-github-server-14",
|
|
4
4
|
"description": "Integrated automated end-to-end testing with docassemble, puppeteer, and cucumber.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"scripts": {
|
package/setup.py
CHANGED
|
@@ -42,7 +42,7 @@ def find_package_data(where='.', package='', exclude=standard_exclude, exclude_d
|
|
|
42
42
|
out.setdefault(package, []).append(prefix+name)
|
|
43
43
|
return out
|
|
44
44
|
|
|
45
|
-
setup(name='docassemble.
|
|
45
|
+
setup(name='docassemble.ALKilnTests',
|
|
46
46
|
version='1.0.0',
|
|
47
47
|
description=('A docassemble extension for testing the ALKiln integrated testing framework.'),
|
|
48
48
|
long_description='# ALKiln support package\r\n\r\nAssembly Line Kiln (ALKiln) is a framework for automatically testing **any** [docassemble](https://docassemble.org/) package using GitHub. ALKiln is being developed as part of the SuffolkLITLab Document Assembly Line project. See [documentation for kiln](https://suffolklitlab.github.io/docassemble-AssemblyLine-documentation/docs/automated_integrated_testing).\r\n\r\nThis package supports ALKiln in different ways.\r\n\r\n## Tool to set up testing\r\n\r\n[Tap here to set up automated integrated testing for your docassemble interview](https://apps-dev.suffolklitlab.org/start/test-setup/).\r\n\r\nThis repo contains a step-by-step form that a developer can use to set up automated integrated testing for **any** docassemble package. It requires, among other things, a docassemble account and a temporary GitHub personal access token with correct permissions. It will add necessary GitHub secrets, make a new branch, push necessary files to that branch, and make a PR with that branch.\r\n\r\n',
|
|
@@ -50,11 +50,11 @@ setup(name='docassemble.ALKiln',
|
|
|
50
50
|
author='plocket',
|
|
51
51
|
author_email='example@example.com',
|
|
52
52
|
license='The MIT License (MIT)',
|
|
53
|
-
url='https://suffolklitlab.org/docassemble-AssemblyLine-documentation/docs/
|
|
53
|
+
url='https://suffolklitlab.org/docassemble-AssemblyLine-documentation/docs/alkiln',
|
|
54
54
|
packages=find_packages(),
|
|
55
55
|
namespace_packages=['docassemble'],
|
|
56
56
|
install_requires=['docassemble.ALToolbox>=0.8.2', 'docassemble.AssemblyLine>=2.24.0'],
|
|
57
57
|
zip_safe=False,
|
|
58
|
-
package_data=find_package_data(where='docassemble/
|
|
58
|
+
package_data=find_package_data(where='docassemble/ALKilnTests/', package='docassemble.ALKilnTests'),
|
|
59
59
|
)
|
|
60
60
|
|