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

Adds 'outline' command to print the outline of specs/containers in a file #754

Merged
merged 13 commits into from
Dec 30, 2020

Commits on Dec 26, 2020

  1. Adds 'outline' command to print the outline of specs/containers in a …

    …file
    
    Implements feature request in onsi#753
    dlipovetsky committed Dec 26, 2020
    Configuration menu
    Copy the full SHA
    c386859 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    bdc78da View commit details
    Browse the repository at this point in the history

Commits on Dec 29, 2020

  1. outline: During a post-order traversal of an AST Node, do not derive …

    …its ginkgo metadata
    
    The post-order traversal needs to check whether the AST Node is a ginkgo node.
    That can be done by comparing the positions of the AST Node and the last
    visited ginkgo node. Deriving the ginkgo metadata is not necessary.
    dlipovetsky committed Dec 29, 2020
    Configuration menu
    Copy the full SHA
    d6352fb View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a629f65 View commit details
    Browse the repository at this point in the history
  3. outline: Add instructions and script for creating/updating sample tes…

    …t results
    
    To make it easier to maintain the outline tests.
    dlipovetsky committed Dec 29, 2020
    Configuration menu
    Copy the full SHA
    c85d63e View commit details
    Browse the repository at this point in the history
  4. outline: Use script to re-create result samples for all tests

    The content has not changed; only the JSON formatting and the filenames have
    changed.
    dlipovetsky committed Dec 29, 2020
    Configuration menu
    Copy the full SHA
    245e360 View commit details
    Browse the repository at this point in the history
  5. outline: Factor the back/propagation code to helper functions

    The top-level function needed to be shorter.
    dlipovetsky committed Dec 29, 2020
    Configuration menu
    Copy the full SHA
    144c847 View commit details
    Browse the repository at this point in the history
  6. outline: Refactor deriving ginkgo identifier from call expression

    Again, the top-level function needed to be shorter.
    dlipovetsky committed Dec 29, 2020
    Configuration menu
    Copy the full SHA
    a717abc View commit details
    Browse the repository at this point in the history
  7. outline: Move the exported outline code into its own file

    Keep the unexprted ginkgoNode code in a separate file.
    dlipovetsky committed Dec 29, 2020
    Configuration menu
    Copy the full SHA
    380e88f View commit details
    Browse the repository at this point in the history
  8. outline: Instead of aliasing ginkgoNode with outline, embed ginkgoNod…

    …e in outline
    
    An advantage of embedding is that it does not require casting. The outline
    receivers does not change.
    dlipovetsky committed Dec 29, 2020
    Configuration menu
    Copy the full SHA
    4317c54 View commit details
    Browse the repository at this point in the history
  9. outline: (fix) Derive the "text" of the By ginkgo call

    The "text" was being ignored by mistake.
    dlipovetsky committed Dec 29, 2020
    Configuration menu
    Copy the full SHA
    2ca52da View commit details
    Browse the repository at this point in the history
  10. outline: Test an outline of a "suite_test.go" file

    The test and its result samples were already present, but the test was not run.
    dlipovetsky committed Dec 29, 2020
    Configuration menu
    Copy the full SHA
    bc67def View commit details
    Browse the repository at this point in the history
  11. outline: Add "indent" format

    This is really just for fun. Here's an example:
    
    ``shell
    ginkgo outline -format=indent outline/_testdata/normal_test.go
    ```
    
    ```shell
    Name,Text,Start,End,Spec,Focused,Pending
    Describe,NormalFixture,116,605,false,false,false
        Describe,normal,152,244,false,false,false
            It,normal,182,240,true,false,false
                By,step 1,207,219,false,false,false
                By,step 2,223,235,false,false,false
        Context,normal,247,307,false,false,false
            It,normal,276,303,true,false,false
        When,normal,310,367,false,false,false
            It,normal,336,363,true,false,false
        It,normal,370,396,true,false,false
        Specify,normal,399,430,true,false,false
        Measure,normal,433,480,true,false,false
    ```
    
    It also happens to look nice piped through `column`:
    
    ```shell
    ginkgo outline -format=indent outline/_testdata/normal_test.go | column --table -s=","
    ```
    
    ```
    Name            Text           Start  End  Spec   Focused  Pending
    Describe        NormalFixture  116    605  false  false    false
        Describe    normal         152    244  false  false    false
            It      normal         182    240  true   false    false
                By  step 1         207    219  false  false    false
                By  step 2         223    235  false  false    false
        Context     normal         247    307  false  false    false
            It      normal         276    303  true   false    false
        When        normal         310    367  false  false    false
            It      normal         336    363  true   false    false
        It          normal         370    396  true   false    false
        Specify     normal         399    430  true   false    false
        Measure     normal         433    480  true   false    false
    ```
    dlipovetsky committed Dec 29, 2020
    Configuration menu
    Copy the full SHA
    7429680 View commit details
    Browse the repository at this point in the history