Skip to content

Commit

Permalink
Review comments 1 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jbhamra1 committed Jul 7, 2023
1 parent 575f7bf commit adb5749
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 17 deletions.
5 changes: 2 additions & 3 deletions systest/plugin/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/suite"

"github.com/dgraph-io/dgo/v230/protos/api"
"github.com/dgraph-io/dgraph/dgraphtest"
"github.com/dgraph-io/dgraph/x"
)
Expand All @@ -43,11 +42,11 @@ func (psuite *PluginTestSuite) SetupTest() {
func (psuite *PluginTestSuite) TearDownTest() {
t := psuite.T()
gcli, cleanup, err := psuite.dc.Client()
defer cleanup()
require.NoError(t, err)
defer cleanup()
require.NoError(t, gcli.LoginIntoNamespace(context.Background(),
dgraphtest.DefaultUser, dgraphtest.DefaultPassword, x.GalaxyNamespace))
require.NoError(t, gcli.Alter(context.Background(), &api.Operation{DropAll: true}))
require.NoError(t, gcli.DropAll())
}

func (psuite *PluginTestSuite) Upgrade() {
Expand Down
11 changes: 5 additions & 6 deletions systest/plugin/plugin_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//go:build (!oss && integration) || upgrade
//go:build integration || upgrade

/*
* Copyright 2017-2023 Dgraph Labs, Inc. and Contributors
Expand Down Expand Up @@ -30,11 +30,12 @@ import (
"github.com/dgraph-io/dgraph/x"
)


/*
type testCase struct {
query string
wantResult string
}
*/

type PluginFuncInp struct {
initialSchema string
Expand Down Expand Up @@ -322,13 +323,11 @@ func (psuite *PluginTestSuite) TestPlugins() {
defer cancel()

gcli, cleanup, err := psuite.dc.Client()
defer cleanup()
require.NoError(t, err)
defer cleanup()
require.NoError(t, gcli.LoginIntoNamespace(context.Background(),
dgraphtest.DefaultUser, dgraphtest.DefaultPassword, x.GalaxyNamespace))
require.NoError(t, gcli.Alter(ctx, &api.Operation{
DropAll: true,
}))
require.NoError(t, gcli.DropAll())
require.NoError(t, gcli.Alter(ctx, &api.Operation{
Schema: initialSchema,
}))
Expand Down
9 changes: 1 addition & 8 deletions systest/plugin/upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,8 @@ func (psuite *PluginTestSuite) Upgrade() {
}
}

// For testing purpose
var comboEntry = []dgraphtest.UpgradeCombo{
{"v21.03.0", "v23.0.0", dgraphtest.BackupRestore},
}

func TestPluginTestSuite(t *testing.T) {
//for _, uc := range dgraphtest.AllUpgradeCombos {
//}
for _, uc := range comboEntry {
for _, uc := range dgraphtest.AllUpgradeCombos {
log.Printf("running: backup in [%v], restore in [%v]", uc.Before, uc.After)
var psuite PluginTestSuite
psuite.uc = uc
Expand Down

0 comments on commit adb5749

Please sign in to comment.