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

Fixed so that we don't execute features with zero scenarios #315

Merged
merged 1 commit into from
Jun 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion features/formatter/events.feature
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ Feature: event stream formatter
Then the following events should be fired:
"""
TestRunStarted
TestSource
TestRunFinished
"""

Expand Down
11 changes: 1 addition & 10 deletions formatter-tests/cucumber/empty
Original file line number Diff line number Diff line change
@@ -1,10 +1 @@
[
{
"uri": "formatter-tests/features/empty.feature",
"id": "empty-feature",
"keyword": "Feature",
"name": "empty feature",
"description": "",
"line": 1
}
]
[]
11 changes: 1 addition & 10 deletions formatter-tests/cucumber/empty_with_description
Original file line number Diff line number Diff line change
@@ -1,10 +1 @@
[
{
"uri": "formatter-tests/features/empty_with_description.feature",
"id": "empty-feature",
"keyword": "Feature",
"name": "empty feature",
"description": " describes\n an empty\n feature",
"line": 1
}
]
[]
1 change: 0 additions & 1 deletion formatter-tests/events/empty
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
{"event":"TestRunStarted","version":"0.1.0","timestamp":-6795364578871,"suite":"events"}
{"event":"TestSource","location":"formatter-tests/features/empty.feature:1","source":"Feature: empty feature\n"}
{"event":"TestRunFinished","status":"pending","timestamp":-6795364578871,"snippets":"","memory":""}
1 change: 0 additions & 1 deletion formatter-tests/events/empty_with_description
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
{"event":"TestRunStarted","version":"0.1.0","timestamp":-6795364578871,"suite":"events"}
{"event":"TestSource","location":"formatter-tests/features/empty_with_description.feature:1","source":"Feature: empty feature\n describes\n an empty\n feature\n"}
{"event":"TestRunFinished","status":"pending","timestamp":-6795364578871,"snippets":"","memory":""}
4 changes: 1 addition & 3 deletions formatter-tests/junit/empty
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuites name="junit" tests="0" skipped="0" failures="0" errors="0" time="0">
<testsuite name="empty feature" tests="0" skipped="0" failures="0" errors="0" time="0"></testsuite>
</testsuites>
<testsuites name="junit" tests="0" skipped="0" failures="0" errors="0" time="0"></testsuites>
4 changes: 1 addition & 3 deletions formatter-tests/junit/empty_with_description
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuites name="junit" tests="0" skipped="0" failures="0" errors="0" time="0">
<testsuite name="empty feature" tests="0" skipped="0" failures="0" errors="0" time="0"></testsuite>
</testsuites>
<testsuites name="junit" tests="0" skipped="0" failures="0" errors="0" time="0"></testsuites>
1 change: 0 additions & 1 deletion formatter-tests/pretty/empty
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<bold-white>Feature:</bold-white> empty feature

No scenarios
No steps
Expand Down
4 changes: 0 additions & 4 deletions formatter-tests/pretty/empty_with_description
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
<bold-white>Feature:</bold-white> empty feature
describes
an empty
feature

No scenarios
No steps
Expand Down
2 changes: 1 addition & 1 deletion parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ func filterFeatures(tags string, features []*feature) (result []*feature) {
for _, ft := range features {
ft.pickles = applyTagFilter(tags, ft.pickles)

if ft.Feature != nil {
if ft.Feature != nil && len(ft.pickles) > 0 {
result = append(result, ft)
}
}
Expand Down
4 changes: 0 additions & 4 deletions run.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,6 @@ func (r *runner) scenarioConcurrent(rate int) (failed bool) {
copy(pickles, ft.pickles)
}

if len(pickles) == 0 {
r.fmt.Feature(ft.GherkinDocument, ft.Uri, ft.content)
}

for i, p := range pickles {
pickle := *p

Expand Down