-
Notifications
You must be signed in to change notification settings - Fork 15
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
Update undesirable behavior impact collection details #939
Changes from 5 commits
f1611f5
51fda5e
c120503
38728d6
cde9ced
ddba40f
f68ab93
cd25da1
d29bbc9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,10 +33,10 @@ const TestPlanResultsTable = ({ | |
const failedAssertions = scenarioResult.assertionResults.filter( | ||
assertionResult => !assertionResult.passed | ||
); | ||
const hasNoHighUnexpectedBehavior = | ||
const hasNoSevereUnexpectedBehavior = | ||
!scenarioResult.unexpectedBehaviors.some( | ||
unexpectedBehavior => | ||
unexpectedBehavior.impact === 'HIGH' | ||
unexpectedBehavior.impact === 'SEVERE' | ||
); | ||
const hasNoModerateUnexpectedBehavior = | ||
!scenarioResult.unexpectedBehaviors.some( | ||
|
@@ -45,11 +45,11 @@ const TestPlanResultsTable = ({ | |
); | ||
const passedAssertionsLength = | ||
passedAssertions.length + | ||
(hasNoHighUnexpectedBehavior ? 1 : 0) + | ||
(hasNoSevereUnexpectedBehavior ? 1 : 0) + | ||
(hasNoModerateUnexpectedBehavior ? 1 : 0); | ||
const failedAssertionsLength = | ||
failedAssertions.length + | ||
(hasNoHighUnexpectedBehavior ? 0 : 1) + | ||
(hasNoSevereUnexpectedBehavior ? 0 : 1) + | ||
(hasNoModerateUnexpectedBehavior ? 0 : 1); | ||
|
||
// Rows are sorted by priority descending, then result (failures then passes), then | ||
|
@@ -89,9 +89,9 @@ const TestPlanResultsTable = ({ | |
{ | ||
id: `UnexpectedBehavior_MUST_${nextId()}`, | ||
assertion: { | ||
text: 'Other behaviors that create high negative-impacts are not exhibited' | ||
text: 'Other behaviors that create severe negative-impacts are not exhibited' | ||
}, | ||
passed: hasNoHighUnexpectedBehavior, | ||
passed: hasNoSevereUnexpectedBehavior, | ||
priorityString: 'MUST' | ||
}, | ||
...optionalAssertionResults.map(e => ({ | ||
|
@@ -148,23 +148,33 @@ const TestPlanResultsTable = ({ | |
)} | ||
</tbody> | ||
</Table> | ||
Unexpected Behaviors:{' '} | ||
Other behaviors that create negative impact:{' '} | ||
{scenarioResult.unexpectedBehaviors.length ? ( | ||
<ul> | ||
{scenarioResult.unexpectedBehaviors.map( | ||
({ id, text, impact, details }) => { | ||
const description = `${text} (Details: ${details}, Impact: ${impact})`; | ||
return ( | ||
<li | ||
key={id} | ||
className="test-plan-results-li" | ||
> | ||
{description} | ||
</li> | ||
); | ||
} | ||
)} | ||
</ul> | ||
<Table | ||
bordered | ||
responsive | ||
aria-label={`Undesirable behaviors for test ${test.title}`} | ||
className={`test-plan-undesirable-behaviors-table ${tableClassName}`} | ||
> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For consistency, where possible can we call these unexpected behaviors? |
||
<thead> | ||
<tr> | ||
<th>Behavior</th> | ||
<th>Details</th> | ||
<th>Impact</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{scenarioResult.unexpectedBehaviors.map( | ||
({ id, text, details, impact }) => ( | ||
<tr key={id}> | ||
<td>{text}</td> | ||
<td>{details}</td> | ||
<td>{impact}</td> | ||
</tr> | ||
) | ||
)} | ||
</tbody> | ||
</Table> | ||
) : ( | ||
'None' | ||
)} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -774,7 +774,7 @@ const graphqlSchema = gql` | |
|
||
enum UnexpectedBehaviorImpact { | ||
MODERATE | ||
HIGH | ||
SEVERE | ||
} | ||
|
||
""" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -169,21 +169,21 @@ const getMetrics = ({ | |
const result = { scenarioResult, testResult, testPlanReport }; | ||
|
||
// Each command has 2 additional assertions: | ||
// * Other behaviors that create high negative impact | ||
// * Other behaviors that create severe negative impact | ||
// * Other behaviors that create moderate negative impact | ||
const commandsCount = countCommands({ ...result }); | ||
|
||
const highImpactFailedAssertionCount = countUnexpectedBehaviorsImpact( | ||
const severeImpactFailedAssertionCount = countUnexpectedBehaviorsImpact( | ||
{ ...result }, | ||
'HIGH' | ||
'SEVERE' | ||
); | ||
const moderateImpactFailedAssertionCount = countUnexpectedBehaviorsImpact( | ||
{ ...result }, | ||
'MODERATE' | ||
); | ||
|
||
const highImpactPassedAssertionCount = | ||
commandsCount - highImpactFailedAssertionCount; | ||
const severeImpactPassedAssertionCount = | ||
commandsCount - severeImpactFailedAssertionCount; | ||
const moderateImpactPassedAssertionCount = | ||
commandsCount - moderateImpactFailedAssertionCount; | ||
|
||
|
@@ -193,8 +193,8 @@ const getMetrics = ({ | |
assertionsFailedCount: requiredAssertionsFailedCount | ||
} = calculateAssertionPriorityCounts(result, 'REQUIRED'); | ||
requiredAssertionsCount += commandsCount; | ||
requiredAssertionsPassedCount += highImpactPassedAssertionCount; | ||
requiredAssertionsFailedCount += highImpactFailedAssertionCount; | ||
requiredAssertionsPassedCount += severeImpactPassedAssertionCount; | ||
requiredAssertionsFailedCount += severeImpactFailedAssertionCount; | ||
|
||
let { | ||
assertionsCount: optionalAssertionsCount, | ||
|
@@ -262,8 +262,8 @@ const getMetrics = ({ | |
testsCount, | ||
testsFailedCount, | ||
unexpectedBehaviorCount, | ||
highImpactPassedAssertionCount, | ||
highImpactFailedAssertionCount, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The name There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this comment may have been before the latest changes from main were merged in here, so this may be outdated? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You're right! |
||
severeImpactPassedAssertionCount, | ||
severeImpactFailedAssertionCount, | ||
moderateImpactPassedAssertionCount, | ||
moderateImpactFailedAssertionCount, | ||
commandsCount, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since metrics are saved in the database does that mean we should have a migration to make sure the metrics are up-to-date? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since this hasn't yet gone to the production environment yet to affect that database, no need to write that migration. There wouldn't be any metrics that include those properties just yet. |
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The hyphen here isn't grammatically correct, it should be
'Other behaviors that create severe negative impacts are not exhibited'
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, although unsure if it was intentional. This could also be shortened in the future soon to:
If you'd like to weigh in on that discussion.