3030 available through your OS package manager)
3131- Install [ Docker] ( https://docs.docker.com/install/ ) and
3232 [ Docker Compose] ( https://docs.docker.com/compose/install/ ) .
33- - [ Install Go 1.13 or above] ( https://golang.org/doc/install ) .
33+ - [ Install Go 1.22.7 or above] ( https://golang.org/doc/install ) .
3434
3535### Setup Dgraph from source repo
3636
@@ -94,23 +94,29 @@ You can build Dgraph using `make dgraph` or `make install` which add the version
9494binary.
9595
9696- ` make dgraph ` : Creates a ` dgraph ` binary at ` ./dgraph/dgraph `
97- - ` make install ` : Creates a ` dgraph ` binary at ` $GOPATH/bin/dgraph ` . You can add ` $GOPATH/bin ` to
98- your ` $PATH ` .
97+ - ` make install ` : Creates a ` dgraph ` binary at ` $GOPATH/bin/dgraph ` . You should add ` $GOPATH/bin ` to
98+ your ` $PATH ` if it isn't there already .
9999
100- ``` text
100+ ``` sh
101101$ make install
102- $ dgraph version
103- [Decoder]: Using assembly version of decoder
104-
105- Dgraph version : v1.1.1
106- Dgraph SHA-256 : 97326c9328aff93851290b12d846da81a7da5b843e97d7c63f5d79091b9063c1
107- Commit SHA-1 : 8994a57
108- Commit timestamp : 2019-12-16 18:24:50 -0800
109- Branch : HEAD
110- Go version : go1.13.5
102+ Installing Dgraph...
103+ Commit SHA256: 15839b156e9920ca2c4ab718e1e73b6637b8ecec
104+ Old SHA256: 596e362ede7466a2569d19ded91241e457e665ada785d05a902af2c6f2cea508
105+ Installed dgraph to /Users/< homedir> /go/bin/dgraph
111106
112- For Dgraph official documentation, visit https://dgraph.io/docs/.
107+ $ dgraph version
108+ Dgraph version : v24.0.2-103-g15839b156
109+ Dgraph codename : dgraph
110+ Dgraph SHA-256 : 9ce738cd055dfebdef5d68b2a49ea4e062e597799498607dbd1bb618d48861a6
111+ Commit SHA-1 : 15839b156
112+ Commit timestamp : 2025-01-10 17:56:49 -0500
113+ Branch : username/some-branch-that-im-on
114+ Go version : go1.22.7
115+ jemalloc enabled : true
116+
117+ For Dgraph official documentation, visit https://dgraph.io/docs.
113118For discussions about Dgraph , visit https://discuss.dgraph.io.
119+ For fully-managed Dgraph Cloud , visit https://dgraph.io/cloud.
114120
115121Licensed variously under the Apache Public License 2.0 and Dgraph Community License.
116122Copyright 2015-2025 Hypermode Inc.
@@ -119,73 +125,32 @@ Copyright 2015-2025 Hypermode Inc.
119125### Build Docker Image
120126
121127``` sh
122- make image
128+ make image-local
123129```
124130
125- To build a test Docker image from source, use ` make image ` . This builds a Dgraph binary using
126- ` make dgraph ` and creates a Docker image named ` dgraph/dgraph ` tagged as the current branch name.
127- The image only contains the ` dgraph ` binary.
128-
129- Example:
130-
131- ``` bash
132- $ git rev-parse --abbrev-ref HEAD # current branch
133- main
134- $ make image
135- Successfully built c74d564d911f
136- Successfully tagged dgraph/dgraph:main
137- $ $ docker run --rm -it dgraph/dgraph:main dgraph version
138- [Decoder]: Using assembly version of decoder
139-
140- Dgraph version : v1.1.1-1-g5fa139a0e
141- Dgraph SHA-256 : 31f8c9324eb90a6f4659066937fcebc67bbca251c20b9da0461c2fd148187689
142- Commit SHA-1 : 5fa139a0e
143- Commit timestamp : 2019-12-16 20:52:06 -0800
144- Branch : main
145- Go version : go1.13.5
146-
147- For Dgraph official documentation, visit https://dgraph.io/docs/.
148- For discussions about Dgraph , visit https://discuss.dgraph.io.
149-
150- Licensed variously under the Apache Public License 2.0 and Dgraph Community License.
151- Copyright 2015-2025 Hypermode Inc.
152- ```
131+ To build a test Docker image from source, use ` make image-local ` . This builds a linux-compatible
132+ Dgraph binary using ` make dgraph ` and creates a Docker image tagged ` dgraph/dgraph:local ` . You can
133+ then use this local image to test Dgraph in your local Docker setup.
153134
154135### Testing
155136
156- #### Dgraph
157-
158- 1 . Change directory to t directory.
159- 2 . If all packages need to be tested, run make test If only a specific package needs to be tested,
160- run make test args="--pkg=desired_package_name"
161-
162- example 1: make test args="--pkg=tok" example 2: make test args="--pkg=tlstest/acl"
163-
164- The first example will run all the tests in the 'tok' directory (if there are any) The second one
165- will run all the test in the acl subfolder of the tlstest directory. Note: running make test
166- args="--pkg=tlstest" will return an error saying no packages found because all the tests in the
167- tlstest package are in subdirectories of the package. So the subdirectories must be specified as
168- shown in example 2.
137+ Dgraph employs a ~~ complex~~ sophisticated testing framework that includes extensive test coverage.
138+ Due to the comprehensive nature of these tests, a complete test run can take several hours,
139+ depending on your hardware. To manage this complex testing process efficiently, we've developed a
140+ custom test framework implemented in Go, which resides in the [ ./t] ( /t ) directory. This specialized
141+ framework provides enhanced control and flexibility beyond what's available through standard Go
142+ testing framework.
169143
170- Tests should be written in Go and use the Dgraph cluster set up in ` dgraph/docker-compose.yml `
171- whenever possible. If the functionality being tested requires a different cluster setup (e.g.
172- different commandline options), the ` *_test.go ` files should be put in a separate directory that
173- also contains a ` docker-compose.yml ` to set up the cluster as needed.
144+ For dependencies, runner flags and instructions for running tests on non-Linux machines, see the
145+ [ README] ( t/README.md ) in the [ _ t_ ] ( t ) folder.
174146
175- ** IMPORTANT:** All containers should be labeled with ` cluster: test ` so they may be correctly
176- restarted and cleaned up by the test script.
147+ Other integration tests do not use the testing framework located in the ` t ` folder. Consult the
148+ [ github actions definitions] ( .github ) folder to discover the tests we run as part of our continuous
149+ delivery process.
177150
178- #### Badger
179-
180- Run ` go test ` in the root folder.
181-
182- ``` bash
183- $ go test ./...
184- ok github.com/dgraph-io/badger 24.853s
185- ok github.com/dgraph-io/badger/skl 0.027s
186- ok github.com/dgraph-io/badger/table 0.478s
187- ok github.com/dgraph-io/badger/y 0.004s
188- ```
151+ Non-integration unit tests exist for many core packages that can be exercised without invoking the
152+ testing framework. For instance, to unit test the core DQL parsing package:
153+ ` go test github.com/hypermodeinc/dgraph/v24/dql ` .
189154
190155## Contributing
191156
0 commit comments