Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't test file uploads #18

Closed
nonprofittechy opened this issue Jun 1, 2023 · 4 comments · Fixed by #24
Closed

Can't test file uploads #18

nonprofittechy opened this issue Jun 1, 2023 · 4 comments · Fixed by #24
Assignees
Labels
bug Something isn't working

Comments

@nonprofittechy
Copy link
Member

nonprofittechy commented Jun 1, 2023

WARNING: You can store files to upload in 'docassemble//data/source'. These tests could not find a folder like that. The current directory is  /tmp; is that in the top level folder of your docassemble package? (X)?

ERROR: Error occurred when tried to answer fields on question "file-upload-screen".

**-- Scenario Failed --**

Tried testing the ALWeaver in the playground and got this error.

Also:

Error: ENOENT: no such file or directory, access '/tmp/docassemble'
           at Object.accessSync (fs.js:208:3)
           at Object.uploadFiles (/var/www/.npm-global/lib/node_modules/@suffolklitlab/alkiln/lib/scope.js:1767:10)
           at Object.input (/var/www/.npm-global/lib/node_modules/@suffolklitlab/alkiln/lib/scope.js:1714:21)
           at runMicrotasks ()
           at processTicksAndRejections (internal/process/task_queues.js:97:5)
           at async Object.funnel_the_answer (/var/www/.npm-global/lib/node_modules/@suffolklitlab/alkiln/lib/scope.js:1594:7)
           at async Object.setVariable (/var/www/.npm-global/lib/node_modules/@suffolklitlab/alkiln/lib/scope.js:1525:5)
           at async Object.setFields (/var/www/.npm-global/lib/node_modules/@suffolklitlab/alkiln/lib/scope.js:1965:24)
           at async /var/www/.npm-global/lib/node_modules/@suffolklitlab/alkiln/lib/steps.js:364:23
   - And I should not see the phrase "is the user of the form typically the Plaintiff" # ../var/www/.npm-global/lib/node_modules/@suffolklitlab/alkiln/lib/steps.js:501
   ✔ After # ../var/www/.npm-global/lib/node_modules/@suffolklitlab/alkiln/lib/steps.js:1103

Edit:
Will close SuffolkLITLab/ALKiln#719

@nonprofittechy nonprofittechy added the bug Something isn't working label Jun 1, 2023
@BryceStevenWilley
Copy link
Contributor

Note for us; uploads work in https://github.com/SuffolkLITLab/ALKiln/tree/sources_from_anywhere, but that branch stalled out a bit due to command line option discussions. These lines specifically have the fix.

@plocket
Copy link
Collaborator

plocket commented Jun 6, 2023

We already handle in-the-playground sources for getting the tests to begin with in the command line. This needs to be handled in .uploadFiles() in scope.js.

Unspoken so far: This needs to be an upstream fix in ALKiln. [It might need to be a combined effort, actually, because we need to get the right path for this specific project, which runtime ALKiln doesn't know. We probably need to add something to the runtime config.]

Thanks for the catch, btw, though a shame it blocked you.

@plocket
Copy link
Collaborator

plocket commented Jun 6, 2023

Bryce's comment is a great lead for the long-term v5 release fix, as well as this issue: SuffolkLITLab/ALKiln#687.

[Not sure what we do to detect S3, though, in InThePlayground interview itself. There's probably a way... send a list of paths that ALKiln can try?

To explain further, here's the path for a non-S3 sources folder: /usr/share/docassemble/files/playgroundsources/<id>/<project>/.
Here's the path for an S3 sources folder (which at least one of our users is using): /tmp/playgroundsources/<id>/<project>/.
]

@plocket
Copy link
Collaborator

plocket commented Jun 27, 2023

We've solved this for some situations. For applications like S3, we're going to handle it as described in SuffolkLITLab/ALKiln#719:

As per our discussion in deep dive, [this can be solved in ALKilnInThePlayground]. We can force the files to be cached in the /tmp folder with code like that in the AL dashboard. The arg fix is apparently the key to that. Then the files will be there for at least 2 hours. We might want to add that limitation to the docs at some point, though I'd be surprised if anyone actually runs into that limitation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants