Skip to content
This repository was archived by the owner on Jun 14, 2019. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 3 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
14 changes: 14 additions & 0 deletions CONFIGURATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ tests:
cluster_profile: ''
openshift_ansible_src:
cluster_profile: ''
openshift_ansible_custom:
cluster_profile: ''
openshift_ansible_upgrade:
cluster_profile: ''
previous_version: ''
previous_rpm_deps: ''
openshift_installer:
cluster_profile: ''
```
Expand Down Expand Up @@ -316,6 +322,14 @@ and runs conformance tests.
`openshift_ansible_src` is a test that provisions a cluster using
`openshift-ansible` and executes a command in the `src` image.

## `tests.openshift_ansible_custom`
`openshift_ansible_upgrade` is a test that provisions a cluster using
`openshift-ansible`'s custom provisioner, and runs conformance tests.

## `tests.openshift_ansible_upgrade`
`openshift_ansible_upgrade` is a test that provisions a cluster using
`openshift-ansible`, upgrades it to the next version and runs conformance tests.

## `tests.openshift_installer`
`openshift_installer` is a test that provisions a cluster using
`openshift-installer` and runs conformance tests.
Expand Down
12 changes: 11 additions & 1 deletion pkg/api/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ func validateReleaseTagConfiguration(fieldRoot string, input ReleaseTagConfigura

func validateClusterProfile(fieldRoot string, p ClusterProfile) error {
switch p {
case ClusterProfileAWS, ClusterProfileAWSAtomic, ClusterProfileAWSCentos, ClusterProfileGCP, ClusterProfileGCPHA, ClusterProfileGCPCRIO:
case ClusterProfileAWS, ClusterProfileAWSAtomic, ClusterProfileAWSCentos, ClusterProfileAWSGluster, ClusterProfileGCP, ClusterProfileGCPHA, ClusterProfileGCPCRIO, ClusterProfileGCPLogging:
return nil
}
return fmt.Errorf("%q: invalid cluster profile %q", fieldRoot, p)
Expand Down Expand Up @@ -198,6 +198,16 @@ func validateTestConfigurationType(fieldRoot string, test TestStepConfiguration,
needsReleaseRpms = true
validationErrors = append(validationErrors, validateClusterProfile(fmt.Sprintf("%s", fieldRoot), testConfig.ClusterProfile))
}
if testConfig := test.OpenshiftAnsibleCustomClusterTestConfiguration; testConfig != nil {
typeCount++
needsReleaseRpms = true
validationErrors = append(validationErrors, validateClusterProfile(fmt.Sprintf("%s", fieldRoot), testConfig.ClusterProfile))
}
if testConfig := test.OpenshiftAnsibleUpgradeClusterTestConfiguration; testConfig != nil {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do similar for custom?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

typeCount++
needsReleaseRpms = true
validationErrors = append(validationErrors, validateClusterProfile(fmt.Sprintf("%s", fieldRoot), testConfig.ClusterProfile))
}
if testConfig := test.OpenshiftInstallerClusterTestConfiguration; testConfig != nil {
typeCount++
validationErrors = append(validationErrors, validateClusterProfile(fmt.Sprintf("%s", fieldRoot), testConfig.ClusterProfile))
Expand Down
46 changes: 36 additions & 10 deletions pkg/api/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,10 +287,12 @@ type TestStepConfiguration struct {
ArtifactDir string `json:"artifact_dir"`

// Only one of the following can be not-null.
ContainerTestConfiguration *ContainerTestConfiguration `json:"container,omitempty"`
OpenshiftAnsibleClusterTestConfiguration *OpenshiftAnsibleClusterTestConfiguration `json:"openshift_ansible,omitempty"`
OpenshiftAnsibleSrcClusterTestConfiguration *OpenshiftAnsibleSrcClusterTestConfiguration `json:"openshift_ansible_src,omitempty"`
OpenshiftInstallerClusterTestConfiguration *OpenshiftInstallerClusterTestConfiguration `json:"openshift_installer,omitempty"`
ContainerTestConfiguration *ContainerTestConfiguration `json:"container,omitempty"`
OpenshiftAnsibleClusterTestConfiguration *OpenshiftAnsibleClusterTestConfiguration `json:"openshift_ansible,omitempty"`
OpenshiftAnsibleSrcClusterTestConfiguration *OpenshiftAnsibleSrcClusterTestConfiguration `json:"openshift_ansible_src,omitempty"`
OpenshiftAnsibleCustomClusterTestConfiguration *OpenshiftAnsibleCustomClusterTestConfiguration `json:"openshift_ansible_custom,omitempty"`
OpenshiftAnsibleUpgradeClusterTestConfiguration *OpenshiftAnsibleUpgradeClusterTestConfiguration `json:"openshift_ansible_upgrade,omitempty"`
OpenshiftInstallerClusterTestConfiguration *OpenshiftInstallerClusterTestConfiguration `json:"openshift_installer,omitempty"`
}

// ContainerTestConfiguration describes a test that runs a
Expand All @@ -307,12 +309,14 @@ type ContainerTestConfiguration struct {
type ClusterProfile string

const (
ClusterProfileAWS ClusterProfile = "aws"
ClusterProfileAWSAtomic = "aws-atomic"
ClusterProfileAWSCentos = "aws-centos"
ClusterProfileGCP = "gcp"
ClusterProfileGCPHA = "gcp-ha"
ClusterProfileGCPCRIO = "gcp-crio"
ClusterProfileAWS ClusterProfile = "aws"
ClusterProfileAWSAtomic = "aws-atomic"
ClusterProfileAWSCentos = "aws-centos"
ClusterProfileAWSGluster = "aws-gluster"
ClusterProfileGCP = "gcp"
ClusterProfileGCPHA = "gcp-ha"
ClusterProfileGCPCRIO = "gcp-crio"
ClusterProfileGCPLogging = "gcp-logging"
)

// ClusterTestConfiguration describes a test that provisions
Expand All @@ -321,6 +325,14 @@ type ClusterTestConfiguration struct {
ClusterProfile ClusterProfile `json:"cluster_profile"`
}

// ClusterUpgradeTestConfiguration describes a test that provisions
// a cluster, upgrades it and runs a command in it.
type ClusterUpgradeTestConfiguration struct {
ClusterProfile ClusterProfile `json:"cluster_profile"`
PreviousVersion string `json:"previous_version"`
PreviousRPMDeps string `json:"previous_rpm_deps"`
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't look like you need this separate struct. These fields can be added to OpenshiftAnsibleUpgradeClusterTestConfiguration directly.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because clusters are always upgraded from one version to the next, these could also be derived automatically from tag_specification.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deriving previous version is fairly complicated, 4.0 -> 3.11 (it could as well be 3.12 -> 3.11), previous RPM deps repo is not easy too

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional struct is for this is no longer created


// OpenshiftAnsibleClusterTestConfiguration describes a test
// that provisions a cluster using openshift-ansible and runs
// conformance tests.
Expand All @@ -335,6 +347,20 @@ type OpenshiftAnsibleSrcClusterTestConfiguration struct {
ClusterTestConfiguration `json:",inline"`
}

// OpenshiftAnsibleCustomClusterTestConfiguration describes a
// test that provisions a cluster using openshift-ansible's
// custom provisioner, and runs conformance tests.
type OpenshiftAnsibleCustomClusterTestConfiguration struct {
ClusterTestConfiguration `json:",inline"`
}

// OpenshiftAnsibleUpgradeClusterTestConfiguration describes a
// test that provisions a cluster using openshift-ansible,
// upgrades it to the next version and runs conformance tests.
type OpenshiftAnsibleUpgradeClusterTestConfiguration struct {
ClusterTestConfiguration `json:",inline"`
}

// OpenshiftInstallerClusterTestConfiguration describes a test
// that provisions a cluster using openshift-installer and runs
// conformance tests.
Expand Down