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

feature request: reporter customization #3163

Closed
gibson042 opened this issue Jan 30, 2023 · 4 comments
Closed

feature request: reporter customization #3163

gibson042 opened this issue Jan 30, 2023 · 4 comments
Labels

Comments

@gibson042
Copy link
Contributor

Related to #3160, my CI setup would greatly benefit from having TAP output include parseable test duration (e.g., as requested by TestAnything/Specification#16 ). This is not part of the built-in TapReporter (and appropriately so!), but there's also no way that I can see to apply customization here.

Would you be willing to add a configuration option for this, e.g. --custom-reporter=/path/to/my-custom-reporter.{js,cjs,mjs} and customReporter: class MyCustomReporter { … }? It would require committing to and documenting the API surface area, but AFAICT the { extensions: string[], projectDir: string, reportStream: Writable, stdStream: Writable, watching: boolean } reporter constructor argument shape is simple and seems to be stable, and projectDir at least is already established as such at https://github.com/avajs/ava/blob/main/docs/06-configuration.md#avaconfigjs .

@novemberborn
Copy link
Member

I don't think our current event format is fit for purpose, stable or extensible. But that's what such reporters would be hooking into. See also #2608 and #3004. The latter would probably be the most flexible approach.

@novemberborn novemberborn closed this as not planned Won't fix, can't repro, duplicate, stale Feb 6, 2023
@gibson042
Copy link
Contributor Author

@novemberborn What would you think about updating that internal format to conform with https://github.com/js-reporters/js-reporters?

@novemberborn
Copy link
Member

That project looks abandoned… and at first glance, what AVA needs is an interchange format we'd emit to stdout so you can pipe to other tools. We wouldn't necessarily want to load third-party code into the main process.

@gibson042
Copy link
Contributor Author

Acknowledged. We'll continue local patching for our purposes until such an interface is available.

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

No branches or pull requests

2 participants