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

Enable external formatters #541

Open
martin-schulze-vireso opened this issue Jan 14, 2022 · 2 comments
Open

Enable external formatters #541

martin-schulze-vireso opened this issue Jan 14, 2022 · 2 comments
Labels
Component: Bash Code Everything regarding the bash code Component: Packaging Regarding packaging for NPM, RPM, etc. Priority: Medium Wrong or misleading documentation, broken behavior with workaround Size: Medium Changes in the same file Type: Enhancement

Comments

@martin-schulze-vireso
Copy link
Member

martin-schulze-vireso commented Jan 14, 2022

We have several requests for other formatters and it is hard to draw the line which to include into bats and which to redirect to simply consuming TAP. For further development, we should fix the set of existing formatters and enable easy integration for others. These are the necessary steps:

  1. provide a (somewhat) stable interface (that should allow for testing if a formatter works). lib/bats-core/formatter.bash is a first step in that direction
  2. allow for loading formatters from a custom location (add something like a BATS_FORMATTER_PATH)
  3. Redirect existing PRs into an extra formatter project to bundle them there without holding up main development. This relates to following PRs: WIP: Add CppUnit XML as an output option #54 feat: Add lava support #300
  • as a side note: Some formatters like the Lava formatter offer additional information ("measurements"), we need to find a way to incorporate these in a way that at least avoids tripping up other formatters and at best making it usable across the board.
@martin-schulze-vireso martin-schulze-vireso added Type: Enhancement Priority: Critical Broken behavior in nearly all environments, e.g. wrong test results, internal bats error Component: Bash Code Everything regarding the bash code Component: Packaging Regarding packaging for NPM, RPM, etc. labels Jan 14, 2022
@martin-schulze-vireso martin-schulze-vireso added this to the 1.7.0 milestone Feb 24, 2022
@martin-schulze-vireso martin-schulze-vireso added the Size: Medium Changes in the same file label Feb 24, 2022
@martin-schulze-vireso
Copy link
Member Author

As an initial increment in this direction, we should allow for specifying absolute paths: If the -F/--formatter argument has a leading / we just assume this is the file meant to be executed.

@martin-schulze-vireso martin-schulze-vireso modified the milestones: 1.7.0, 1.8.0 May 8, 2022
@martin-schulze-vireso
Copy link
Member Author

A partial solution has been implemented in #602. The rest needs to be reevaluated.

@martin-schulze-vireso martin-schulze-vireso added Priority: Medium Wrong or misleading documentation, broken behavior with workaround and removed Priority: Critical Broken behavior in nearly all environments, e.g. wrong test results, internal bats error labels Jun 5, 2022
@martin-schulze-vireso martin-schulze-vireso removed this from the 1.8.0 milestone Jun 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Bash Code Everything regarding the bash code Component: Packaging Regarding packaging for NPM, RPM, etc. Priority: Medium Wrong or misleading documentation, broken behavior with workaround Size: Medium Changes in the same file Type: Enhancement
Projects
None yet
Development

No branches or pull requests

1 participant