Skip to content

Commit

Permalink
Add support for external plugins
Browse files Browse the repository at this point in the history
This patch ensures that the test operator takes advantage of the new
parameters of the tempest container:
    - TEMPEST_EXTERNAL_PLUGIN_GIT_URL
    - TEMPEST_EXTERNAL_PLUGIN_CHANGE_URL
    - TEMPEST_EXTERNAL_PLUGIN_REFSPEC

The user can use this parameters by specifying the following values
for the Tempest CR:
    - externalPluginGitURL
    - externalPluginChangeURL
    - externalPluginRefspec
  • Loading branch information
lpiwowar committed Nov 23, 2023
1 parent 4a224bc commit e290de6
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 0 deletions.
21 changes: 21 additions & 0 deletions api/bases/test.openstack.org_tempests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,27 @@ spec:
default: ""
description: ExcludeList
type: string
externalPluginChangeURL:
default: ""
description: ExternalPluginsChangeURLs should be used together
with ExternalPluginsRefspecs. These two variables specify which
changes should be download from gerrit/github for each downloaded
plugin. Both variables are contain comma separated lists.
type: string
externalPluginRefspec:
default: ""
description: ExternalPluginsChangeURLs should be used together
with ExternalPluginsRefspecs. These two variables specify which
changes should be download from gerrit/github for each downloaded
plugin. Both variables are contain comma separated lists.
type: string
externalPluginURL:
default: ""
description: ExternalPluginsURLs is a comma separated list of
URLs that point to git repositories that should be installed
within the tempest container. If this option is specified then
only tests from the external plugins are executed.
type: string
includeList:
default: tempest.api.identity.v3
description: IncludeList
Expand Down
24 changes: 24 additions & 0 deletions api/v1beta1/tempest_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,30 @@ type TempestRunSpec struct {
// +kubebuilder:default:=""
// WorkerFile is the detailed concurrency spec file
WorkerFile string `json:"workerFile,omitempty"`

// +kubebuilder:validation:Optional
// +kubebuilder:default:=""
// ExternalPluginsURLs is a comma separated list of URLs that point
// to git repositories that should be installed within the tempest
// container. If this option is specified then only tests from the
// external plugins are executed.
ExternalPluginGitURL string `json:"externalPluginURL,omitempty"`

// +kubebuilder:validation:Optional
// +kubebuilder:default:=""
// ExternalPluginsChangeURLs should be used together with
// ExternalPluginsRefspecs. These two variables specify which changes
// should be download from gerrit/github for each downloaded plugin.
// Both variables are contain comma separated lists.
ExternalPluginChangeURL string `json:"externalPluginChangeURL,omitempty"`

// +kubebuilder:validation:Optional
// +kubebuilder:default:=""
// ExternalPluginsChangeURLs should be used together with
// ExternalPluginsRefspecs. These two variables specify which changes
// should be download from gerrit/github for each downloaded plugin.
// Both variables are contain comma separated lists.
ExternalPluginRefspec string `json:"externalPluginRefspec,omitempty"`
}

// TempestSpec PythonTempestconf parts
Expand Down
21 changes: 21 additions & 0 deletions config/crd/bases/test.openstack.org_tempests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,27 @@ spec:
default: ""
description: ExcludeList
type: string
externalPluginChangeURL:
default: ""
description: ExternalPluginsChangeURLs should be used together
with ExternalPluginsRefspecs. These two variables specify which
changes should be download from gerrit/github for each downloaded
plugin. Both variables are contain comma separated lists.
type: string
externalPluginRefspec:
default: ""
description: ExternalPluginsChangeURLs should be used together
with ExternalPluginsRefspecs. These two variables specify which
changes should be download from gerrit/github for each downloaded
plugin. Both variables are contain comma separated lists.
type: string
externalPluginURL:
default: ""
description: ExternalPluginsURLs is a comma separated list of
URLs that point to git repositories that should be installed
within the tempest container. If this option is specified then
only tests from the external plugins are executed.
type: string
includeList:
default: tempest.api.identity.v3
description: IncludeList
Expand Down
3 changes: 3 additions & 0 deletions config/samples/test_v1beta1_tempest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ spec:
# smoke: false
# serial: false
# parallel: true
# externalPluginURL: "URL1,URL2,URL3"
# externalPluginChangeURL: "URL1,-,URL3"
# externalPluginRefspec: "refspec1,-,refspec3"
tempestconfRun:
# NOTE: All parameters have default values (use only when you want to override
# the default behaviour)
Expand Down
5 changes: 5 additions & 0 deletions controllers/tempest_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,11 @@ func setTempestConfigVars(envVars map[string]string,

// Int
envVars["TEMPEST_CONCURRENCY"] = getDefaultInt(tempestRun.Concurrency)

// String
envVars["TEMPEST_EXTERNAL_PLUGIN_GIT_URL"] = tempestRun.ExternalPluginGitURL
envVars["TEMPEST_EXTERNAL_PLUGIN_CHANGE_URL"] = tempestRun.ExternalPluginChangeURL
envVars["TEMPEST_EXTERNAL_PLUGIN_REFSPEC"] = tempestRun.ExternalPluginRefspec
}

func setTempestconfConfigVars(envVars map[string]string,
Expand Down
3 changes: 3 additions & 0 deletions docs/source/samples/tempest-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ data:
# TEMPEST_SMOKE: true
# TEMPEST_PARALLEL: true
# TEMPEST_SERIAL: true
# TEMPEST_EXTERNAL_PLUGIN_GIT_URL: "URL1,URL2,URL3"
# TEMPEST_EXTERNAL_PLUGIN_CHANGE_URL: "URL1,URL2,URL3"
# TEMPEST_EXTERNAL_PLUGIN_REFSPEC: "refspec1,refspec2,refspec3"

# TEMPESTCONF env variables:
# --------------------------
Expand Down

0 comments on commit e290de6

Please sign in to comment.