Skip to content

Commit 34c5067

Browse files
committed
fix: workflow name added, file name corrected. Readme updated
1 parent 754c3e0 commit 34c5067

File tree

2 files changed

+32
-12
lines changed

2 files changed

+32
-12
lines changed

.github/workflows/alioss-integration copy.yml renamed to .github/workflows/alioss-integration.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
name: Alioss Integration Tests
2+
13
on:
24
push:
35
pull_request:

alioss/README.md

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Ali Storage CLI
22

33
The Ali Storage CLI is for uploading, fetching and deleting content to and from an Ali OSS.
4-
It is highly inspired by the https://github.com/cloudfoundry/bosh-s3cli.
4+
It is highly inspired by the [storage-cli/s3](https://github.com/cloudfoundry/storage-cli/blob/6058f516e9b81471b64a50b01e228158a05731f0/s3)
55

66
## Usage
77

@@ -47,14 +47,32 @@ curl -X PUT -T path/to/file <signed url>
4747
# Downloading a blob:
4848
curl -X GET <signed url>
4949
```
50-
## Running integration tests
51-
52-
To run the integration tests:
53-
- Export the following variables into your environment:
54-
``` bash
55-
export ACCESS_KEY_ID=<your Alibaba access key id>
56-
export ACCESS_KEY_SECRET=<your Alibaba access key secret>
57-
export ENDPOINT=<your Alibaba OSS endpoint>
58-
export BUCKET_NAME=<your Alibaba OSS bucket>
59-
```
60-
- go build && go test ./integration/...
50+
## Running Tests
51+
52+
### Unite Tests
53+
```bash
54+
go install github.com/onsi/ginkgo/v2/ginkgo
55+
ginkgo --skip-package=integration --randomize-all --cover -v -r ./alioss/...
56+
```
57+
### Integration Tests
58+
59+
- To run the integration tests with your existing bucket:
60+
1. Export the following variables into your environment:
61+
``` bash
62+
export ACCESS_KEY_ID=<your Alibaba access key id>
63+
export ACCESS_KEY_SECRET=<your Alibaba access key secret>
64+
export ENDPOINT=<your Alibaba OSS endpoint>
65+
export BUCKET_NAME=<your Alibaba OSS bucket>
66+
```
67+
1. go build -o ./alioss ./alioss && go test ./alioss/integration/...
68+
69+
- To run it from scratch; create a new bucket, run tests, delete the bucket
70+
1. Create a user in your ali account and add policy `AliyunOSSFullAccess` or restrict the users with more granular policies like `oss:CreateBucket, oss:DeleteBucket` etc.
71+
1. Create access key for the user.
72+
1. Export `AccessKeyId` with command `export access_key_id=<AccessKeyId>`.
73+
1. Export `AccessKeySecret` with command `export access_key_secret=<AccessKeyId>`.
74+
1. Export `Profile` with command `export profile=<Profile>`.
75+
1. Navigate to project's root folder.
76+
1. Run environment setup script to create container `/.github/scripts/alioss/setup.sh`.
77+
1. Run tests `/.github/scripts/alioss/run-int.sh`.
78+
1. Run environment teardown script to delete test resources `/.github/scripts/alioss/teardown.sh`.

0 commit comments

Comments
 (0)