Skip to content

Conversation

@AlexNPavel
Copy link
Contributor

This implements a few new structs to allow us to read in user test configs and a function to expand the user's config (which may contain references, chains, etc) into a full internal test representation. This contains some duplicate code from TestStepConfiguration as this is essentially the evolution of that struct, but I did not want to trample that code while this new config format is still in a WIP state.

/cc @stevekuznetsov @bbguimaraes

@openshift-ci-robot openshift-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Aug 22, 2019
@openshift-ci-robot openshift-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 22, 2019
Copy link
Contributor

@stevekuznetsov stevekuznetsov left a comment

Choose a reason for hiding this comment

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

This is a good first start!

General comment -- we should make the new type of test just another option, like all of the others we have in the larger TestStepConfiguration -- this will mean we get a lot of validation for free. Once we do that, we should ensure we have new unit tests for those validations.

Also, we'd like to validate that no two steps in the resulting TestFlow have the same name, so we should add a validation function there and unit-test that as well.

The implementation of the Resolver interface should also have a set of unit tests.

@openshift-ci-robot openshift-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 23, 2019
Copy link
Contributor

@stevekuznetsov stevekuznetsov left a comment

Choose a reason for hiding this comment

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

This is looking really good! Let's add unit tests for Resolve, add in the call to use the resolver in CI Operator and I think we are close to done!

The unit test could look something like:

func TestResolve(t *testing.T) {
    var testCases = []struct{
        name string
        input api.MultiStageTestConfiguration
        expected types.TestFlow
        expectedError bool
    } {
        name: ""
        // ...
    }

    for _, testCase := range testCases {
        t.Run(testCase.name, func(t *testing.T) {
            actual, err := NewResolver().Resolve(testCase.input)
            // check things
        }
    }
}

@AlexNPavel AlexNPavel changed the title Implement mulit-stage test registry interface Implement multi-stage test registry interface Aug 26, 2019
@openshift-ci-robot openshift-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 26, 2019
Copy link
Contributor

@stevekuznetsov stevekuznetsov left a comment

Choose a reason for hiding this comment

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

I still think we need a set of unit tests for the Resolve() method like I mentioned in the last review. Otherwise, this looks good!

Copy link
Contributor

@stevekuznetsov stevekuznetsov left a comment

Choose a reason for hiding this comment

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

Other than the typo that Petr noticed, this is ready to merge!

@stevekuznetsov
Copy link
Contributor

/lgtm
/approve

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Aug 27, 2019
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: AlexNPavel, stevekuznetsov

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 27, 2019
@openshift-merge-robot openshift-merge-robot merged commit f6ba820 into openshift:master Aug 27, 2019
@AlexNPavel AlexNPavel deleted the test-flow-imp branch February 3, 2023 20:01
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. lgtm Indicates that a PR is ready to be merged. 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.

6 participants