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

Create integration tests #201

Merged
merged 5 commits into from
May 6, 2022
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
12 changes: 7 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
.PHONY: build test fmt up up-ssl down ssl-test run-examples
.PHONY: build unit test fmt up up-ssl down ssl-test run-examples

default: build

build: fmt
go mod tidy
go build

unit:
go mod tidy
go test -v -race --covermode=atomic --coverprofile coverage.out
test:
go mod tidy
go test -v -race
go test -v -race --tags=integration --covermode=atomic --coverprofile coverage.out

fmt:
go fmt
Expand All @@ -22,10 +24,10 @@ down:
cd ./nebula-docker-compose && docker-compose down -v

ssl-test:
ssl_test=true go test -v -run TestSslConnection;
ssl_test=true go test -v --tags=integration -run TestSslConnection;

ssl-test-self-signed:
self_signed=true go test -v -run TestSslConnection;
self_signed=true go test -v --tags=integration -run TestSslConnection;

run-examples:
go run basic_example/graph_client_basic_example.go && \
Expand Down
18 changes: 11 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# nebula-go

[![Go Reference](https://pkg.go.dev/badge/github.com/vesoft-inc/nebula-go/v3.svg)](https://pkg.go.dev/github.com/vesoft-inc/nebula-go/v3)
![functional tests](https://github.com/vesoft-inc/nebula-go/actions/workflows/test.yaml/badge.svg)

**IMPORTANT: Code of Nebula go client has been transferred from [nebula-clients](https://github.com/vesoft-inc/nebula-clients) to this repository(nebula-go), and new releases in the future will be published in this repository.
Please update your go.mod and imports correspondingly.**
Expand All @@ -19,7 +21,6 @@ To Use the console with a stable release of Nebula Graph, please check the branc
| **[v3.1.x](https://github.com/vesoft-inc/nebula-go/tree/v3.1.0)** | 3.1.x |
| **[master](https://github.com/vesoft-inc/nebula-go/tree/master)** | 3.x-nightly |


Please be careful not to modify the files in the nebula directory, these codes were all generated by fbthrift.

**NOTE** Installing Nebula Go v2.5.0 could cause **checksum mismatch**, use v2.5.1 instead.
Expand All @@ -29,18 +30,21 @@ Please be careful not to modify the files in the nebula directory, these codes w
```shell
$ go get -u -v github.com/vesoft-inc/nebula-go/v3@master
```

You can specify the version of Nebula-go by substituting `<tag>` in `$ go get -u -v github.com/vesoft-inc/nebula-go@<tag>`.
For example:
for v3: `$ go get -u -v github.com/vesoft-inc/nebula-go/v3@v3.1.0`
for v2: `$ go get -u -v github.com/vesoft-inc/nebula-go/v2@v2.6.0`
For example:

for v3: `$ go get -u -v github.com/vesoft-inc/nebula-go/v3@v3.1.0`
for v2: `$ go get -u -v github.com/vesoft-inc/nebula-go/v2@v2.6.0`

**Note**: You will get a message like this if you don't specify a tag:
> ```

> ```shell
> $ go get -u -v github.com/vesoft-inc/nebula-go/v2@master
> go: github.com/vesoft-inc/nebula-go/v2 master => v2.0.0-20210506025434-97d4168c5c4d
> ```
> Here the ` 20210506025434-97d4168c5c4d` is a version tag auto-generated by Github using commit date and SHA.
>
> Here the `20210506025434-97d4168c5c4d` is a version tag auto-generated by Github using commit date and SHA.
> This should match the latest commit in the master branch.

## Usage example
Expand Down
4 changes: 3 additions & 1 deletion client_test.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
//go:build integration
// +build integration

/*
*
* Copyright (c) 2020 vesoft inc. All rights reserved.
*
* This source code is licensed under Apache 2.0 License.
*
*/

package nebula_go

import (
Expand Down
3 changes: 3 additions & 0 deletions session_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build integration
// +build integration

/* Copyright (c) 2021 vesoft inc. All rights reserved.
*
* This source code is licensed under Apache 2.0 License.
Expand Down
3 changes: 3 additions & 0 deletions ssl_connection_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build integration
// +build integration

/*
*
* Copyright (c) 2020 vesoft inc. All rights reserved.
Expand Down