-
Notifications
You must be signed in to change notification settings - Fork 9
Testing
Norris Ng edited this page Aug 28, 2023
·
16 revisions
In the future, regression may possibly be automated, but in the meantime, here's a list of test cases to run through.
Sync a particular bucket so that COMS tracks all of the files in the corresponding S3 bucket.
- An existing S3 bucket is available
- Upload some files directly to an S3 bucket
- Create a COMS bucket (i.e.
PUT /bucket
) for said S3 bucket and save thebucketId
- Test both versioned and non-versioned buckets (in a separate test, of course)
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
{number of files in COMS bucket} === {number of files in S3}
{names of files in COMS bucket} === {names of files in S3}
- 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
{number of files in COMS bucket} === {number of files in S3}
{names of files in COMS bucket} === {names of files in S3}
Sync the default bucket so that COMS tracks all of the files in the corresponding S3 bucket.
- COMS has been configured with a default S3 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
{number of files in default COMS bucket} === {number of files in S3}
{names of files in default COMS bucket} === {names of files in S3}
Sync a particular object so that COMS tracks all of the changes in the corresponding S3 object.
- There is a COMS bucket that links to an existing unversioned S3 bucket
- Upload file via COMS API (i.e.
PUT /object
) - Overwrite just-uploaded file 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
{contents of file retrieved via COMS} === {contents of file uploaded via S3}
- Upload file via COMS API (i.e.
PUT /object
) GET /object/:objectId/sync
GET /sync/status
GET /object/:objectId/
-
GET /sync/status
returns0
{contents of file retrieved via COMS} === {contents of file uploaded via S3}
- Upload file via COMS API (i.e.
PUT /object
) - Delete file directly via S3
GET /object/:objectId/sync
- Call
GET /sync/status
every few seconds, until it returns0
- 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
GET /object/:objectId/
-
GET /object/:objectId/
returns HTTP 404
Sync a particular object so that COMS tracks all of the changes in the corresponding S3 object.
- There is a COMS bucket that links to an existing versioned S3 bucket
- 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
GET /object/:objectId/
{contents of file retrieved via COMS} === {contents of file uploaded via S3}
{latest version ID of file on COMS} === {latest version ID of file on S3}
- Upload file via COMS API (i.e.
PUT /object
) GET /object/:objectId/sync
GET /sync/status
GET /object/:objectId/
-
GET /sync/status
returns0
{contents of file retrieved via COMS} === {contents of file uploaded via S3}
{latest version ID of file on COMS} === {latest version ID of file on S3}
- Upload file via COMS API (i.e.
PUT /object
) - Delete latest version of object directly via S3
GET /object/:objectId/sync
- Call
GET /sync/status
every few seconds, until it returns0
- 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
GET /object/:objectId/
{contents of file retrieved via COMS} === {contents of file uploaded via S3}
{latest version ID of file on COMS} === {latest version ID of file on S3}
- Upload file via COMS API (i.e.
PUT /object
) - Delete object via COMS API, specifying the S3 version ID (i.e.
DELETE /object/{objectId}?s3VersionId={s3VersionId}
) - Restore deleted version directly via S3 (i.e. by removing the delete marker on the version deleted in Step 2)
GET /object/:objectId/sync
- Call
GET /sync/status
every few seconds, until it returns0
- 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
GET /object/:objectId/
{content of file retrieved via COMS} === {contents of file version restored in S3}
{latest version ID of file on COMS} === {latest version ID of file on S3}
Return Home
API User Guide:
- Authentication
- Endpoint Notes
- Permissions
- Metadata and Tags
- Managing buckets
- Synchronization
- Use-Case Examples
Deployment Guide:
The Hosted Service: