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

test(acl): add upgrade tests for ee/acl package #8792

Merged
merged 1 commit into from
Jul 11, 2023
Merged

Conversation

shivaji-dgraph
Copy link
Contributor

@shivaji-dgraph shivaji-dgraph commented Apr 10, 2023

This PR also adds HealthForInstance API to dgraphtest package for checking health of Alpha through graphql.

@dgraph-bot dgraph-bot added area/enterprise Related to proprietary features area/enterprise/acl Related to Access Control Lists area/testing Testing related issues go Pull requests that update Go code labels Apr 10, 2023
ee/acl/integration_test.go Outdated Show resolved Hide resolved
ee/acl/integration_test.go Show resolved Hide resolved
ee/acl/upgrade_test.go Outdated Show resolved Hide resolved
ee/acl/acl_integration_test.go Outdated Show resolved Hide resolved
ee/acl/acl_test.go Outdated Show resolved Hide resolved
@shivaji-dgraph shivaji-dgraph force-pushed the shiva/upgrade2 branch 2 times, most recently from 79c4b16 to ca0adfd Compare April 12, 2023 13:06
dgraphtest/acl_cluster.go Outdated Show resolved Hide resolved
dgraphtest/acl_cluster.go Outdated Show resolved Hide resolved
dgraphtest/acl_cluster.go Outdated Show resolved Hide resolved
dgraphtest/acl_cluster.go Outdated Show resolved Hide resolved
dgraphtest/acl_cluster.go Outdated Show resolved Hide resolved
dgraphtest/cluster.go Outdated Show resolved Hide resolved
dgraphtest/dgraph.go Outdated Show resolved Hide resolved
ee/acl/integration_test.go Outdated Show resolved Hide resolved
ee/acl/upgrade_test.go Outdated Show resolved Hide resolved
ee/acl/acl_curl_test.go Outdated Show resolved Hide resolved
dgraphtest/acl.go Outdated Show resolved Hide resolved
dgraphtest/acl.go Outdated Show resolved Hide resolved
dgraphtest/acl.go Outdated Show resolved Hide resolved
dgraphtest/acl.go Outdated Show resolved Hide resolved
dgraphtest/acl.go Outdated Show resolved Hide resolved
dgraphtest/cluster.go Outdated Show resolved Hide resolved
ee/acl/acl_curl_test.go Outdated Show resolved Hide resolved
ee/acl/acl_integration_test.go Outdated Show resolved Hide resolved
ee/acl/acl_integration_test.go Outdated Show resolved Hide resolved
ee/acl/acl_test.go Outdated Show resolved Hide resolved
dgraphtest/acl.go Outdated Show resolved Hide resolved
dgraphtest/acl.go Outdated Show resolved Hide resolved
dgraphtest/cluster.go Outdated Show resolved Hide resolved
dgraphtest/compose_cluster.go Outdated Show resolved Hide resolved
ee/acl/acl_curl_test.go Outdated Show resolved Hide resolved
ee/acl/acl_integration_test.go Outdated Show resolved Hide resolved
@shivaji-dgraph shivaji-dgraph force-pushed the shiva/upgrade2 branch 2 times, most recently from fbc1fe0 to db8f57e Compare April 27, 2023 12:28
dgraphtest/acl.go Outdated Show resolved Hide resolved
dgraphtest/acl.go Outdated Show resolved Hide resolved
dgraphtest/acl.go Outdated Show resolved Hide resolved
dgraphtest/cluster.go Outdated Show resolved Hide resolved
dgraphtest/cluster.go Outdated Show resolved Hide resolved
ee/acl/acl_integration_test.go Show resolved Hide resolved
ee/acl/acl_integration_test.go Show resolved Hide resolved
dgraphtest/dgraph.go Outdated Show resolved Hide resolved
@mangalaman93 mangalaman93 changed the title Add upgrade tests for ACL Update integration tests to run as upgrade tests for acl package #8792 May 23, 2023
@mangalaman93 mangalaman93 force-pushed the shiva/upgrade2 branch 6 times, most recently from cabbd02 to d231b7d Compare June 10, 2023 05:14
mangalaman93
mangalaman93 previously approved these changes Jun 10, 2023
mangalaman93
mangalaman93 previously approved these changes Jun 12, 2023
harshil-goel
harshil-goel previously approved these changes Jun 12, 2023
@mangalaman93 mangalaman93 dismissed stale reviews from harshil-goel and themself via 45b1f82 June 20, 2023 22:58
@mangalaman93 mangalaman93 changed the title Update integration tests to run as upgrade tests for ee/acl package test(acl): add upgrade tests for ee/acl package Jun 21, 2023
mangalaman93
mangalaman93 previously approved these changes Jun 29, 2023
}
return gqlResp.Data, nil
}

func (hc *HTTPClient) HealthForInstance() ([]byte, error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add this api change to description

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -57,7 +57,7 @@ const (

localVersion = "local"
waitDurBeforeRetry = time.Second
requestTimeout = 90 * time.Second
requestTimeout = 120 * time.Second
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shivaji-dgraph noticed that this is more stable.

@@ -56,4 +56,10 @@ func init() {
binDir = filepath.Join(basePath, "binaries")
encKeyPath = filepath.Join(basePath, "data", "enc-key")
aclSecretPath = filepath.Join(basePath, "data", "hmac-secret")

log.Printf("[INFO] baseRepoDir: %v", baseRepoDir)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add a comment to as to why?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are just debugging statements which could be useful when tests fail. Do you have a suggestion as to what I could write here?


uids := []int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20}
c.AssignUids(gc.Dgraph, uint64(len(uids)))
require.NoError(t, gc.SetupSchema(`money: [int] @index(int) @count .`))

for i := 1; i <= len(uids); i++ {
for j := 1; j <= i; j++ {
rdfs := fmt.Sprintf(`<%v> <money> "%v" .`, j, i)
_, err := gc.Mutate(rdfs)
mu := &api.Mutation{SetNquads: []byte(fmt.Sprintf(`<%v> <money> "%v" .`, j, i)), CommitNow: true}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Through this API, we can do both deletion and set in a mutation.

@mangalaman93 mangalaman93 merged commit ed7af9c into main Jul 11, 2023
9 of 10 checks passed
@mangalaman93 mangalaman93 deleted the shiva/upgrade2 branch July 11, 2023 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/enterprise/acl Related to Access Control Lists area/enterprise Related to proprietary features area/testing Testing related issues go Pull requests that update Go code
Development

Successfully merging this pull request may close these issues.

4 participants