Skip to content

Conversation

@bbguimaraes
Copy link
Contributor

First prototype of the new test type. This version is capable of reproducing the most common template test (AWS E2E). See the corresponding WIP branch here.

Some parts of the code are still specific to E2E tests, but I've isolated them in the last commit and am open to suggestions on how to make them more generic.

Other than that, next steps are (sup)porting more test types, adding more tests (which we can finally have), and making sure we have 100% feature parity with templates.

@openshift-ci-robot openshift-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 13, 2019
@openshift-ci-robot openshift-ci-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Aug 13, 2019
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bbguimaraes

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 13, 2019
errs = append(errs, fmt.Errorf("failed to create secret: %v", err))
}
if errs == nil {
if err = s.runSteps(ctx, s.tests, secret); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

This should remain err := ?

if secret, err = createSecret(s.secretClient, s.jobSpec.Namespace, s.artifactDir); err != nil {
errs = append(errs, fmt.Errorf("failed to create secret: %v", err))
}
if errs == nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

The logic here is getting a bit nuts. Why not just return when we can't make the secret?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Depends if we want post if pre failed.

var errs []error
if err := s.runSteps(ctx, s.pre); err != nil {
var err error
if err = s.runSteps(ctx, s.pre, ""); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't we need the secret in the pre-steps so the installer can commit the KUBECONFIG to it in the first place?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The main reason for repurposing artifacts is because the installer image doesn't have oc in it. If we can enforce that pre steps must be able to modify a secret, I'll gladly remove this.

ObjectMeta: meta.ObjectMeta{Name: "installer"},
Data: make(map[string][]byte, len(files)),
}
for _, f := range files {
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems fragile -- if the secret is write-able (or if we use a configmap) the pre-steps can just self-manage this

return nil
}

type openshiftInstallerTestStep struct {
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't understand what is going on in this commit

Copy link
Contributor Author

Choose a reason for hiding this comment

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

First of all, in the best scenario it is intended to be removed. Up to this point, the implementation is completely generic and has no E2E- (or even Openshift-) specific bits.

The code in openshiftInstallerTestStep is everything I still don't know how to make generic that is required for the E2E AWS test.. It is also a possible implementation where different test types would share the step back-end but have test-specific extensions, but I would prefer if we could make all that part of configuration / step implementation.

@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 17, 2019
@openshift-ci-robot openshift-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Sep 18, 2019
@bbguimaraes bbguimaraes deleted the steps branch September 18, 2019 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants