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 e9389d9
Show file tree
Hide file tree
Showing 6 changed files with 81 additions and 0 deletions.
23 changes: 23 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,29 @@ spec:
default: ""
description: ExcludeList
type: string
externalPluginChangeURL:
default: ""
description: ExternalPluginsChangeURL should be used together
with ExternalPluginsRefspec. These two variables specify which
changes should be download from gerrit/github for each downloaded
plugin (see ExternalPluginGitURL). Both variables are comma
separated lists.
type: string
externalPluginRefspec:
default: ""
description: ExternalPluginsChangeURL should be used together
with ExternalPluginsRefspecs. These two variables specify which
changes should be download from gerrit/github for each downloaded
plugin (see ExternalPluginGitURL). Both variables are comma
separated lists.
type: string
externalPluginURL:
default: ""
description: ExternalPluginsURL 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:=""
// ExternalPluginsURL 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:=""
// ExternalPluginsChangeURL should be used together with
// ExternalPluginsRefspec. These two variables specify which changes
// should be download from gerrit/github for each downloaded plugin
// (see ExternalPluginGitURL). Both variables are comma separated lists.
ExternalPluginChangeURL string `json:"externalPluginChangeURL,omitempty"`

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

// TempestSpec PythonTempestconf parts
Expand Down
23 changes: 23 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,29 @@ spec:
default: ""
description: ExcludeList
type: string
externalPluginChangeURL:
default: ""
description: ExternalPluginsChangeURL should be used together
with ExternalPluginsRefspec. These two variables specify which
changes should be download from gerrit/github for each downloaded
plugin (see ExternalPluginGitURL). Both variables are comma
separated lists.
type: string
externalPluginRefspec:
default: ""
description: ExternalPluginsChangeURL should be used together
with ExternalPluginsRefspecs. These two variables specify which
changes should be download from gerrit/github for each downloaded
plugin (see ExternalPluginGitURL). Both variables are comma
separated lists.
type: string
externalPluginURL:
default: ""
description: ExternalPluginsURL 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 e9389d9

Please sign in to comment.