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

Moved StepDefinition to the formatters pkg #332

Merged
merged 1 commit into from
Jul 14, 2020

Conversation

lonnblad
Copy link
Member

@lonnblad lonnblad commented Jul 11, 2020

This change would finish the move of all the needed extra exports for custom formatters to one pkg and then concentrate the exports in the base pkg to the ones needed for using godog to execute tests.

This would mean that the base of a custom formatter would look like this:

package customformatter

import (
	"io"

	"github.com/cucumber/godog"
	"github.com/cucumber/godog/formatters"
	"github.com/cucumber/messages-go/v10"
)

func init() {
	formatters.Format("custom", "Custom formatter", customFormatterFunc)
}

func customFormatterFunc(suite string, out io.Writer) formatters.Formatter {
	return &customFmt{suiteName: suite, out: out}
}

type customFmt struct {
	suiteName string
	out       io.Writer
}

func (f *customFmt) TestRunStarted()                                                        {}
func (f *customFmt) Feature(*messages.GherkinDocument, string, []byte)                      {}
func (f *customFmt) Pickle(*godog.Scenario)                                                 {}
func (f *customFmt) Defined(*godog.Scenario, *godog.Step, *formatters.StepDefinition)       {}
func (f *customFmt) Passed(*godog.Scenario, *godog.Step, *formatters.StepDefinition)        {}
func (f *customFmt) Skipped(*godog.Scenario, *godog.Step, *formatters.StepDefinition)       {}
func (f *customFmt) Undefined(*godog.Scenario, *godog.Step, *formatters.StepDefinition)     {}
func (f *customFmt) Failed(*godog.Scenario, *godog.Step, *formatters.StepDefinition, error) {}
func (f *customFmt) Pending(*godog.Scenario, *godog.Step, *formatters.StepDefinition)       {}
func (f *customFmt) Summary()                                                               {}

@lonnblad lonnblad force-pushed the moved-stepdef-to-the-public-formatters-pkg branch from 9b84f47 to f2a8e14 Compare July 11, 2020 08:42
@codecov
Copy link

codecov bot commented Jul 11, 2020

Codecov Report

Merging #332 into master will increase coverage by 0.08%.
The diff coverage is 93.93%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #332      +/-   ##
==========================================
+ Coverage   80.04%   80.13%   +0.08%     
==========================================
  Files          23       23              
  Lines        2230     2260      +30     
==========================================
+ Hits         1785     1811      +26     
- Misses        342      346       +4     
  Partials      103      103              
Impacted Files Coverage Δ
formatters/fmt.go 100.00% <ø> (ø)
internal/models/stepdef.go 58.92% <0.00%> (-2.19%) ⬇️
internal/formatters/fmt_base.go 86.33% <100.00%> (ø)
internal/formatters/fmt_events.go 97.48% <100.00%> (+0.01%) ⬆️
internal/formatters/fmt_pretty.go 81.22% <100.00%> (ø)
internal/formatters/fmt_progress.go 93.90% <100.00%> (ø)
internal/storage/storage.go 91.42% <100.00%> (+0.98%) ⬆️
suite.go 90.72% <100.00%> (+0.31%) ⬆️
test_context.go 63.26% <100.00%> (+1.56%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ce8036f...2fa3b9f. Read the comment docs.

@lonnblad lonnblad force-pushed the moved-stepdef-to-the-public-formatters-pkg branch from f2a8e14 to 2fa3b9f Compare July 11, 2020 08:49
@lonnblad lonnblad merged commit daa36b6 into master Jul 14, 2020
@mattwynne mattwynne deleted the moved-stepdef-to-the-public-formatters-pkg branch April 30, 2022 21:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant