Skip to content

Commit

Permalink
Merge pull request #61 from dictyBase/ci/update-github-actions
Browse files Browse the repository at this point in the history
Pulling ci/update-github-actions into develop
  • Loading branch information
kodiakhq[bot] authored Jul 8, 2022
2 parents 3511214 + 434b23e commit 15e0a27
Show file tree
Hide file tree
Showing 9 changed files with 98 additions and 87 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ jobs:
runs-on: ubuntu-20.04
services:
arangodb:
image: arangodb:3.6.3
image: arangodb:3.6.8
env:
ARANGO_ROOT_PASSWORD: rootpass
ports:
- 8529/tcp
steps:
- name: set up golang
uses: actions/setup-go@v2
uses: actions/setup-go@v3
with:
go-version: 1.16.3
go-version: 1.18
- name: check out code
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: unit test
run: go test -covermode=atomic -coverprofile=profile.cov -cpu 4 -v ./...
env:
Expand All @@ -29,7 +29,6 @@ jobs:
ARANGO_HOST: localhost
ARANGO_PORT: ${{ job.services.arangodb.ports[8529] }}
- name: upload coverage to codecov
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v3
with:
file: ./profile.cov
token: ${{ secrets.CODECOV_TOKEN }}
11 changes: 4 additions & 7 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,9 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: check out code
uses: actions/checkout@v2
- uses: actions/setup-go@v2
uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.16.3
go-version: 1.18
- name: run linter
uses: reviewdog/action-golangci-lint@v1
with:
github_token: ${{ secrets.github_token }}
golangci_lint_flags: "-c .golangci.yml"
uses: golangci/golangci-lint-action@v3
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: set up nodejs
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: 14.16.1
node-version: 16
- name: install semantic release
run: npm i -g semantic-release@17.x
- name: check out code
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
11 changes: 5 additions & 6 deletions .github/workflows/testcov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ jobs:
runs-on: ubuntu-20.04
services:
arangodb:
image: arangodb:3.6.3
image: arangodb:3.6.8
env:
ARANGO_ROOT_PASSWORD: rootpass
ports:
- 8529/tcp
steps:
- name: set up golang
uses: actions/setup-go@v2
uses: actions/setup-go@v3
with:
go-version: 1.16.3
go-version: 1.18
- name: check out code
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: unit test
run: go test -covermode=atomic -coverprofile=profile.cov -cpu 4 -v ./...
env:
Expand All @@ -29,7 +29,6 @@ jobs:
ARANGO_HOST: localhost
ARANGO_PORT: ${{ job.services.arangodb.ports[8529] }}
- name: upload coverage to codecov
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v3
with:
file: ./profile.cov
token: ${{ secrets.CODECOV_TOKEN }}
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ linters:
- asciicheck
- bodyclose
- bidichk
- cyclop
# - cyclop
- deadcode
- decorder
- depguard
Expand Down
26 changes: 13 additions & 13 deletions command/flag/flag.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,28 @@ import (
func ArangodbFlags() []cli.Flag {
return []cli.Flag{
cli.StringFlag{
Name: "arangodb-pass, pass",
EnvVar: "ARANGODB_PASS",
Usage: "arangodb database password",
Name: "arangodb-pass, pass",
EnvVar: "ARANGODB_PASS",
Usage: "arangodb database password",
Required: true,
},
cli.StringFlag{
Name: "arangodb-database, db",
EnvVar: "ARANGODB_DATABASE",
Usage: "arangodb database name",
Name: "arangodb-database, db",
EnvVar: "ARANGODB_DATABASE",
Usage: "arangodb database name",
Required: true,
},
cli.StringFlag{
Name: "arangodb-user, user",
EnvVar: "ARANGODB_USER",
Usage: "arangodb database user",
Name: "arangodb-user, user",
EnvVar: "ARANGODB_USER",
Usage: "arangodb database user",
Required: true,
},
cli.StringFlag{
Name: "arangodb-host, host",
Value: "arangodb",
EnvVar: "ARANGODB_SERVICE_HOST",
Usage: "arangodb database host",
Name: "arangodb-host, host",
Value: "arangodb",
EnvVar: "ARANGODB_SERVICE_HOST",
Usage: "arangodb database host",
Required: true,
},
cli.StringFlag{
Expand Down
30 changes: 15 additions & 15 deletions database_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func TestMain(m *testing.M) {

func TestCount(t *testing.T) {
t.Parallel()
conn := setup(adbh, t)
conn := setup(t, adbh)
defer teardown(t, conn)
fc, err := adbh.Count(fmt.Sprintf(genderQNoParam, conn.Name(), "female"))
assert := assert.New(t)
Expand All @@ -58,7 +58,7 @@ func TestCount(t *testing.T) {

func TestCountWithParams(t *testing.T) {
t.Parallel()
conn := setup(adbh, t)
conn := setup(t, adbh)
defer teardown(t, conn)
assert := assert.New(t)
for _, g := range []string{"male", "female"} {
Expand All @@ -73,7 +73,7 @@ func TestCountWithParams(t *testing.T) {

func TestCollection(t *testing.T) {
t.Parallel()
conn := setup(adbh, t)
conn := setup(t, adbh)
defer teardown(t, conn)
_, err := adbh.Collection(randomString(6, 8))
assert := assert.New(t)
Expand All @@ -85,7 +85,7 @@ func TestCollection(t *testing.T) {

func TestCreateCollection(t *testing.T) {
t.Parallel()
conn := setup(adbh, t)
conn := setup(t, adbh)
defer teardown(t, conn)
_, err := adbh.CreateCollection(conn.Name(), nil)
assert := assert.New(t)
Expand All @@ -98,7 +98,7 @@ func TestCreateCollection(t *testing.T) {

func TestFindOrCreateCollection(t *testing.T) {
t.Parallel()
c := setup(adbh, t)
c := setup(t, adbh)
defer teardown(t, c)
ec, err := adbh.FindOrCreateCollection(c.Name(), nil)
assert := assert.New(t)
Expand All @@ -112,7 +112,7 @@ func TestFindOrCreateCollection(t *testing.T) {

func TestEnsureFullTextIndex(t *testing.T) {
t.Parallel()
c := setup(adbh, t)
c := setup(t, adbh)
defer teardown(t, c)
assert := assert.New(t)
name := "group"
Expand All @@ -129,7 +129,7 @@ func TestEnsureFullTextIndex(t *testing.T) {

func TestEnsureGeoIndex(t *testing.T) {
t.Parallel()
c := setup(adbh, t)
c := setup(t, adbh)
defer teardown(t, c)
assert := assert.New(t)
name := "value"
Expand All @@ -146,7 +146,7 @@ func TestEnsureGeoIndex(t *testing.T) {

func TestEnsureHashIndex(t *testing.T) {
t.Parallel()
c := setup(adbh, t)
c := setup(t, adbh)
defer teardown(t, c)
assert := assert.New(t)
name := "entry_id"
Expand All @@ -163,7 +163,7 @@ func TestEnsureHashIndex(t *testing.T) {

func TestEnsurePersistentIndex(t *testing.T) {
t.Parallel()
c := setup(adbh, t)
c := setup(t, adbh)
defer teardown(t, c)
assert := assert.New(t)
name := "entry_id"
Expand All @@ -180,7 +180,7 @@ func TestEnsurePersistentIndex(t *testing.T) {

func TestEnsureSkipListIndex(t *testing.T) {
t.Parallel()
c := setup(adbh, t)
c := setup(t, adbh)
defer teardown(t, c)
assert := assert.New(t)
name := "created_at"
Expand All @@ -197,7 +197,7 @@ func TestEnsureSkipListIndex(t *testing.T) {

func TestSearchRowsWithParams(t *testing.T) {
t.Parallel()
conn := setup(adbh, t)
conn := setup(t, adbh)
defer teardown(t, conn)
frs, err := adbh.SearchRows(
genderQ,
Expand All @@ -219,7 +219,7 @@ func TestSearchRowsWithParams(t *testing.T) {

func TestSearchRows(t *testing.T) {
t.Parallel()
c := setup(adbh, t)
c := setup(t, adbh)
defer teardown(t, c)
frs, err := adbh.Search(fmt.Sprintf(genderQNoParam, c.Name(), "female"))
testSearchRs(t, frs, err)
Expand All @@ -229,7 +229,7 @@ func TestSearchRows(t *testing.T) {

func TestDo(t *testing.T) {
t.Parallel()
c := setup(adbh, t)
c := setup(t, adbh)
defer teardown(t, c)
err := adbh.Do(
fmt.Sprintf(userIns, c.Name()),
Expand All @@ -249,7 +249,7 @@ func TestDo(t *testing.T) {

func TestGetRow(t *testing.T) {
t.Parallel()
conn := setup(adbh, t)
conn := setup(t, adbh)
defer teardown(t, conn)
row, err := adbh.GetRow(
userQ,
Expand Down Expand Up @@ -282,7 +282,7 @@ func TestGetRow(t *testing.T) {

func TestTruncate(t *testing.T) {
t.Parallel()
conn := setup(adbh, t)
conn := setup(t, adbh)
defer teardown(t, conn)
assert := assert.New(t)
for _, g := range []string{"male", "female"} {
Expand Down
15 changes: 7 additions & 8 deletions query/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ func GenQualifiedAQLFilterStatement(fmap map[string]string, filters []*Filter) (
for _, flt := range filters {
// check if operator is used for array item
if _, ok := amap[flt.Operator]; ok {
str := randString(10)
str := randString(strSeedLen)
if amap[flt.Operator] == "=~" {
stmts["let"] = append(stmts["let"],
fmt.Sprintf(`
Expand Down Expand Up @@ -240,18 +240,17 @@ func GenQualifiedAQLFilterStatement(fmap map[string]string, filters []*Filter) (

// GenAQLFilterStatement generates an AQL(arangodb query language) compatible
// filter query statement.
func GenAQLFilterStatement(p *StatementParameters) (string, error) {
fmap := p.Fmap
filters := p.Filters
inner := p.Doc
vert := p.Vert
func GenAQLFilterStatement(prms *StatementParameters) (string, error) {
fmap := prms.Fmap
filters := prms.Filters
inner := prms.Doc
lmap := map[string]string{",": "OR", ";": "AND"}
omap := getOperatorMap()
dmap := getDateOperatorMap()
amap := getArrayOperatorMap()
stmts := arraylist.New()
if len(vert) > 0 {
inner = vert
if len(prms.Vert) > 0 {
inner = prms.Vert
}
for _, flt := range filters {
// check if operator is used for array item
Expand Down
Loading

0 comments on commit 15e0a27

Please sign in to comment.