Skip to content

Commit

Permalink
github action workflows for test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
siddhantprateek committed Feb 18, 2024
1 parent b29cb21 commit 8eb439b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 20 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/app-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ jobs:
with:
repository: siddhantprateek/qdrant

- name: Start Docker Compose services
run: docker-compose -f docker-compose.yml up -d

- name: Set up Go
uses: actions/setup-go@v4
with:
Expand All @@ -29,5 +32,5 @@ jobs:
- name: Run Go tests
run: go test ./...

- name: Clean up Qdrant DB container
run: docker stop qdrant_db_container && docker rm qdrant_db_container
- name: Clean up Docker Compose services
run: docker-compose -f docker-compose.yml down
17 changes: 0 additions & 17 deletions config/config_test.go
Original file line number Diff line number Diff line change
@@ -1,26 +1,9 @@
package config_test

import (
"os"
"qdrant/config"
"testing"

"github.com/joho/godotenv"
"github.com/stretchr/testify/assert"
)

func TestGetEnviron(t *testing.T) {
err := godotenv.Load("test.env")
assert.Nil(t, err)

expectedValue := "TestValue"
os.Setenv("TEST_VARIABLE", expectedValue)

result := config.GetEnviron("TEST_VARIABLE")
assert.Equal(t, expectedValue, result)

result = config.GetEnviron("NON_EXISTING_VARIABLE")
assert.Empty(t, result)

os.Unsetenv("TEST_VARIABLE")
}
2 changes: 1 addition & 1 deletion connection/qdrant_db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func TestQdrantDBConn(t *testing.T) {

assert.Equal(t, expectedAddr, conn.Target())

collectionName := "test_collection_15"
collectionName := "test_collection_18"
_, err := collectionsClient.Create(ctx, &pb.CreateCollection{
CollectionName: collectionName,
VectorsConfig: &pb.VectorsConfig{Config: &pb.VectorsConfig_Params{
Expand Down

0 comments on commit 8eb439b

Please sign in to comment.