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

Refactor action #163

Merged
merged 4 commits into from
Dec 2, 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
51 changes: 47 additions & 4 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ on:
branches: [ master ]
pull_request:
branches: [ master ]

concurrency:
group: ${{ github.head_ref }}
cancel-in-progress: true

jobs:
go-client:
runs-on: ubuntu-latest
Expand All @@ -14,10 +19,48 @@ jobs:
with:
go-version: '1.13'
- name: Test with GO test
run: make ci
run: |
make up
sleep 10
make test
- name: down
if: always()
run: |
make down
go-client-ssl:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup go
uses: actions/setup-go@v1
with:
go-version: '1.13'
- name: Test SSL connection with CA
run: make ssl-test
run: |
make up-ssl
make ssl-test
- name: Test SSL connection self-signed
run: make ssl-test-self-signed
run: |
make up-ssl
make ssl-test-self-signed
- name: down
if: always()
run: |
make down
go-client-example:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup go
uses: actions/setup-go@v1
with:
go-version: '1.13'
- name: Run examples
run: make run-examples
run: |
make up
sleep 10
make run-examples
- name: down
if: always()
run: |
make down
28 changes: 10 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: build test fmt ci ssl-test run-examples
.PHONY: build test fmt up up-ssl down ssl-test run-examples

default: build

Expand All @@ -12,33 +12,25 @@ test:

fmt:
go fmt
up:
cd ./nebula-docker-compose && docker-compose up -d

ci:
cd ./nebula-docker-compose && docker-compose up -d && \
sleep 10 && \
cd .. && \
go test -v -race; \
up-ssl:
cd ./nebula-docker-compose && enable_ssl=true docker-compose up -d

down:
cd ./nebula-docker-compose && docker-compose down -v

ssl-test:
cd ./nebula-docker-compose && enable_ssl=true docker-compose up -d && \
sleep 10 && \
cd .. && \
go test -v -run TestSslConnection; \
cd ./nebula-docker-compose && docker-compose down -v
ssl_test=true go test -v -run TestSslConnection;

ssl-test-self-signed:
cd ./nebula-docker-compose && enable_ssl=true docker-compose up -d && \
sleep 10 && \
cd .. && \
ssl_test=true go test -v -run TestSslConnection; \
cd ./nebula-docker-compose && docker-compose down -v
self_signed=true go test -v -run TestSslConnection;

run-examples:
cd ./nebula-docker-compose && enable_ssl=true docker-compose up -d && \
sleep 10 && \
cd .. && \
go run basic_example/graph_client_basic_example.go && \
go run gorountines_example/graph_client_goroutines_example.go && \
go run json_example/parse_json_example.go && \
cd ./nebula-docker-compose && docker-compose down -v
go run json_example/parse_json_example.go
3 changes: 2 additions & 1 deletion client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,8 @@ func TestServiceDataIO(t *testing.T) {
// test base type
{
query :=
"FETCH PROP ON person \"Bob\" YIELD person.name, person.age, person.grade," +
"FETCH PROP ON person \"Bob\" YIELD vertex as VertexID," +
"person.name, person.age, person.grade," +
"person.friends, person.book_num, person.birthday, " +
"person.start_school, person.morning, " +
"person.property, person.is_girl, person.child_name, " +
Expand Down
2 changes: 1 addition & 1 deletion result_set_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func TestAsDedupList(t *testing.T) {
UVal: &nebula.NSet{Values: valList},
}
valWrap := ValueWrapper{&value, testTimezone}
assert.Equal(t, "[\"elem1\", \"elem2\", \"elem3\"]", valWrap.String())
assert.Equal(t, "{\"elem1\", \"elem2\", \"elem3\"}", valWrap.String())
assert.Equal(t, true, valWrap.IsSet())

res, _ := valWrap.AsList()
Expand Down