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

feat: e2e custom port #362

Merged
merged 1 commit into from
Oct 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 104 additions & 0 deletions tests/e2e/nebulacluster_custom_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@ const (
LabelCustomConfig = "custom config"
LabelCustomConfigStatic = "static"
LabelCustomConfigDynamic = "dynamic"
LabelCustomConfigPort = "port"
)

var testCasesCustomConfig []ncTestCase

func init() {
testCasesCustomConfig = append(testCasesCustomConfig, testCasesCustomConfigStatic...)
testCasesCustomConfig = append(testCasesCustomConfig, testCasesCustomConfigDynamic...)
testCasesCustomConfig = append(testCasesCustomConfig, testCasesCustomConfigPort...)
}

// test cases about static custom config
Expand Down Expand Up @@ -260,3 +262,105 @@ var testCasesCustomConfigDynamic = []ncTestCase{
},
},
}

// test cases about port custom config
var testCasesCustomConfigPort = []ncTestCase{
{
Name: "custom config thrift port and http port",
Labels: map[string]string{
LabelKeyCategory: LabelCustomConfig,
LabelKeyGroup: LabelCustomConfigPort,
},
InstallNCOptions: []envfuncsext.NebulaClusterOption{
envfuncsext.WithNebulaClusterHelmRawOptions(
helm.WithArgs( // thrift 90x9, http 190x9
"--set-string", "nebula.graphd.config.port=9069",
"--set-string", "nebula.graphd.config.ws_http_port=19069",
"--set-string", "nebula.metad.config.port=9059",
"--set-string", "nebula.metad.config.ws_http_port=19059",
"--set-string", "nebula.storaged.config.port=9079",
"--set-string", "nebula.storaged.config.ws_http_port=19079",
),
),
},
InstallWaitNCOptions: []envfuncsext.NebulaClusterOption{
envfuncsext.WithNebulaClusterReadyFuncs(
envfuncsext.NebulaClusterReadyFuncForFields(false, map[string]any{
"Spec": map[string]any{
"Graphd": map[string]any{
"Replicas": e2ematcher.ValidatorEq(2),
"Config": map[string]any{
"port": e2ematcher.ValidatorEq("9069"),
"ws_http_port": e2ematcher.ValidatorEq("19069"),
},
},
"Metad": map[string]any{
"Replicas": e2ematcher.ValidatorEq(3),
"Config": map[string]any{
"port": e2ematcher.ValidatorEq("9059"),
"ws_http_port": e2ematcher.ValidatorEq("19059"),
},
},
"Storaged": map[string]any{
"Replicas": e2ematcher.ValidatorEq(3),
"Config": map[string]any{
"port": e2ematcher.ValidatorEq("9079"),
"ws_http_port": e2ematcher.ValidatorEq("19079"),
},
},
},
}),
envfuncsext.DefaultNebulaClusterReadyFunc,
),
},
LoadLDBC: true,
UpgradeCases: []ncTestUpgradeCase{
{
Name: "update http ports",
UpgradeFunc: nil,
UpgradeNCOptions: []envfuncsext.NebulaClusterOption{
envfuncsext.WithNebulaClusterHelmRawOptions(
helm.WithArgs( // http 190x9 => 191x9
"--set-string", "nebula.graphd.config.port=9069",
"--set-string", "nebula.graphd.config.ws_http_port=19169",
"--set-string", "nebula.metad.config.port=9059",
"--set-string", "nebula.metad.config.ws_http_port=19159",
"--set-string", "nebula.storaged.config.port=9079",
"--set-string", "nebula.storaged.config.ws_http_port=19179",
),
),
},
UpgradeWaitNCOptions: []envfuncsext.NebulaClusterOption{
envfuncsext.WithNebulaClusterReadyFuncs(
envfuncsext.NebulaClusterReadyFuncForFields(false, map[string]any{
"Spec": map[string]any{
"Graphd": map[string]any{
"Replicas": e2ematcher.ValidatorEq(2),
"Config": map[string]any{
"port": e2ematcher.ValidatorEq("9069"),
"ws_http_port": e2ematcher.ValidatorEq("19169"),
},
},
"Metad": map[string]any{
"Replicas": e2ematcher.ValidatorEq(3),
"Config": map[string]any{
"port": e2ematcher.ValidatorEq("9059"),
"ws_http_port": e2ematcher.ValidatorEq("19159"),
},
},
"Storaged": map[string]any{
"Replicas": e2ematcher.ValidatorEq(3),
"Config": map[string]any{
"port": e2ematcher.ValidatorEq("9079"),
"ws_http_port": e2ematcher.ValidatorEq("19179"),
},
},
},
}),
envfuncsext.DefaultNebulaClusterReadyFunc,
),
},
},
},
},
}