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(upgrade): add upgrade tests for 21million dataset #8927

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

jbhamra1
Copy link
Contributor

@jbhamra1 jbhamra1 commented Aug 2, 2023

@dgraph-bot dgraph-bot added area/testing Testing related issues go Pull requests that update Go code labels Aug 2, 2023
@jbhamra1 jbhamra1 force-pushed the jassi/systest_21million branch 2 times, most recently from 098f872 to 352f44b Compare August 4, 2023 18:00
@mangalaman93 mangalaman93 changed the title Changes for Upgrade tests for systest/21million test(upgrade): add upgrade tests for 21million dataset Aug 7, 2023
@jbhamra1 jbhamra1 force-pushed the jassi/systest_21million branch 3 times, most recently from 8acbe18 to 8c90797 Compare August 14, 2023 08:11
dgraphtest/config.go Outdated Show resolved Hide resolved
dgraphtest/local_cluster.go Outdated Show resolved Hide resolved
dgraphtest/local_cluster.go Outdated Show resolved Hide resolved
@CLAassistant
Copy link

CLAassistant commented Aug 17, 2023

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@mangalaman93 mangalaman93 left a comment

Choose a reason for hiding this comment

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

Also, you probably want to remove downloading 21million dataset in the t.go

dgraphtest/local_cluster.go Outdated Show resolved Hide resolved
dgraphtest/local_cluster.go Outdated Show resolved Hide resolved
dgraphtest/local_cluster.go Show resolved Hide resolved
dgraphtest/secrets/secret-key Outdated Show resolved Hide resolved
ee/acl/acl_test.go Outdated Show resolved Hide resolved
systest/21million/bulk/upgrade_test.go Outdated Show resolved Hide resolved
systest/21million/live/integration_test.go Outdated Show resolved Hide resolved
systest/21million/live/run_test.go Show resolved Hide resolved
systest/bgindex/count_test.go Outdated Show resolved Hide resolved
func cleanupAndExit(exitCode int) {
_ = os.RemoveAll("./t")
os.Exit(exitCode)
func downloadDataFiles(testDir string) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

this is also defined twice

@jbhamra1 jbhamra1 force-pushed the jassi/systest_21million branch 5 times, most recently from 4a718be to 031aa56 Compare August 23, 2023 13:44
@jbhamra1 jbhamra1 force-pushed the jassi/systest_21million branch 2 times, most recently from d0f19b8 to 2d7c5fb Compare August 25, 2023 06:16
Copy link
Contributor

@mangalaman93 mangalaman93 left a comment

Choose a reason for hiding this comment

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

Just a few minor comments. Looks pretty good otherwise.

dc dgraphtest.Cluster
lc *dgraphtest.LocalCluster
uc dgraphtest.UpgradeCombo
bulkDataDir string
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: you could leave an empty line before this so that the spacing looks better.

filename := filepath.Join(queryDir, file.Name())
reader, cleanup := chunker.FileReader(filename, nil)
bytes, err := io.ReadAll(reader)
if err != nil {
t.Fatalf("Error reading file: %s", err.Error())
panic("error reading file")
Copy link
Contributor

Choose a reason for hiding this comment

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

why are we not returning an error here?

@@ -84,20 +89,27 @@ func TestQueriesFor21Million(t *testing.T) {
}

if ctx.Err() == context.DeadlineExceeded {
t.Fatal("aborting test due to query timeout")
panic("aborting test due to query timeout")
Copy link
Contributor

Choose a reason for hiding this comment

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

same

testutil.CompareJSON(t, bodies[1], string(resp.GetJson()))
log.Printf("running %s", file.Name())
if err = dgraphtest.CompareJSON(bodies[1], string(resp.GetJson())); err != nil {
log.Println(err.Error())
Copy link
Contributor

Choose a reason for hiding this comment

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

we should return an error here too


func QueriesFor21Million(dc dgraphtest.Cluster) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

QueriesFor21Million -> RunTestQueriesFor21Million
and I think we should pass t object to this function so that we could do t.Run inside.

dc dgraphtest.Cluster
lc *dgraphtest.LocalCluster
uc dgraphtest.UpgradeCombo
liveDataDir string
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: same here, can leave a newline before this

if gr, err := gzip.NewReader(r); err != nil &&
strings.Contains(err.Error(), "gzip: invalid header") {
if len(sf) > 0 {
if rr, err = os.Open(sf); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we need to do this. And we do decide to keep it, we should close the file in defer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/testing Testing related issues go Pull requests that update Go code
Development

Successfully merging this pull request may close these issues.

None yet

4 participants