-
Notifications
You must be signed in to change notification settings - Fork 9
Testing
Norris Ng edited this page Aug 22, 2023
·
16 revisions
In the future, regression tests will be automated, but in the meantime, here's a methodical way of manually testing them.
Synchronization features are implemented via the following API endpoints, which need to be tested:
Endpoint | Purpose |
---|---|
/bucket/:bucketId/sync |
Sync a particular bucket |
/sync |
Sync with the default bucket |
/sync/status |
Get sync queue size |
/object/:objectId/sync |
Sync a particular object |
Note: /sync/status
is tested as part of the other sync endpoints.
Sync a particular bucket
- Create a COMS bucket (i.e.
PUT /bucket
) and save thebucketId
- Test both versioned and non-versioned buckets (in a separate test, of course)
- Upload some files directly via S3
GET /bucket/:bucketId/sync
- Call
GET /sync/status
every few seconds, until it returns0
- On the first call, assert that it returns
{number of files uploaded via S3}
- Continue to call the endpoint every few seconds until returns
0
- On the first call, assert that it returns
- Assert:
{number of files in S3} === {number of files in COMS bucket}
{names of files in S3} === {names of files in COMS bucket}
Sync with the default bucket
Similar to /bucket/:bucketId/sync
, but without creating a separate bucket:
- Upload some files directly via S3
GET /sync
- Call
GET /sync/status
every few seconds, until it returns0
- On the first call, assert that it returns
{number of files uploaded via S3}
- Continue to call the endpoint every few seconds until returns
0
- On the first call, assert that it returns
- Assert:
{number of files in S3} === {number of files in default COMS bucket}
{names of files in S3} === {names of files in default COMS bucket}
Sync a particular object
- Create a COMS bucket (i.e.
PUT /bucket
) and save thebucketId
- Upload file via COMS API (i.e.
PUT /object
) - Overwrite just-uploaded file with a newer version directly via S3
GET /object/:objectId/sync
- Call
GET /sync/status
every few seconds- On the first call, assert that it returns
1
- Continue to call the endpoint every few seconds until returns
0
- On the first call, assert that it returns
- Assert:
{content of file uploaded via S3} === {content of file retrieved via COMS}
{latest version ID of file on S3} === {latest version ID of file on COMS}
Return Home
API User Guide:
- Authentication
- Endpoint Notes
- Permissions
- Metadata and Tags
- Managing buckets
- Synchronization
- Use-Case Examples
Deployment Guide:
The Hosted Service: