Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow cropping or suppressing printed docstrings on steps #56

Closed
JakeDawkins opened this issue Jul 21, 2020 · 8 comments
Closed

Allow cropping or suppressing printed docstrings on steps #56

JakeDawkins opened this issue Jul 21, 2020 · 8 comments
Assignees
Labels
enhancement Improvement of existing features or bugfix
Milestone

Comments

@JakeDawkins
Copy link

I have a .feature file which uses docstrings in steps pretty extensively. When tests run, the entire docstring is printed out alongside the step names. I'd rather not see that, since that immediately adds ~1600 lies to my test output, making it quite noisy. Is there any way to silence that?

For example:

Scenario: should not confuse union types with overlapping field names
  Given query
    """
    query {
      body {
        ...on Image {
          attributes {
            url
          }
        }
        ...on Text {
          attributes {
            bold
            text
          }
        }
      }
    }
    """
  Then query plan
    """
    {
      "kind": "QueryPlan",
      "node": {
        "kind": "Fetch",
        "serviceName": "documents",
        "variableUsages": [],
        "operation": "{body{__typename ...on Image{attributes{url}}...on Text{attributes{bold text}}}}"
      }
    }
    """

prints this when the test is run:

 Scenario: should not confuse union types with overlapping field names                                                                                tests/build-query-plan.feature:3:11
  ✔ Given query                                                                                                                                        tests/build-query-plan.feature:4:3
      """
      query {
        body {
          ...on Image {
            attributes {
              url
            }
          }
          ...on Text {
            attributes {
              bold
              text
            }
          }
        }
      }
      """
  ✘ Then query plan                                                                                                                                   tests/build-query-plan.feature:22:3
      """
      {
        "kind": "QueryPlan",
        "node": {
          "kind": "Fetch",
          "serviceName": "documents",
          "variableUsages": [],
          "operation": "{body{__typename ...on Image{attributes{url}}...on Text{attributes{bold text}}}}"
        }
      }
      """
———— ! Step failed: ——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— query-planner/tests/cucumber.rs:69:29
  assertion failed: `(left == right)`
    left: `QueryPlan { node: None }`,
   right: `QueryPlan { node: Some(Fetch(FetchNode { service_name: "documents", variable_usages: [], requires: None, operation: "{body{__typename ...on Image{attributes{url}}...on
  Text{attributes{bold text}}}}" })) }`
——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————

@bbqsrc
Copy link
Member

bbqsrc commented Jul 21, 2020

Right now, no. I'll keep this open as a reminder to implement the ability to withhold printing docstrings or limit their length. 😄

@bbqsrc bbqsrc added the enhancement Improvement of existing features or bugfix label Jul 21, 2020
@JakeDawkins
Copy link
Author

Thanks for the quick response @bbqsrc :)

@bbqsrc bbqsrc changed the title Question: Is is possible to modify printed output? Allow cropping or suppressing printed docstrings on steps Jul 21, 2020
@bbqsrc
Copy link
Member

bbqsrc commented Jul 30, 2020

If anybody wants to take on this issue, I'd be happy to mentor!

@bbqsrc bbqsrc added good first issue Good for newcomers help wanted Extra attention is needed labels Jul 30, 2020
@tyranron tyranron added this to the 0.10 milestone Sep 28, 2021
@tyranron tyranron removed help wanted Extra attention is needed good first issue Good for newcomers labels Oct 12, 2021
@tyranron
Copy link
Member

@ilslv could you clarify here how this works now?

@ilslv
Copy link
Member

ilslv commented Oct 12, 2021

@tyranron writer::Basic now outputs only step name itself and table, if present. No docstrings.

@tyranron
Copy link
Member

@ilslv should we support docstrings outputting as opt-in? Maybe some kind of --verbose CLI opt?

@ilslv
Copy link
Member

ilslv commented Oct 12, 2021

@tyranron I would argue that docstrings are useful as diagnostics (as shown in this issue) or for more verbose explanation, which I'm not sure is useful as part of output. And most importantly, we'll need a way to show 1 set of cli options, if writer::Basic is present and the other one if some other OutputWriter used.

@tyranron
Copy link
Member

@ilslv let's move this question to a separate dedicated issue then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvement of existing features or bugfix
Projects
None yet
Development

No branches or pull requests

4 participants