MCPcopy
hub / github.com/grafana/tempo / TestStatus

Function TestStatus

modules/backendscheduler/work/job_test.go:13–36  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

11var tenant = "test"
12
13func TestStatus(t *testing.T) {
14 j := &Job{
15 ID: uuid.NewString(),
16 }
17
18 require.Equal(t, j.GetID(), j.ID)
19
20 require.False(t, j.IsFailed())
21 require.False(t, j.IsComplete())
22 require.False(t, j.IsRunning())
23 require.True(t, j.IsPending())
24 j.Start()
25 require.True(t, j.IsRunning())
26
27 j.Start()
28 require.False(t, j.IsFailed())
29
30 j.Fail()
31 require.True(t, j.IsFailed())
32
33 j.Complete()
34 require.False(t, j.IsFailed())
35 require.True(t, j.IsComplete())
36}
37
38func TestGetRedactionBlockID(t *testing.T) {
39 cases := []struct {

Callers

nothing calls this directly

Calls 9

GetIDMethod · 0.95
IsFailedMethod · 0.95
IsCompleteMethod · 0.95
IsRunningMethod · 0.95
IsPendingMethod · 0.95
StartMethod · 0.95
FailMethod · 0.95
CompleteMethod · 0.95
EqualMethod · 0.45

Tested by

no test coverage detected