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

Conversation

Projects
None yet
2 participants
@NickTomlin
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

This comment has been minimized.

Show comment
Hide comment
@NickTomlin

NickTomlin Dec 16, 2016

Owner

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

Owner

NickTomlin commented Dec 16, 2016

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

@wswebcreation

This comment has been minimized.

Show comment
Hide comment
@wswebcreation

wswebcreation Dec 16, 2016

Collaborator

Sorry for my late reaction

Will check it tomorrow

Collaborator

wswebcreation commented Dec 16, 2016

Sorry for my late reaction

Will check it tomorrow

Show outdated Hide outdated src/parsers/index.js
return parserObject
}
function handlePah (parserPath) {

This comment has been minimized.

@wswebcreation

wswebcreation Dec 17, 2016

Collaborator

Typo? handlePath

@wswebcreation

wswebcreation Dec 17, 2016

Collaborator

Typo? handlePath

This comment has been minimized.

@NickTomlin

NickTomlin Dec 17, 2016

Owner

Yep! Great catch!

@NickTomlin

NickTomlin Dec 17, 2016

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.

@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]
  }
}
@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.

@NickTomlin

NickTomlin Dec 17, 2016

Owner

I think that makes a lot of sense 👍

@NickTomlin

NickTomlin Dec 17, 2016

Owner

I think that makes a lot of sense 👍

@wswebcreation

This comment has been minimized.

Show comment
Hide comment
@wswebcreation

wswebcreation Dec 17, 2016

Collaborator

Hi @NickTomlin,

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

Grtz

Wim

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