-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: smart analysis extension (#202)
* chore: removed dependency on semver * feat: smart analysis extension * feat: added beats config in cli
- Loading branch information
1 parent
d65da76
commit 1d05f47
Showing
19 changed files
with
419 additions
and
144 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,18 @@ | ||
export type IBeatExecutionMetric = { | ||
id: string | ||
created_at: string | ||
updated_at: string | ||
newly_failed: number | ||
always_failing: number | ||
recovered: number | ||
added: number | ||
removed: number | ||
flaky: number | ||
failure_summary: any | ||
failure_summary_provider: any | ||
failure_summary_model: any | ||
status: string | ||
status_message: any | ||
test_run_id: string | ||
org_id: string | ||
} |
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,43 @@ | ||
const { BaseExtension } = require('./base.extension'); | ||
const { STATUS, HOOK } = require("../helpers/constants"); | ||
|
||
|
||
class AIFailureSummaryExtension extends BaseExtension { | ||
|
||
constructor(target, extension, result, payload, root_payload) { | ||
super(target, extension, result, payload, root_payload); | ||
this.#setDefaultOptions(); | ||
this.#setDefaultInputs(); | ||
this.updateExtensionInputs(); | ||
} | ||
|
||
run() { | ||
this.#setText(); | ||
this.attach(); | ||
} | ||
|
||
#setDefaultOptions() { | ||
this.default_options.hook = HOOK.AFTER_SUMMARY, | ||
this.default_options.condition = STATUS.PASS_OR_FAIL; | ||
} | ||
|
||
#setDefaultInputs() { | ||
this.default_inputs.title = 'AI Failure Summary ✨'; | ||
this.default_inputs.title_link = ''; | ||
} | ||
|
||
#setText() { | ||
const data = this.extension.inputs.data; | ||
if (!data) { | ||
return; | ||
} | ||
|
||
/** | ||
* @type {import('../beats/beats.types').IBeatExecutionMetric} | ||
*/ | ||
const execution_metrics = data.execution_metrics[0]; | ||
this.text = execution_metrics.failure_summary; | ||
} | ||
} | ||
|
||
module.exports = { AIFailureSummaryExtension } |
Oops, something went wrong.