Skip to content

StepDefinition and Hook method names from ndjson report #2058

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

Closed
grasshopper7 opened this issue Jul 19, 2020 · 4 comments · Fixed by #2064
Closed

StepDefinition and Hook method names from ndjson report #2058

grasshopper7 opened this issue Jul 19, 2020 · 4 comments · Fixed by #2064
Labels
⚡ enhancement Request for new functionality
Milestone

Comments

@grasshopper7
Copy link
Contributor

Is your feature request related to a problem? Please describe.
Unable to retrieve StepDefinition and Hook method names from ndjson output, which are not available in the current report. The method names are required for an existing report which is currently based on parsing the json output.

Describe the solution you'd like
The method names should be present in the ndjson report, added to the stepdefinition and hook messages. Basically data similar to what was available from 'location' in the 'match' object in the json report.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.
In the compatibility-kit examples it is available in the 'sourceReference' - https://github.com/cucumber/cucumber/blob/a9ec08ec3bb67d44afa7a2c9d3b8ff4f5fd1246b/compatibility-kit/javascript/features/hooks/hooks.ndjson#L8 but this is not there in the jvm output.

@grasshopper7 grasshopper7 added the ⚡ enhancement Request for new functionality label Jul 19, 2020
@mpkorstanje mpkorstanje modified the milestones: 7.0.0, v6.x.x Jul 20, 2020
mpkorstanje added a commit that referenced this issue Jul 23, 2020
Cucumber JVM can not reference files by URI. So it should use either java
methods or stack trace elements as a source reference instead.

For example:

```
{
  "hook": {
    "id": "a1839ec6-f75d-4029-9b75-4b8203d8b2e8",
    "sourceReference": {
      "javaMethod": {
        "className": "io.cucumber.compatibility.attachments.Attachments",
        "methodName": "before",
        "methodParameterTypes": [
          "io.cucumber.java.Scenario"
        ]
      }
    }
  }
}
```

See: cucumber/common#1119
Fixes: #2058
mpkorstanje added a commit to cucumber/common that referenced this issue Jul 23, 2020
Cucumber JVM can not reference files by URI. So it should use either java
methods or stack trace elements as a source reference instead.

For example:

```json
{
  "hook": {
    "id": "a1839ec6-f75d-4029-9b75-4b8203d8b2e8",
    "sourceReference": {
      "javaMethod": {
        "className": "io.cucumber.compatibility.attachments.Attachments",
        "methodName": "before",
        "methodParameterTypes": [
          "io.cucumber.java.Scenario"
        ]
      }
    }
  }
}
```

See: cucumber/cucumber-jvm#2058
Fixes: #1119
mpkorstanje added a commit to cucumber/common that referenced this issue Jul 23, 2020
Cucumber JVM can not reference files by URI. So it should use either java
methods or stack trace elements as a source reference instead.

For example:

```json
{
  "hook": {
    "id": "a1839ec6-f75d-4029-9b75-4b8203d8b2e8",
    "sourceReference": {
      "javaMethod": {
        "className": "io.cucumber.compatibility.attachments.Attachments",
        "methodName": "before",
        "methodParameterTypes": [
          "io.cucumber.java.Scenario"
        ]
      }
    }
  }
}
```

See: cucumber/cucumber-jvm#2058
Fixes: #1119
mpkorstanje added a commit to cucumber/common that referenced this issue Jul 24, 2020
* messages: Add JavaMethod and JavaStackTraceElement as SourceReference

Cucumber JVM can not reference files by URI. So it should use either java
methods or stack trace elements as a source reference instead.

For example:

```json
{
  "hook": {
    "id": "a1839ec6-f75d-4029-9b75-4b8203d8b2e8",
    "sourceReference": {
      "javaMethod": {
        "className": "io.cucumber.compatibility.attachments.Attachments",
        "methodName": "before",
        "methodParameterTypes": [
          "io.cucumber.java.Scenario"
        ]
      }
    }
  }
}
```

See: cucumber/cucumber-jvm#2058
Fixes: #1119
cukebot pushed a commit to cucumber/messages-dotnet that referenced this issue Jul 24, 2020
Cucumber JVM can not reference files by URI. So it should use either java
methods or stack trace elements as a source reference instead.

