דלג לתוכן הראשי

ציון להרצת בדיקה

שלבscorecontrol

בודק מה הרצת בדיקה הפיקה מול מה שמקרה הבדיקה מצפה לו, ונותן לכל בדיקה עבר או נכשל עם הסיבה.

במבט אחד​

מאפייןערך
שם השלבscore
משאבClusterStep (lumen.ai/v1alpha1)
קבוצה וקטגוריהcontrol, logic
קרדיטים0 קרדיטים בכל פעם שהוא מצליח
השפעה חיצוניתלא
ההתקנה צריכה לספקכלום

קלט​

מאפייןערך
צריךכלום
מפיקfields
עובד עלitem מסמך אחד בכל פעם

״צריך״ ו״מפיק״ הם סוגי נתונים (file, text, fields, email). העורך מציע שלב רק במקום שבו מה שהוא צריך כבר נמצא במסלול. ראו מסמכים ונתונים.

פלט​

צומת מאוחר יותר מפנה לפלט כ-{nodeId.field} בטקסט, או כ-nodeId.field בתנאי.

פלטסוג
passedboolean
scorenumber
checksarray
failednumber

הגדרות​

מגדירים תחת config: בצומת של התהליך. הגדרות טקסט יכולות להכיל מצייני מקום כמו {nodeId.field}.

הגדרהסוגברירת מחדלתיאור
checksחובהlist of object-ChecksminItems 1; maxItems 50
checks[].nameחובהstring-Name is the metric, as results show it.minLength 1; maxLength 63
checks[].actualחובהstring-Actual is the field checked, as a condition names it: <node>.<field>, walking into a JSON answer (extract.reply.source). It is read from that node's own output.minLength 1; maxLength 200
checks[].opחובהstring-Op is how: equals, contains, matches (a regular expression), json (the expected JSON is part of the value), changes (a change list against the expected list), count (a list's length or a number), exists.one of equals, contains, matches, json, changes, count, exists
checks[].expectedstring-Expected is the value to check against, written here.maxLength 4000
checks[].expectedColumnstring-ExpectedColumn takes the expected value from the test case's column instead (run.case.<column>).maxLength 63
checks[].modestring"equal"Mode is a changes check's: equal (exactly these changes, a change not expected is a wrong write and fails) or include (at least these).one of equal, include
minScorenumber-MinScore is the share of checks that must pass for the run to pass, from 0 to 1. Unset is 1: every check.minimum 0; maximum 1

ה-JSON Schema המלא של ההגדרות: score.schema.json.

דוגמה​

config
checks:
- actual: read.total
expected: "1170"
name: total
op: equals

שימוש בתהליך​

צומת שמריץ את score נכנס תחת spec.nodes של Flow. תנו לו כל מזהה, ורשמו ב-next את מזהי הצמתים הבאים.

flow.yaml
apiVersion: lumen.ai/v1alpha1
kind: Flow
metadata:
name: score-example
namespace: tenant-acme
spec:
displayName: "Score a test run"
triggers:
- id: start
ref: {name: manual-run}
next: [score]
nodes:
- id: score
stepRef: {name: score}
config:
checks:
- actual: read.total
expected: "1170"
name: total
op: equals