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

User supplied parsers #45

Closed
wants to merge 4 commits into from
Closed

User supplied parsers #45

wants to merge 4 commits into from

Conversation

@NickTomlin
Copy link
Owner

NickTomlin commented Dec 10, 2016

This adds the ability for users to supply a custom parser by:

  • providing the path to a module that will be required, the path must end in a .* extension
  • providing a custom parsing object (when used programmatically)

This should help in cases where a custom reporter is being used; it allows users to design a parser that fits their needs without having to update protractor-flake itself.

Eventually it would be nice to provide some tools to make parsing output easier but this is a first step.

@NickTomlin
Copy link
Owner Author

NickTomlin commented Dec 16, 2016

@wswebcreation I'd love to hear any thoughts you have on this

@wswebcreation
Copy link
Collaborator

wswebcreation commented Dec 16, 2016

Sorry for my late reaction

Will check it tomorrow

return parserObject
}

function handlePah (parserPath) {

This comment has been minimized.

Copy link
@wswebcreation

wswebcreation Dec 17, 2016

Collaborator

Typo? handlePath

This comment has been minimized.

Copy link
@NickTomlin

NickTomlin Dec 17, 2016

Author Owner

Yep! Great catch!

Parsers should be defined as an object with a `parse` method (and optionally a `name` property):

```
module.exports = {

This comment has been minimized.

Copy link
@wswebcreation

wswebcreation Dec 17, 2016

Collaborator

Use this as an example from your last merge to get more consistency?

module.exports = {
  parse (protractorTestOutput) {
    let failedSpecs = new Set()
    // ... analyze protractor test output
    // ... and add to specFiles

    // specFiles to be re-run by protractor-flake
    // if an empty array is returned, all specs will be re-run
    return [...failedSpecs]
  }
}

This comment has been minimized.

Copy link
@NickTomlin

NickTomlin Dec 17, 2016

Author Owner

I think that makes a lot of sense 👍

@wswebcreation
Copy link
Collaborator

wswebcreation commented Dec 17, 2016

Hi @NickTomlin,

PR looks nice, 2 small comments. Can be merged afterwards.

Grtz

Wim

@NickTomlin NickTomlin deleted the user-supplied-parsers branch Feb 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.