Closed frcroth closed 1 week ago
The pull request introduces enhancements to the end-to-end testing framework for dataset uploads. It adds a new test case in datasets.e2e.ts
to validate the dataset upload process, including reserving uploads, reading files, and performing multipart uploads. Modifications in e2e-setup.ts
improve import structures and URL handling. Additionally, the End2EndSpec.scala
file is updated to manage the test dataset directory more effectively by deleting it if it exists before recreating it.
Files | Change Summary |
---|---|
frontend/javascripts/test/backend-snapshot-tests/datasets.e2e.ts |
Added a new test case for dataset upload functionality, including file reading and multipart upload. |
frontend/javascripts/test/e2e-setup.ts |
Updated imports for FormData and File , refined URL handling in fetchWrapper , extended global scope. |
test/e2e/End2EndSpec.scala |
Modified ensureTestDataset to delete existing dataDirectory before recreating it; updated import statement. |
Objective | Addressed | Explanation |
---|---|---|
e2e tests for dataset uploads (#8099) | ✅ |
testing
, CI
🐰 In the meadow where data flows,
A test for uploads now brightly glows.
With files and forms, we dance and play,
Ensuring our datasets find their way.
So hop along, let’s code and cheer,
For every upload brings us near! 🎉
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
@daniel-wer I have tried to test the frontend. However it is just not easy to do. The resumable JS library uses Browser APIs e.g. File and XMLHttpRequest that are not available in the node test environment. I tried to mock them e.g. using JSDom, but it failed at sending the Multipart Formdata correctly (compare https://github.com/jsdom/jsdom/issues/2300). So maybe it would be possible to do it but that way was tried and failed. I also looked into pupetter, but that did not seem easy either and would probably slow down the test suite significantly.
Steps to test:
Issues:
Summary by CodeRabbit
New Features
FormData
andFile
.Bug Fixes
fetchWrapper
function to ensure correct protocol handling.Refactor
ensureTestDataset
method to delete and recreate the data directory, improving test setup reliability.