Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: add a test case for oss util #847

Merged
merged 1 commit into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,5 @@ jobs:
run: go run ./main/main.go
- run: make build
- run: test -z $ACCESS_KEY_ID -a -z $ACCESS_KEY_SECRET || bash ./integration/ecs_test
- run: test -z $ACCESS_KEY_ID -a -z $ACCESS_KEY_SECRET || bash ./integration/oss_test.sh
- run: bash <(curl -s https://codecov.io/bash)
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ resource/metas.go
local-*
coverage.txt
oss/lib/ossutil_test*
coverage.html
coverage.html
integration/*.txt
25 changes: 25 additions & 0 deletions integration/oss_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env bash

BUCKET="sdk-oss-test"

# cleanup
aliyun oss rm oss://$BUCKET/test.txt
rm ./downloaded.txt

# ready to go
echo "version1" > ./test.txt
aliyun oss cp ./test.txt oss://$BUCKET/test.txt

echo "version2" > ./test.txt
aliyun oss cp ./test.txt oss://$BUCKET/test.txt -f

aliyun oss cp oss://$BUCKET/test.txt ./downloaded.txt

OUTPUT=$(cat ./downloaded.txt)

if [[ "$OUTPUT" == "version2" ]];
then
exit 0;
else
exit 1;
fi
Loading