Skip to content

make template selection test-able #956

Closed

Description

@vilmibm

We don't currently have the ability to test template selection during issue/pr creation and we
should.

Activity

  1. added
    tech-debt
    on May 18, 2020
  2. AliabbasMerchant commented on May 18, 2020

    @AliabbasMerchant
    Contributor

    Also, we need tests for interactive mode in issue/pr creation

  3. AliabbasMerchant commented on May 18, 2020

    @AliabbasMerchant
    Contributor

    Can I take up the tests for the interactive mode?
    I tried it out locally, and the tests I wrote are working.

    I can later on try stubbing the template file selection also

  4. AliabbasMerchant commented on May 18, 2020

    @AliabbasMerchant
    Contributor

    Got the solution!
    I feel we actually don't need to exactly stub the template file selection.
    (Your comments here:

    // TODO: figure out how to stub this in tests
    and here:
    // TODO: figure out how to stub this in tests
    )
    What I think is, instead of stubbing and putting demo files in the flow, we can actually utilize the existing template files in the flow.
    Let gh select our existing issue and pr templates from the file system, and then when the user selects that particular option of the template, we can directly check if the contents are proper.
    (And we don't need to check for the change due to the user opening the text editor, as that is the job of the surveyext library, and we can assume that it is well tested.)
    Also, we already have github_template_test.go for template content extraction stuff testing.

    In case I was unable to put forth my ideas clearly, I believe that I will be able to show it better via a PR. (and commenting on my changes there)

  5. vilmibm commented on May 18, 2020

    @vilmibm
    ContributorAuthor

    sure, if you are up to it! Let me know if you have any questions or difficulties with the AskStubber and CommandStubber helpers.

  6. vilmibm commented on May 18, 2020

    @vilmibm
    ContributorAuthor

    oop, page was out of date. I'm happy to look at a PR and discuss there. Thanks for thinking about it and for checking in! Assign me as a reviewer, please.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    tech-debt

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions