Skip to content

Commit

Permalink
feat: run rules
Browse files Browse the repository at this point in the history
  • Loading branch information
vlalanne committed May 6, 2024
1 parent 39e9e76 commit e64734b
Show file tree
Hide file tree
Showing 15 changed files with 206 additions and 105 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ jobs:
go test -v -covermode=count -coverprofile=coverage.out
- name: Convert coverage to lcov
uses: jandelgado/gcov2lcov-action@v1.0.0
uses: jandelgado/gcov2lcov-action@v1
with:
infile: coverage.out
outfile: coverage.lcov

- name: Coveralls
uses: coverallsapp/github-action@v1.0.1
uses: coverallsapp/github-action@v1
with:
github-token: ${{ secrets.github_token }}
path-to-lcov: coverage.lcov
2 changes: 1 addition & 1 deletion context/context.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package context

import (
"github.com/go-bdd/gobdd"
gobdd "github.com/go-bdd/gobdd"
)

// Holds data from previously executed steps
Expand Down
40 changes: 21 additions & 19 deletions context_get.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 21 additions & 19 deletions context_get_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions features/background.feature
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,11 @@ Feature: using background steps

Scenario: the background step should be executed
Then the result should equal 3

Rule: adding and concat
Background: concat
When I concat word Hello and text " World!"

Scenario: the background steps should be executed
Then the result should equal 3
Then the result should equal text "Hello World!"
1 change: 1 addition & 0 deletions features/example.feature
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ Feature: math operations
Scenario: add two digits
When I add 1 and 2
Then the result should equal 3

6 changes: 6 additions & 0 deletions features/example_rule.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Feature: math operations
Rule: add things
Scenario: add two digits
When I add 1 and 2
Then the result should equal 3

9 changes: 9 additions & 0 deletions features/ignored_rule_tags.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

Feature: ignored tags
@ignore
Rule: this rule should be ignored
Scenario: the scenario should be ignored
Then fail the test
Rule: this rule should run
Scenario: the scenario should pass
Then the test should pass
2 changes: 2 additions & 0 deletions features/ignored_tags.feature
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ Feature: ignored tags
@ignore
Scenario: the scenario should be ignored
Then fail the test
Scenario: the scenario should pass
Then the test should pass
13 changes: 12 additions & 1 deletion features/tags.feature
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,15 @@ Feature: ignored tags
Then the test should pass
Examples:
Scenario: the test should never be executed
Then fail the test
Then fail the test

Rule: the rule should never be executed
Scenario: the test in ignored rule should never be executed
Then fail the test

Rule: this rule should run
@tag
Scenario: the test in executed rule should pass
Then the test should pass
Scenario: the test in executed rule should never be executed
Then fail the test
13 changes: 10 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,17 @@ go 1.17

require (
github.com/cucumber/gherkin/go/v28 v28.0.0
github.com/cucumber/messages/go/v24 v24.0.1
github.com/go-bdd/assert v0.0.0-20190820124234-20d47a68475d
github.com/cucumber/messages/go/v24 v24.1.0
github.com/go-bdd/assert v0.0.0-20200713105154-236f01430281
github.com/stretchr/testify v1.9.0
)

require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/gofrs/uuid v4.4.0+incompatible // indirect
github.com/kr/text v0.2.0 // indirect
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect
github.com/stretchr/testify v1.8.4
github.com/pmezard/go-difflib v1.0.0 // indirect
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading

0 comments on commit e64734b

Please sign in to comment.