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

Run all except cache tests concurrently #2022

Merged
merged 3 commits into from
Jun 17, 2024
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
8 changes: 5 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@ jobs:
CGO_ENABLED=0 go build ./...
go install ./tools/build_gcsfuse
build_gcsfuse . /tmp ${GITHUB_SHA}
- name: Test
run: CGO_ENABLED=0 go test -p 1 -count 1 -v ./...
- name: Test all except caching parallely
run: CGO_ENABLED=0 go test -count 1 -v `go list ./... | grep -v internal/cache/...`
- name: Test caching
run: CGO_ENABLED=0 go test -p 1 -count 1 -v ./internal/cache/...
- name: Cache RaceDetector Test
run: CGO_ENABLED=1 go test -p 1 -count 1 -v -race ./internal/cache/...
run: go test -p 1 -count 1 -v -race ./internal/cache/...
lint:
name: Lint
runs-on: ubuntu-20.04
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,11 @@ jobs:
- name: Download dependencies
run: go mod download

- name: Test and coverage
run: CGO_ENABLED=0 go test -p 1 -covermode=atomic -v -coverprofile=coverage.out ./...
- name: Coverage for all except cache tests parallely.
run: CGO_ENABLED=0 go test -count 1 -v -covermode=atomic -coverprofile=coverage.out `go list ./... | grep -v internal/cache/...`

- name: Coverage for cache tests
run: CGO_ENABLED=0 go test -p 1 -count 1 -v -covermode=atomic -coverprofile=coverage_cache.out ./internal/cache/...

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4.3.1
Expand Down
10 changes: 4 additions & 6 deletions internal/storage/fake_storage_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ import (
"github.com/googlecloudplatform/gcsfuse/v2/internal/storage/gcs"
)

const port uint16 = 8081
const host string = "127.0.0.1"

const TestBucketName string = "gcsfuse-default-bucket"
const TestObjectRootFolderName string = "gcsfuse/"
const TestObjectName string = "gcsfuse/default.txt"
Expand Down Expand Up @@ -66,7 +63,10 @@ func (f *fakeStorage) ShutDown() {
}

func NewFakeStorage() FakeStorage {
f, _ := createFakeStorageServer(getTestFakeStorageObject())
f, err := createFakeStorageServer(getTestFakeStorageObject())
if err != nil {
panic(err)
}
fakeStorage := &fakeStorage{
fakeStorageServer: f,
}
Expand Down Expand Up @@ -134,8 +134,6 @@ func getTestFakeStorageObject() []fakestorage.Object {
func createFakeStorageServer(objects []fakestorage.Object) (*fakestorage.Server, error) {
return fakestorage.NewServerWithOptions(fakestorage.Options{
InitialObjects: objects,
Host: host,
Port: port,
})
}

Expand Down
Loading