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

feat: Test severity #978

Draft
wants to merge 12 commits into
base: master
Choose a base branch
from
Draft

feat: Test severity #978

wants to merge 12 commits into from

Conversation

adityathebe
Copy link
Member

Resolves: #370

@netlify
Copy link

netlify bot commented May 9, 2023

Deploy Preview for elaborate-horse-ac1743 ready!

Name Link
🔨 Latest commit 95510e1
🔍 Latest deploy log https://app.netlify.com/sites/elaborate-horse-ac1743/deploys/6463720996748d0008a5b534
😎 Deploy Preview https://deploy-preview-978--elaborate-horse-ac1743.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@adityathebe adityathebe force-pushed the test-threshold branch 2 times, most recently from 5a49443 to 09b9f45 Compare May 10, 2023 10:59
go.mod Outdated Show resolved Hide resolved
api/v1/common.go Outdated Show resolved Hide resolved
checks/runchecks.go Outdated Show resolved Hide resolved
pkg/api.go Outdated Show resolved Hide resolved
checks/runchecks.go Outdated Show resolved Hide resolved
pkg/api.go Outdated Show resolved Hide resolved
@adityathebe adityathebe force-pushed the test-threshold branch 2 times, most recently from 3d06d31 to d52a5ce Compare July 3, 2023 06:13
@@ -104,10 +105,14 @@ func processTemplates(ctx *context.Context, r *pkg.CheckResult) *pkg.CheckResult

switch v := r.Check.(type) {
case v1.TestFunction:
tpl := v.GetTestFunction()
data := map[string]any{"duration": r.Duration}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

duration should be appended into the default check results object e.g. for a junit it might be:

test:
   threshold:
       high: duration > 10000 || failed / passed > 0.1
       warning: duration >20000 || failed / passed > 0.02
       info: duration >20000 || failed / passed > 0.01

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

func processTemplates(ctx *context.Context, r *pkg.CheckResult) *pkg.CheckResult {
if r.Duration == 0 && r.GetDuration() > 0 {
r.Duration = r.GetDuration()
}

Duration is added to the check result object at the top of the func

@moshloop moshloop marked this pull request as draft March 12, 2024 06:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Test thresholds
2 participants