Skip to content

Commit 358cbb1

Browse files
committed
Enables circle ci integration test and linter errors fix
1 parent bdcb7e7 commit 358cbb1

3 files changed

Lines changed: 11 additions & 27 deletions

File tree

.circleci/config.yml

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -21,34 +21,22 @@ jobs:
2121
- run: make lint
2222

2323
integration:
24-
docker:
25-
- image: golang:1.16
24+
machine:
25+
image: ubuntu-2004:202104-01
2626
steps:
2727
- checkout
2828
- run:
29-
name: "Prebuild"
30-
command: |
31-
echo "Prebuild..."
32-
- run:
33-
name: "Launch background processes"
34-
background: true
35-
command: |
36-
echo "Starting executables we need in background"
37-
- run:
38-
name: "Give time for processes to start"
39-
command: sleep 3
40-
- run:
41-
name: "Run tests"
29+
name: "Run database tests"
4230
command: |
43-
make test_integration
31+
make test-database-services
4432
4533
workflows:
4634
version: 2
4735
build_all:
4836
jobs:
4937
- build
5038
- checks
51-
# - integration:
52-
# requires:
53-
# - build
54-
# - checks
39+
- integration:
40+
requires:
41+
- build
42+
- checks

connections/database/mongoDB.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@ import (
1111
"go.mongodb.org/mongo-driver/mongo/readpref"
1212
)
1313

14-
type MongoConnection struct {
15-
db *mongo.Client
16-
}
17-
1814
func (c *DBQueryClient) Connect() error {
1915
uri := os.Getenv("MONGO_URI")
2016
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)

connections/database/mongoDB_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ func TestBuffer_InsertRead(t *testing.T) {
1919
}
2020

2121
coll := c.Client.Database("test").Collection("sample")
22-
res, err := coll.InsertOne(context.TODO(), bson.D{{Key: "name",Value: "Alice"}})
22+
res, err := coll.InsertOne(context.TODO(), bson.D{{Key: "name", Value: "Alice"}})
2323
if err != nil {
2424
fmt.Println(err)
2525
t.Fail()
@@ -29,11 +29,11 @@ func TestBuffer_InsertRead(t *testing.T) {
2929
// Find the document for which the _id field matches id.
3030
// Specify the Sort option to sort the documents by age.
3131
// The first document in the sorted order will be returned.
32-
opts := options.FindOne().SetSort(bson.D{{Key: "age",Value: 1}})
32+
opts := options.FindOne().SetSort(bson.D{{Key: "age", Value: 1}})
3333
var result bson.M
3434
readErr := coll.FindOne(
3535
context.TODO(),
36-
bson.D{{Key: "_id",Value: res.InsertedID}},
36+
bson.D{{Key: "_id", Value: res.InsertedID}},
3737
opts,
3838
).Decode(&result)
3939
if readErr != nil {

0 commit comments

Comments
 (0)