Skip to content
This repository was archived by the owner on Oct 18, 2021. It is now read-only.

tests: Introduce STORAGE_AZBLOB_INTEGRATION_TEST #12

Merged
merged 2 commits into from
Apr 22, 2021
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/intergration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:

- name: Test
env:
STORAGE_AZBLOB_INTEGRATION_TEST: ${{ secrets.STORAGE_INTEGRATION_TEST }}
STORAGE_AZBLOB_CREDENTIAL: ${{ secrets.STORAGE_AZBLOB_CREDENTIAL }}
STORAGE_AZBLOB_NAME: ${{ secrets.STORAGE_AZBLOB_NAME }}
STORAGE_AZBLOB_ENDPOINT: ${{ secrets.STORAGE_AZBLOB_ENDPOINT }}
Expand Down
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,15 @@ generate:
go generate ./...
go fmt ./...

build: generate tidy check
build: tidy generate check
go build ./...

test:
go test -race -coverprofile=coverage.txt -covermode=atomic -v .
go tool cover -html="coverage.txt" -o "coverage.html"

integration_test:
go clean -testcache ./tests
go test -tags integration_test -race -covermode=atomic -v ./tests
go test -count=1 -race -covermode=atomic -v ./tests

tidy:
go mod tidy
Expand Down
1 change: 1 addition & 0 deletions Makefile.env.example
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export STORAGE_AZBLOB_INTEGRATION_TEST=on
export STORAGE_AZBLOB_CREDENTIAL=hmac:access_key:secret_key
export STORAGE_AZBLOB_NAME=bucketname
export STORAGE_AZBLOB_ENDPOINT=https:accountname.blob.core.windows.net
3 changes: 3 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ=
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM=
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
Expand All @@ -78,6 +79,7 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
Expand Down Expand Up @@ -110,6 +112,7 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU=
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/src-d/go-billy.v4 v4.3.0 h1:KtlZ4c1OWbIs4jCv5ZXrTqG8EQocr0g/d4DjNg70aek=
gopkg.in/src-d/go-billy.v4 v4.3.0/go.mod h1:tm33zBoOwxjYHZIE+OV8bxTWFMJLrconzFMd38aARFk=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
Expand Down
6 changes: 4 additions & 2 deletions tests/storage_test.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
// +build integration_test

package tests

import (
"os"
"testing"

tests "github.com/aos-dev/go-integration-test/v3"
)

func TestStorage(t *testing.T) {
if os.Getenv("STORAGE_AZBLOB_INTEGRATION_TEST") != "on" {
t.Skipf("STORAGE_AZBLOB_INTEGRATION_TEST is not 'on', skipped")
}
tests.TestStorager(t, setupTest(t))
}
4 changes: 1 addition & 3 deletions tests/utils_test.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
// +build integration_test

package tests

import (
"os"
"testing"

azblob "github.com/aos-dev/go-service-azblob"
ps "github.com/aos-dev/go-storage/v3/pairs"
"github.com/aos-dev/go-storage/v3/types"
"github.com/google/uuid"
azblob "github.com/aos-dev/go-service-azblob"
)

func setupTest(t *testing.T) types.Storager {
Expand Down
7 changes: 7 additions & 0 deletions tools.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// +build tools

package azblob

import (
_ "github.com/aos-dev/go-storage/v3/cmd/definitions"
)