Repository navigation
Closed
Description
Problem
We lack end-to-end testing for the dataset upload flow. Users encounter errors that we don't catch during development because:
- No automated tests for the full upload workflow
- No safe sandbox environment for users to experiment
- No way to test without affecting production data
Proposed Solution
Create a sandbox environment with the following characteristics:
Sandbox Datasets (xx000xxx pattern)
- Dataset IDs matching
xx000xxxpattern are sandbox datasets - Stored under
s3://nemar/sandbox/instead of production paths - DOI creation (final approval) is disabled
- Files limited to <10MB size
- Can be deleted/cleaned up periodically
Testing Scripts
Create a test suite that validates:
Basic Functions (smoke tests):
-
nemar auth login/nemar auth status -
nemar dataset validateon sample BIDS dataset -
nemar dataset upload(to sandbox) -
nemar dataset download(from sandbox) -
nemar dataset list --mine
Extended Functions:
-
nemar dataset request-access -
nemar dataset invite -
nemar admin approve/nemar admin revoke - Presigned URL generation and upload
- Git-annex URL registration
- GitHub repo creation and branch protection
Sample Test Dataset
Create a small (<50MB) BIDS-compliant test dataset with:
- A few EDF/BDF files (small recordings)
- Required metadata (dataset_description.json, participants.tsv, etc.)
- Stored in repo or downloadable for testing
Implementation Steps
- Add sandbox detection to backend (check dataset_id pattern)
- Configure separate S3 prefix for sandbox
- Modify presigned URL generation for sandbox path
- Add file size validation for sandbox uploads
- Block DOI creation for sandbox datasets
- Create sample BIDS test dataset
- Write test scripts using the sample dataset
- Add CI workflow to run tests periodically
Benefits
- Catch integration issues before users do
- Safe playground for new users to learn
- Automated regression testing
- Validate each release works end-to-end
Related
- Issue Fail on AWS keys #11 - User upload failure that could have been caught with E2E tests
- Issue Upload should use backend-provided S3 credentials, not user environment variables #13 - AWS credentials issue discovered in production
Metadata
Metadata
Assignees
Labels
No labels
Activity
neuromechanist commentedon Jan 16, 2026
Implementation Plan Summary
Workflow Overview
Before uploading real datasets:
nemar auth loginnemar sandbox"nemar sandboxs3://nemar/sandbox/xx000xxx/)sandbox_completed=truenemar dataset uploadIf user tries to upload without sandbox:
sandbox_completedflagnemar sandbox"Commands
Placeholder Dataset Structure
Total size: ~500KB (quick upload, enough to test full S3 pipeline)
Key Benefits
xx000xxxdataset IDsBackend Changes
sandbox_completed,sandbox_completed_at,sandbox_dataset_idto users tablesandboxtype toid_sequenceforxx000xxxIDs/datasetsto acceptsandbox: trueflag/sandbox/completeand/sandbox/resetendpointsWork in progress on branch
feature/sandbox-training.feat: add sandbox training requirement for uploads
neuromechanist commentedon Jan 17, 2026
Progress Update
PR #24 (merged to dev) implemented the sandbox training feature which addresses several items:
Completed ✅
Sandbox Datasets:
xx######pattern are sandbox datasetss3://nemar/staging/sandbox/instead of production pathsTesting Scripts - Basic Functions:
nemar dataset validateon sample BIDS dataset (sandbox creates sample)nemar dataset upload(to sandbox)Sample Test Dataset:
Implementation Steps:
Still Pending ⏳
Testing Scripts:
nemar auth login/nemar auth statusnemar dataset download(from sandbox)nemar dataset list --minenemar dataset request-accessnemar dataset invitenemar admin approve/nemar admin revokeImplementation:
neuromechanist commentedon Jan 17, 2026
Related: PR #24 (squash merged to dev as commit 6d2215e)