Skip to content

Commit

Permalink
test (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
nikolaydubina authored May 3, 2024
1 parent 2e24c86 commit 03d6230
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ jobs:
uses: actions/checkout@v2

- name: Test
env:
AWS_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: go test -v -coverprofile=coverage.txt -covermode=atomic ./...

- name: Upload coverage to Codecov
Expand Down
21 changes: 16 additions & 5 deletions aws_s3_reader_seeker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"testing"

"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/s3"
"github.com/aws/aws-sdk-go/service/s3/s3manager"
Expand All @@ -15,7 +16,9 @@ import (

func TestS3ReadSeeker(t *testing.T) {
mySession := session.Must(session.NewSession(
aws.NewConfig().WithRegion("ap-southeast-1"),
aws.NewConfig().
WithRegion("ap-southeast-1").
WithCredentials(credentials.AnonymousCredentials),
))
s3client := s3.New(mySession)

Expand Down Expand Up @@ -64,7 +67,9 @@ func TestS3ReadSeeker(t *testing.T) {

func TestS3ReadSeeker_SeekLarge(t *testing.T) {
mySession := session.Must(session.NewSession(
aws.NewConfig().WithRegion("ap-southeast-1"),
aws.NewConfig().
WithRegion("ap-southeast-1").
WithCredentials(credentials.AnonymousCredentials),
))
s3client := s3.New(mySession)

Expand Down Expand Up @@ -118,7 +123,9 @@ func TestS3ReadSeeker_SeekLarge(t *testing.T) {

func TestS3ReadSeeker_SeekDiscardHTTPBody(t *testing.T) {
mySession := session.Must(session.NewSession(
aws.NewConfig().WithRegion("ap-southeast-1"),
aws.NewConfig().
WithRegion("ap-southeast-1").
WithCredentials(credentials.AnonymousCredentials),
))
s3client := s3.New(mySession)

Expand Down Expand Up @@ -183,7 +190,9 @@ func TestS3ReadSeeker_SeekDiscardHTTPBody(t *testing.T) {

func TestS3ReadSeeker_NotFoundObject(t *testing.T) {
mySession := session.Must(session.NewSession(
aws.NewConfig().WithRegion("ap-southeast-1"),
aws.NewConfig().
WithRegion("ap-southeast-1").
WithCredentials(credentials.AnonymousCredentials),
))
s3client := s3.New(mySession)

Expand All @@ -209,7 +218,9 @@ func TestS3ReadSeeker_NotFoundObject(t *testing.T) {

func ExampleS3ReadSeeker() {
s3client := s3.New(session.Must(session.NewSession(
aws.NewConfig().WithRegion("ap-southeast-1"),
aws.NewConfig().
WithRegion("ap-southeast-1").
WithCredentials(credentials.AnonymousCredentials),
)))

r := awss3reader.NewS3ReadSeeker(
Expand Down

0 comments on commit 03d6230

Please sign in to comment.