Skip to content

Commit

Permalink
enha: e2e add group (#325)
Browse files Browse the repository at this point in the history
  • Loading branch information
veezhang authored Oct 11, 2023
1 parent e520102 commit 1a0d75b
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 6 deletions.
15 changes: 15 additions & 0 deletions tests/e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,18 @@ export E2E_DOCKER_CONFIG_JSON_SECRET=`cat ~/.docker/config.json| base64 -w 0`
export E2E_OPERATOR_INSTALL=false # if you already install nebula-operator
make e2e E2EARGS="--kubeconfig ~/.kube/config"
```

# run certain specified cases

The test cases can be filtered using `-labels key1=value1,key2=value2` and `-feature regular-expression` flag.

```shell
# use -labels
make e2e E2EARGS="--kubeconfig ~/.kube/config -labels category=basic,group=scale"

# use -feature
make e2e E2EARGS="--kubeconfig ~/.kube/config -feature 'scale.*default'"

# use -labels and -feature
make e2e E2EARGS="--kubeconfig ~/.kube/config -labels category=basic,group=scale -feature 'scale.*default'"
```
2 changes: 1 addition & 1 deletion tests/e2e/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const (
ImagePullSecretName = "image-pull-secret.e2e"

LabelKeyCategory = "category"
LabelKeyCase = "case"
LabelKeyGroup = "group"
)

var (
Expand Down
43 changes: 40 additions & 3 deletions tests/e2e/nebulacluster_basic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,28 @@ import (
"sigs.k8s.io/e2e-framework/third_party/helm"
)

var testCasesBasic = []ncTestCase{
const (
LabelCategoryBasic = "basic"
LabelGroupScale = "scale"
)

var testCasesBasic []ncTestCase

func init() {
testCasesBasic = append(testCasesBasic, testCasesBasicScale...)
testCasesBasic = append(testCasesBasic, testCasesBasicVersion...)
testCasesBasic = append(testCasesBasic, testCasesBasicResources...)
testCasesBasic = append(testCasesBasic, testCasesBasicImage...)
testCasesBasic = append(testCasesBasic, testCasesBasicVolume...)
}

// test cases about scale
var testCasesBasicScale = []ncTestCase{
{
Name: "default 2-3-3",
Name: "scale with default values",
Labels: map[string]string{
LabelKeyCategory: "basic",
LabelKeyCategory: LabelCategoryBasic,
LabelKeyGroup: LabelGroupScale,
},
InstallWaitNCOptions: []envfuncsext.NebulaClusterOption{
envfuncsext.WithNebulaClusterReadyFuncs(
Expand Down Expand Up @@ -133,3 +150,23 @@ var testCasesBasic = []ncTestCase{
},
},
}

// test cases about version of graphd|metad|storaged
var testCasesBasicVersion = []ncTestCase{
// TODO
}

// test cases about resources of graphd|metad|storaged
var testCasesBasicResources = []ncTestCase{
// TODO
}

// test cases about image of graphd|metad|storaged
var testCasesBasicImage = []ncTestCase{
// TODO
}

// test cases about log and data volume of graphd|metad|storaged
var testCasesBasicVolume = []ncTestCase{
// TODO
}
3 changes: 1 addition & 2 deletions tests/e2e/nebulacluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,8 @@ func TestNebulaCluster(t *testing.T) {
namespace := envconf.RandomName(fmt.Sprintf("e2e-nc-%d", caseIdx), 32)
name := envconf.RandomName(fmt.Sprintf("e2e-nc-%d", caseIdx), 32)

feature := features.New(fmt.Sprintf("Create NebulaCluster %s", tc.Name))
feature := features.New(tc.Name)

feature.WithLabel(LabelKeyCase, tc.Name)
for key, value := range tc.Labels {
feature.WithLabel(key, value)
}
Expand Down

0 comments on commit 1a0d75b

Please sign in to comment.