For example:

```json
{
  "hook": {
    "id": "a1839ec6-f75d-4029-9b75-4b8203d8b2e8",
    "sourceReference": {
      "javaMethod": {
        "className": "io.cucumber.compatibility.attachments.Attachments",
        "methodName": "before",
        "methodParameterTypes": [
          "io.cucumber.java.Scenario"
        ]
      }
    }
  }
}
```

See: cucumber/cucumber-jvm#2058
Fixes: cucumber/common#1119
cukebot pushed a commit to cucumber/messages-go that referenced this issue Jul 24, 2020
Cucumber JVM can not reference files by URI. So it should use either java
methods or stack trace elements as a source reference instead.

For example:

```json
{
  "hook": {
    "id": "a1839ec6-f75d-4029-9b75-4b8203d8b2e8",
    "sourceReference": {
      "javaMethod": {
        "className": "io.cucumber.compatibility.attachments.Attachments",
        "methodName": "before",
        "methodParameterTypes": [
          "io.cucumber.java.Scenario"
        ]
      }
    }
  }
}
```

See: cucumber/cucumber-jvm#2058
Fixes: cucumber/common#1119
cukebot pushed a commit to cucumber/messages-java that referenced this issue Jul 24, 2020
Cucumber JVM can not reference files by URI. So it should use either java
methods or stack trace elements as a source reference instead.

For example:

```json
{
  "hook": {
    "id": "a1839ec6-f75d-4029-9b75-4b8203d8b2e8",
    "sourceReference": {
      "javaMethod": {
        "className": "io.cucumber.compatibility.attachments.Attachments",
        "methodName": "before",
        "methodParameterTypes": [
          "io.cucumber.java.Scenario"
        ]
      }
    }
  }
}
```

See: cucumber/cucumber-jvm#2058
Fixes: cucumber/common#1119
cukebot pushed a commit to cucumber/messages-javascript that referenced this issue Jul 24, 2020
Cucumber JVM can not reference files by URI. So it should use either java
methods or stack trace elements as a source reference instead.

For example:

```json
{
  "hook": {
    "id": "a1839ec6-f75d-4029-9b75-4b8203d8b2e8",
    "sourceReference": {
      "javaMethod": {
        "className": "io.cucumber.compatibility.attachments.Attachments",
        "methodName": "before",
        "methodParameterTypes": [
          "io.cucumber.java.Scenario"
        ]
      }
    }
  }
}
```

See: cucumber/cucumber-jvm#2058
Fixes: cucumber/common#1119
cukebot pushed a commit to cucumber/messages-ruby that referenced this issue Jul 24, 2020
Cucumber JVM can not reference files by URI. So it should use either java
methods or stack trace elements as a source reference instead.

For example:

```json
{
  "hook": {
    "id": "a1839ec6-f75d-4029-9b75-4b8203d8b2e8",
    "sourceReference": {
      "javaMethod": {
        "className": "io.cucumber.compatibility.attachments.Attachments",
        "methodName": "before",
        "methodParameterTypes": [
          "io.cucumber.java.Scenario"
        ]
      }
    }
  }
}
```

See: cucumber/cucumber-jvm#2058
Fixes: cucumber/common#1119
mpkorstanje added a commit that referenced this issue Jul 29, 2020
Cucumber JVM can not reference files by URI. So it should use either java
methods or stack trace elements as a source reference instead.

For example:

```
{
  "hook": {
    "id": "a1839ec6-f75d-4029-9b75-4b8203d8b2e8",
    "sourceReference": {
      "javaMethod": {
        "className": "io.cucumber.compatibility.attachments.Attachments",
        "methodName": "before",
        "methodParameterTypes": [
          "io.cucumber.java.Scenario"
        ]
      }
    }
  }
}
```

See: cucumber/common#1119
Fixes: #2058
mpkorstanje added a commit that referenced this issue Jul 29, 2020
Cucumber JVM can not reference files by URI. So it should use either java
methods or stack trace elements as a source reference instead.

For example:

```
{
  "hook": {
    "id": "a1839ec6-f75d-4029-9b75-4b8203d8b2e8",
    "sourceReference": {
      "javaMethod": {
        "className": "io.cucumber.compatibility.attachments.Attachments",
        "methodName": "before",
        "methodParameterTypes": [
          "io.cucumber.java.Scenario"
        ]
      }
    }
  }
}
```

