-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathexecutioninfo.go
59 lines (49 loc) · 1.56 KB
/
executioninfo.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package schema
import (
"entgo.io/ent"
"entgo.io/ent/dialect/entsql"
"entgo.io/ent/schema/edge"
"entgo.io/ent/schema/field"
)
// ExectionInfo holds the schema definition for the ExectionInfo entity.
type ExectionInfo struct {
ent.Schema
}
// Fields of the ExectionInfo.
func (ExectionInfo) Fields() []ent.Field {
return []ent.Field{
// Deprecated, use TargetComplete.test_timeout instead.
field.Int32("timeout_seconds").Optional(),
// Name of the strategy to execute this test action (e.g., "local", "remote").
field.String("strategy").Optional(),
// True, if the reported attempt was a cache hit in a remote cache.
field.Bool("cached_remotely").Optional(),
// The exit code of the test action.
field.Int32("exit_code").Optional(),
// Hostname.
// The hostname of the machine where the test action was executed (in case
// of remote execution), if known.
field.String("hostname").Optional(),
}
}
// Edges of ExectionInfo.
func (ExectionInfo) Edges() []ent.Edge {
return []ent.Edge{
// Edge back to the test result
edge.From("test_result", TestResultBES.Type).
Ref("execution_info").
Unique(),
// Represents a hierarchical timing breakdown of an activity.
// The top level time should be the total time of the activity.
// Invariant: `time` >= sum of `time`s of all direct children.
edge.To("timing_breakdown", TimingBreakdown.Type).Unique().
Annotations(
entsql.OnDelete(entsql.Cascade),
),
// resource usage info
edge.To("resource_usage", ResourceUsage.Type).
Annotations(
entsql.OnDelete(entsql.Cascade),
),
}
}