Skip to content

Commit 6207892

Browse files
ci: divide CI workflows (#9243)
This PR divides ci-dgraph-tests and ci-dgraph-upgrade-tests workflows into three smaller workflows: core, systest, and vector tests. - Vector tests include only test packages related to vectors. - Systest includes system test packages such as backup, restore, export, import, etc. - All remaining packages fall under the core suite.
1 parent d59c337 commit 6207892

File tree

6 files changed

+215
-11
lines changed

6 files changed

+215
-11
lines changed

.github/workflows/ci-dgraph-tests.yml renamed to .github/workflows/ci-dgraph-core-tests.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: ci-dgraph-tests
1+
name: ci-dgraph-core-tests
22
on:
33
pull_request:
44
paths:
@@ -13,7 +13,7 @@ on:
1313
- main
1414
- 'release/**'
1515
jobs:
16-
dgraph-tests:
16+
dgraph-core-tests:
1717
if: github.event.pull_request.draft == false
1818
runs-on: warp-ubuntu-latest-x64-4x
1919
steps:
@@ -44,15 +44,15 @@ jobs:
4444
go clean -testcache
4545
# clean up docker containers before test execution
4646
cd t; ./t -r
47-
- name: Run Unit Tests
47+
- name: Run Core Tests
4848
run: |
4949
#!/bin/bash
5050
# go env settings
5151
export GOPATH=~/go
5252
# move the binary
5353
cp dgraph/dgraph ~/go/bin/dgraph
54-
# run the unit and integration tests
55-
cd t; ./t
54+
# run the unit and core tests
55+
cd t; ./t --suite=core
5656
# clean up docker containers after test execution
5757
./t -r
5858
# sleep

.github/workflows/ci-dgraph-upgrade-tests.yml renamed to .github/workflows/ci-dgraph-core-upgrade-tests.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: ci-dgraph-upgrade-tests
1+
name: ci-dgraph-core-upgrade-tests
22
on:
33
pull_request:
44
paths:
@@ -31,16 +31,20 @@ jobs:
3131
#!/bin/bash
3232
# clean cache
3333
go clean -testcache
34-
- name: Run Upgrade Tests
34+
- name: Run Core Upgrade Tests
3535
run: |
3636
#!/bin/bash
3737
# go env settings
3838
export GOPATH=~/go
3939
export DGRAPH_UPGRADE_MAIN_ONLY=true
4040
# move the binary
4141
cp dgraph/dgraph ~/go/bin/dgraph
42-
# run the tests
43-
go test -v -timeout=120m -failfast -tags=upgrade ./...
42+
# run the core upgrade tests
43+
go test -tags=upgrade \
44+
github.com/dgraph-io/dgraph/v24/ee/acl \
45+
github.com/dgraph-io/dgraph/v24/worker \
46+
github.com/dgraph-io/dgraph/v24/query \
47+
-v -timeout=120m -failfast
4448
# clean up docker containers after test execution
4549
go clean -testcache
4650
# sleep
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: ci-dgraph-system-upgrade-tests
2+
on:
3+
pull_request:
4+
paths:
5+
- '**/*.go'
6+
- '**/go.mod'
7+
types:
8+
- opened
9+
- reopened
10+
- synchronize
11+
- ready_for_review
12+
branches:
13+
- main
14+
- 'release/**'
15+
jobs:
16+
dgraph-upgrade-tests:
17+
if: github.event.pull_request.draft == false
18+
runs-on: warp-ubuntu-latest-x64-4x
19+
steps:
20+
- uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0
23+
- name: Set up Go
24+
uses: actions/setup-go@v5
25+
with:
26+
go-version-file: go.mod
27+
- name: Make Linux Build and Docker Image
28+
run: make docker-image
29+
- name: Clean Up Environment
30+
run: |
31+
#!/bin/bash
32+
# clean cache
33+
go clean -testcache
34+
- name: Run System Upgrade Tests
35+
run: |
36+
#!/bin/bash
37+
# go env settings
38+
export GOPATH=~/go
39+
export DGRAPH_UPGRADE_MAIN_ONLY=true
40+
# move the binary
41+
cp dgraph/dgraph ~/go/bin/dgraph
42+
# run the sytem upgrade tests
43+
go test -tags=upgrade github.com/dgraph-io/dgraph/v24/systest/mutations-and-queries \
44+
github.com/dgraph-io/dgraph/v24/systest/plugin \
45+
github.com/dgraph-io/dgraph/v24/systest/license \
46+
github.com/dgraph-io/dgraph/v24/systest/multi-tenancy \
47+
-v -timeout=120m -failfast
48+
# clean up docker containers after test execution
49+
go clean -testcache
50+
# sleep
51+
sleep 5
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: ci-dgraph-system-tests
2+
on:
3+
pull_request:
4+
paths:
5+
- '**/*.go'
6+
- '**/go.mod'
7+
types:
8+
- opened
9+
- reopened
10+
- synchronize
11+
- ready_for_review
12+
branches:
13+
- main
14+
- 'release/**'
15+
jobs:
16+
dgraph-systest-tests:
17+
if: github.event.pull_request.draft == false
18+
runs-on: warp-ubuntu-latest-x64-4x
19+
steps:
20+
- uses: actions/checkout@v4
21+
- name: Set up Go
22+
uses: actions/setup-go@v5
23+
with:
24+
go-version-file: go.mod
25+
- name: Install protobuf-compiler
26+
run: sudo apt update && sudo apt install -y protobuf-compiler
27+
- name: Check protobuf
28+
run: |
29+
cd ./protos
30+
go mod tidy
31+
make regenerate
32+
git diff --exit-code -- .
33+
- name: Make Linux Build and Docker Image
34+
run: make docker-image
35+
- name: Build Test Binary
36+
run: |
37+
#!/bin/bash
38+
# build the test binary
39+
cd t; go build .
40+
- name: Clean Up Environment
41+
run: |
42+
#!/bin/bash
43+
# clean cache
44+
go clean -testcache
45+
# clean up docker containers before test execution
46+
cd t; ./t -r
47+
- name: Run Systests
48+
run: |
49+
#!/bin/bash
50+
# go env settings
51+
export GOPATH=~/go
52+
# move the binary
53+
cp dgraph/dgraph ~/go/bin/dgraph
54+
# run the unit and systests
55+
cd t; ./t --suite=systest
56+
# clean up docker containers after test execution
57+
./t -r
58+
# sleep
59+
sleep 5
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: ci-dgraph-vector-tests
2+
on:
3+
pull_request:
4+
paths:
5+
- '**/*.go'
6+
- '**/go.mod'
7+
types:
8+
- opened
9+
- reopened
10+
- synchronize
11+
- ready_for_review
12+
branches:
13+
- main
14+
- 'release/**'
15+
jobs:
16+
dgraph-vector-tests:
17+
if: github.event.pull_request.draft == false
18+
runs-on: warp-ubuntu-latest-x64-4x
19+
steps:
20+
- uses: actions/checkout@v4
21+
- name: Set up Go
22+
uses: actions/setup-go@v5
23+
with:
24+
go-version-file: go.mod
25+
- name: Install protobuf-compiler
26+
run: sudo apt update && sudo apt install -y protobuf-compiler
27+
- name: Check protobuf
28+
run: |
29+
cd ./protos
30+
go mod tidy
31+
make regenerate
32+
git diff --exit-code -- .
33+
- name: Make Linux Build and Docker Image
34+
run: make docker-image
35+
- name: Build Test Binary
36+
run: |
37+
#!/bin/bash
38+
# build the test binary
39+
cd t; go build .
40+
- name: Clean Up Environment
41+
run: |
42+
#!/bin/bash
43+
# clean cache
44+
go clean -testcache
45+
# clean up docker containers before test execution
46+
cd t; ./t -r
47+
- name: Run Vector Tests
48+
run: |
49+
#!/bin/bash
50+
# go env settings
51+
export GOPATH=~/go
52+
# move the binary
53+
cp dgraph/dgraph ~/go/bin/dgraph
54+
# run the unit and vector tests
55+
cd t; ./t --suite=vector
56+
# clean up docker containers after test execution
57+
./t -r
58+
# sleep
59+
sleep 5

t/t.go

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,7 @@ func testSuiteContains(suite string) bool {
720720
func isValidPackageForSuite(pkg string) bool {
721721
valid := false
722722
if testSuiteContains("all") {
723-
valid = true
723+
return true
724724
}
725725
if testSuiteContains("ldbc") {
726726
valid = valid || isLDBCPackage(pkg)
@@ -731,6 +731,15 @@ func isValidPackageForSuite(pkg string) bool {
731731
if testSuiteContains("unit") {
732732
valid = valid || (!isLoadPackage(pkg) && !isLDBCPackage(pkg))
733733
}
734+
if testSuiteContains("vector") {
735+
valid = valid || isVectorPackage(pkg)
736+
}
737+
if testSuiteContains("systest") {
738+
valid = valid || isSystestPackage(pkg)
739+
}
740+
if testSuiteContains("core") {
741+
valid = valid || isCorePackage(pkg)
742+
}
734743
if valid {
735744
return valid
736745
}
@@ -750,6 +759,28 @@ func isLDBCPackage(pkg string) bool {
750759
return strings.HasSuffix(pkg, "/systest/ldbc")
751760
}
752761

762+
func isSystestPackage(pkg string) bool {
763+
if !strings.Contains(pkg, "/systest") {
764+
return false
765+
}
766+
return !isExcludedFromSystest(pkg)
767+
}
768+
769+
func isExcludedFromSystest(pkg string) bool {
770+
return isLDBCPackage(pkg) || isLoadPackage(pkg) || isVectorPackage(pkg)
771+
}
772+
773+
func isCorePackage(pkg string) bool {
774+
if isSystestPackage(pkg) || isLDBCPackage(pkg) || isVectorPackage(pkg) || isLoadPackage(pkg) {
775+
return false
776+
}
777+
return true
778+
}
779+
780+
func isVectorPackage(pkg string) bool {
781+
return strings.HasSuffix(pkg, "/vector")
782+
}
783+
753784
var datafiles = map[string]string{
754785
"1million-noindex.schema": "https://github.com/dgraph-io/benchmarks/blob/master/data/1million-noindex.schema?raw=true",
755786
"1million.schema": "https://github.com/dgraph-io/benchmarks/blob/master/data/1million.schema?raw=true",
@@ -1041,7 +1072,7 @@ func run() error {
10411072

10421073
func validateAllowed(testSuite []string) {
10431074

1044-
allowed := []string{"all", "ldbc", "load", "unit"}
1075+
allowed := []string{"all", "ldbc", "load", "unit", "systest", "vector", "core"}
10451076
for _, str := range testSuite {
10461077
onlyAllowed := false
10471078
for _, allowedStr := range allowed {

0 commit comments

Comments
 (0)