See: cucumber/common#1119
Fixes: #2058
mpkorstanje added a commit that referenced this issue Jul 29, 2020
Cucumber JVM can not reference files by URI. So it should use either java
methods or stack trace elements as a source reference instead.

For example:

```
{
  "hook": {
    "id": "a1839ec6-f75d-4029-9b75-4b8203d8b2e8",
    "sourceReference": {
      "javaMethod": {
        "className": "io.cucumber.compatibility.attachments.Attachments",
        "methodName": "before",
        "methodParameterTypes": [
          "io.cucumber.java.Scenario"
        ]
      }
    }
  }
}
```

See: cucumber/common#1119
Fixes: #2058
mpkorstanje added a commit that referenced this issue Jul 29, 2020
Cucumber JVM can not reference files by URI. So it should use either java
methods or stack trace elements as a source reference instead.

For example:

```
{
  "hook": {
    "id": "a1839ec6-f75d-4029-9b75-4b8203d8b2e8",
    "sourceReference": {
      "javaMethod": {
        "className": "io.cucumber.compatibility.attachments.Attachments",
        "methodName": "before",
        "methodParameterTypes": [
          "io.cucumber.java.Scenario"
        ]
      }
    }
  }
}
```

See: cucumber/common#1119
Fixes: #2058
mpkorstanje added a commit that referenced this issue Jul 29, 2020
Cucumber JVM can not reference files by URI. So it should use either java
methods or stack trace elements as a source reference instead.

For example:

```
{
  "hook": {
    "id": "a1839ec6-f75d-4029-9b75-4b8203d8b2e8",
    "sourceReference": {
      "javaMethod": {
        "className": "io.cucumber.compatibility.attachments.Attachments",
        "methodName": "before",
        "methodParameterTypes": [
          "io.cucumber.java.Scenario"
        ]
      }
    }
  }
}
```

See: cucumber/common#1119
Fixes: #2058
mpkorstanje added a commit that referenced this issue Jul 29, 2020
Cucumber JVM can not reference files by URI. So it should use either java
methods or stack trace elements as a source reference instead.

For example:

```
{
  "hook": {
    "id": "a1839ec6-f75d-4029-9b75-4b8203d8b2e8",
    "sourceReference": {
      "javaMethod": {
        "className": "io.cucumber.compatibility.attachments.Attachments",
        "methodName": "before",
        "methodParameterTypes": [
          "io.cucumber.java.Scenario"
        ]
      }
    }
  }
}
```

See: cucumber/common#1119
Fixes: #2058
mpkorstanje added a commit that referenced this issue Jul 29, 2020
Cucumber JVM can not reference files by URI. So it should use either java
methods or stack trace elements as a source reference instead.

For example:

```
{
  "hook": {
    "id": "a1839ec6-f75d-4029-9b75-4b8203d8b2e8",
    "sourceReference": {
      "javaMethod": {
        "className": "io.cucumber.compatibility.attachments.Attachments",
        "methodName": "before",
        "methodParameterTypes": [
          "io.cucumber.java.Scenario"
        ]
      }
    }
  }
}
```

See: cucumber/common#1119
Fixes: #2058
@grasshopper7
Copy link
Contributor Author

The details are now available for the stepdefinitions, before and after hook methods. But these are not present for the beforestep and afterstep methods.

@mpkorstanje
Copy link
Contributor

mpkorstanje commented Aug 15, 2020

Ah that is too bad. I don't have time to work on a fix for that. Would you mind sending a PR? Or at-least create a new issue so this isn't forgotten about.

@grasshopper7
Copy link
Contributor Author

Have not had the chance to look at this in detail. Is it just adding the line - beforeStepHooks.forEach(this::emitHook); below the following line, and something similar for afterstep hooks?

It adds the step hook details to the report.

@mpkorstanje
Copy link
Contributor

At a glance that sounds about right. Might need a simple unit test to verify that the hooks are emitted too.

davidjgoss pushed a commit to cucumber/json-formatter that referenced this issue Apr 14, 2022
* messages: Add JavaMethod and JavaStackTraceElement as SourceReference

