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

ndjson message - Add hook type to message #72

Closed
grasshopper7 opened this issue Oct 18, 2020 · 6 comments · Fixed by #102
Closed

ndjson message - Add hook type to message #72

grasshopper7 opened this issue Oct 18, 2020 · 6 comments · Fixed by #102

Comments

@grasshopper7
Copy link

Is your feature request related to a problem? Please describe.
The hook type (before, beforestep .... etc) is not available in the ndjson message. Need it in the reports to identify the hook type. Also for enabling or disabling display based on hook type.

Describe the solution you'd like
Available in the hook message. Will make porting reports based on json easier, in which this information is available.

Describe alternatives you've considered

Additional context

@aslakhellesoy aslakhellesoy transferred this issue from cucumber/cucumber-jvm Oct 18, 2020
@aslakhellesoy
Copy link
Contributor

I think this would be good to have. I’d like the type to be an enum so we avoid proliferation of types.

@grasshopper7
Copy link
Author

Would something like this work?

message Hook {
  string id = 1;
  string tag_expression = 2;
  SourceReference source_reference = 3;
  HookType hook_type = 4;
  
  enum HookType {
    UNKNOWN = 0;
    BEFORE = 1;
    AFTER = 2;
    BEFORE_STEP = 3;
    AFTER_STEP = 4;
  }
}

Tried this with Java and getting the below message.

id: "42886b52-18d4-4e93-948b-c8b8b766ac99"
source_reference {
  location {
    line: 582
  }
  java_stack_trace_element {
    class_name: "MockedScenarioScopedHookDefinition"
    method_name: "getSourceReference"
    file_name: "CachingGlueTest.java"
  }
}
hook_type: BEFORE

@davidjgoss
Copy link
Contributor

@grasshopper7 that looks good. Think it would also need BEFORE_ALL and AFTER_ALL

@stale
Copy link

stale bot commented Sep 22, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in two months if no further activity occurs.

@mattwynne mattwynne transferred this issue from cucumber/common Sep 30, 2022
@luke-hill
Copy link
Contributor

@mpkorstanje - I think you were working on something that would effectively close this as completed?

@mpkorstanje mpkorstanje mentioned this issue Sep 1, 2024
7 tasks
@mpkorstanje
Copy link
Contributor

I was. I needed these to implement a message protocol based json formatter. But I'm blocked on until I solve other problems. If any one wants this, feel free to pick up #224.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants