-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add transaction and span outcome gherkin feature file (#402)
* Add transaction and span outcome gherkin feature file * update gherkin & written spec * fix wording * clarify span spec * update gRPC statuses mapping for transactions * add examples of non-determistic outcomes * fix wording Co-authored-by: eyalkoren <41850454+eyalkoren@users.noreply.github.com> * sync executable spec with spec for humans * fix wording Co-authored-by: Emily S <emily.s@elastic.co> Co-authored-by: Sylvain Juge <sylvain.juge@elastic.co> Co-authored-by: SylvainJuge <syl20j@gmail.com> Co-authored-by: eyalkoren <41850454+eyalkoren@users.noreply.github.com>
- Loading branch information
1 parent
18f499c
commit 3898c7f
Showing
5 changed files
with
202 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
Feature: Outcome | ||
|
||
# ---- user set outcome | ||
|
||
Scenario: User set outcome on span has priority over instrumentation | ||
Given an agent | ||
And an active span | ||
And user sets span outcome to 'failure' | ||
And span terminates with outcome 'success' | ||
Then span outcome is 'failure' | ||
|
||
Scenario: User set outcome on transaction has priority over instrumentation | ||
Given an agent | ||
And an active transaction | ||
And user sets transaction outcome to 'unknown' | ||
And transaction terminates with outcome 'failure' | ||
Then transaction outcome is 'unknown' | ||
|
||
# ---- span & transaction outcome from reported errors | ||
|
||
Scenario: span with error | ||
Given an agent | ||
And an active span | ||
And span terminates with an error | ||
Then span outcome is 'failure' | ||
|
||
Scenario: span without error | ||
Given an agent | ||
And an active span | ||
And span terminates without error | ||
Then span outcome is 'success' | ||
|
||
Scenario: transaction with error | ||
Given an agent | ||
And an active transaction | ||
And transaction terminates with an error | ||
Then transaction outcome is 'failure' | ||
|
||
Scenario: transaction without error | ||
Given an agent | ||
And an active transaction | ||
And transaction terminates without error | ||
Then transaction outcome is 'success' | ||
|
||
# ---- HTTP | ||
|
||
@http | ||
Scenario Outline: HTTP transaction and span outcome | ||
Given an agent | ||
And an HTTP transaction with <status> response code | ||
Then transaction outcome is "<server>" | ||
Given an HTTP span with <status> response code | ||
Then span outcome is "<client>" | ||
Examples: | ||
| status | client | server | | ||
| 100 | success | success | | ||
| 200 | success | success | | ||
| 300 | success | success | | ||
| 400 | failure | success | | ||
| 404 | failure | success | | ||
| 500 | failure | failure | | ||
| -1 | failure | failure | | ||
# last row with negative status represents the case where the status is not available | ||
# for example when an exception/error is thrown without status (IO error, redirect loop, ...) | ||
|
||
# ---- gRPC | ||
|
||
# reference spec : https://github.com/grpc/grpc/blob/master/doc/statuscodes.md | ||
|
||
@grpc | ||
Scenario Outline: gRPC transaction and span outcome | ||
Given an agent | ||
And a gRPC transaction with '<status>' status | ||
Then transaction outcome is "<server>" | ||
Given a gRPC span with '<status>' status | ||
Then span outcome is "<client>" | ||
Examples: | ||
| status | client | server | | ||
| OK | success | success | | ||
| CANCELLED | failure | success | | ||
| UNKNOWN | failure | failure | | ||
| INVALID_ARGUMENT | failure | success | | ||
| DEADLINE_EXCEEDED | failure | failure | | ||
| NOT_FOUND | failure | success | | ||
| ALREADY_EXISTS | failure | success | | ||
| PERMISSION_DENIED | failure | success | | ||
| RESOURCE_EXHAUSTED | failure | failure | | ||
| FAILED_PRECONDITION | failure | failure | | ||
| ABORTED | failure | failure | | ||
| OUT_OF_RANGE | failure | success | | ||
| UNIMPLEMENTED | failure | success | | ||
| INTERNAL | failure | failure | | ||
| UNAVAILABLE | failure | failure | | ||
| DATA_LOSS | failure | failure | | ||
| UNAUTHENTICATED | failure | success | | ||
| n/a | failure | failure | | ||
# last row with 'n/a' status represents the case where status is not available |