ציון להרצת בדיקה
שלב
scorecontrolבודק מה הרצת בדיקה הפיקה מול מה שמקרה הבדיקה מצפה לו, ונותן לכל בדיקה עבר או נכשל עם הסיבה.
במבט אחד
| מאפיין | ערך |
|---|---|
| שם השלב | score |
| משאב | ClusterStep (lumen.ai/v1alpha1) |
| קבוצה וקטגוריה | control, logic |
| קרדיטים | 0 קרדיטים בכל פעם שהוא מצליח |
| השפעה חיצונית | לא |
| ההתקנה צריכה לספק | כלום |
קלט
| מאפיין | ערך |
|---|---|
| צריך | כלום |
| מפיק | fields |
| עובד על | item מסמך אחד בכל פעם |
״צריך״ ו״מפיק״ הם סוגי נתונים (file, text, fields, email). העורך מציע שלב רק במקום שבו מה שהוא צריך כבר נמצא במסלול. ראו מסמכים ונתונים.
פלט
צומת מאוחר יותר מפנה לפלט כ-{nodeId.field} בטקסט, או כ-nodeId.field בתנאי.
| פלט | סוג |
|---|---|
passed | boolean |
score | number |
checks | array |
failed | number |
הגדרות
מגדירים תחת 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[].expected | string | - | Expected is the value to check against, written here.maxLength 4000 |
checks[].expectedColumn | string | - | ExpectedColumn takes the expected value from the test case's column instead (run.case.<column>).maxLength 63 |
checks[].mode | string | "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 |
minScore | number | - | 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
הדף עזר לכם?