Cucumber JVM can not reference files by URI. So it should use either java
methods or stack trace elements as a source reference instead.

For example:

```json
{
  "hook": {
    "id": "a1839ec6-f75d-4029-9b75-4b8203d8b2e8",
    "sourceReference": {
      "javaMethod": {
        "className": "io.cucumber.compatibility.attachments.Attachments",
        "methodName": "before",
        "methodParameterTypes": [
          "io.cucumber.java.Scenario"
        ]
      }
    }
  }
}
```

See: cucumber/cucumber-jvm#2058
Fixes: cucumber/common#1119
aurelien-reeves pushed a commit to cucumber/messages that referenced this issue Jun 29, 2022
Cucumber JVM can not reference files by URI. So it should use either java
methods or stack trace elements as a source reference instead.

For example:

```json
{
  "hook": {
    "id": "a1839ec6-f75d-4029-9b75-4b8203d8b2e8",
    "sourceReference": {
      "javaMethod": {
        "className": "io.cucumber.compatibility.attachments.Attachments",
        "methodName": "before",
        "methodParameterTypes": [
          "io.cucumber.java.Scenario"
        ]
      }
    }
  }
}
```

See: cucumber/cucumber-jvm#2058
Fixes: cucumber/common#1119
aurelien-reeves pushed a commit to cucumber/messages that referenced this issue Jun 29, 2022
* messages: Add JavaMethod and JavaStackTraceElement as SourceReference

Cucumber JVM can not reference files by URI. So it should use either java
methods or stack trace elements as a source reference instead.

For example:

```json
{
  "hook": {
    "id": "a1839ec6-f75d-4029-9b75-4b8203d8b2e8",
    "sourceReference": {
      "javaMethod": {
        "className": "io.cucumber.compatibility.attachments.Attachments",
        "methodName": "before",
        "methodParameterTypes": [
          "io.cucumber.java.Scenario"
        ]
      }
    }
  }
}
```

See: cucumber/cucumber-jvm#2058
Fixes: cucumber/common#1119
cukebot pushed a commit to cucumber/messages-go that referenced this issue Sep 21, 2022
Cucumber JVM can not reference files by URI. So it should use either java
methods or stack trace elements as a source reference instead.

For example:

```json
{
  "hook": {
    "id": "a1839ec6-f75d-4029-9b75-4b8203d8b2e8",
    "sourceReference": {
      "javaMethod": {
        "className": "io.cucumber.compatibility.attachments.Attachments",
        "methodName": "before",
        "methodParameterTypes": [
          "io.cucumber.java.Scenario"
        ]
      }
    }
  }
}
```

See: cucumber/cucumber-jvm#2058
Fixes: cucumber/common#1119
cukebot pushed a commit to cucumber/messages-go that referenced this issue Sep 21, 2022
* messages: Add JavaMethod and JavaStackTraceElement as SourceReference

Cucumber JVM can not reference files by URI. So it should use either java
methods or stack trace elements as a source reference instead.

For example:

```json
{
  "hook": {
    "id": "a1839ec6-f75d-4029-9b75-4b8203d8b2e8",
    "sourceReference": {
      "javaMethod": {
        "className": "io.cucumber.compatibility.attachments.Attachments",
        "methodName": "before",
        "methodParameterTypes": [
          "io.cucumber.java.Scenario"
        ]
      }
    }
  }
}
```

See: cucumber/cucumber-jvm#2058
Fixes: cucumber/common#1119
cukebot pushed a commit to cucumber/gherkin-go that referenced this issue Nov 9, 2022
* messages: Add JavaMethod and JavaStackTraceElement as SourceReference

Cucumber JVM can not reference files by URI. So it should use either java
methods or stack trace elements as a source reference instead.

For example:

```json
{
  "hook": {
    "id": "a1839ec6-f75d-4029-9b75-4b8203d8b2e8",
    "sourceReference": {
      "javaMethod": {
        "className": "io.cucumber.compatibility.attachments.Attachments",
        "methodName": "before",
        "methodParameterTypes": [
          "io.cucumber.java.Scenario"
        ]
      }
    }
  }
}
```

See: cucumber/cucumber-jvm#2058
Fixes: cucumber/common#1119
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⚡ enhancement Request for new functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants