Merge pull request #1327 from trheyi/main
Refactor test files for improved readability and consistency
This commit is contained in:
commit
85ed9b9a26
2 changed files with 18 additions and 18 deletions
|
|
@ -18,17 +18,17 @@ func TestConcurrentNodeOperations(t *testing.T) {
|
||||||
t.Run(d.Name, func(t *testing.T) {
|
t.Run(d.Name, func(t *testing.T) {
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
|
|
||||||
traceID, manager, err := trace.New(ctx, d.DriverType, nil, d.DriverOptions...)
|
traceID, manager, err := trace.New(ctx, d.DriverType, nil, d.DriverOptions...)
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
defer trace.Release(traceID)
|
defer trace.Release(traceID)
|
||||||
defer trace.Remove(ctx, d.DriverType, traceID, d.DriverOptions...)
|
defer trace.Remove(ctx, d.DriverType, traceID, d.DriverOptions...)
|
||||||
|
|
||||||
// Add first node as root
|
// Add first node as root
|
||||||
_, err = manager.Add("root", types.TraceNodeOption{Label: "Root"})
|
_, err = manager.Add("root", types.TraceNodeOption{Label: "Root"})
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
|
|
||||||
// Create parallel nodes
|
// Create parallel nodes
|
||||||
nodes, err := manager.Parallel([]types.TraceParallelInput{
|
nodes, err := manager.Parallel([]types.TraceParallelInput{
|
||||||
{Input: "task 1", Option: types.TraceNodeOption{Label: "Worker 1"}},
|
{Input: "task 1", Option: types.TraceNodeOption{Label: "Worker 1"}},
|
||||||
{Input: "task 2", Option: types.TraceNodeOption{Label: "Worker 2"}},
|
{Input: "task 2", Option: types.TraceNodeOption{Label: "Worker 2"}},
|
||||||
{Input: "task 3", Option: types.TraceNodeOption{Label: "Worker 3"}},
|
{Input: "task 3", Option: types.TraceNodeOption{Label: "Worker 3"}},
|
||||||
|
|
|
||||||
|
|
@ -73,17 +73,17 @@ func TestParallelOperations(t *testing.T) {
|
||||||
t.Run(d.Name, func(t *testing.T) {
|
t.Run(d.Name, func(t *testing.T) {
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
|
|
||||||
traceID, manager, err := trace.New(ctx, d.DriverType, nil, d.DriverOptions...)
|
traceID, manager, err := trace.New(ctx, d.DriverType, nil, d.DriverOptions...)
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
defer trace.Release(traceID)
|
defer trace.Release(traceID)
|
||||||
defer trace.Remove(ctx, d.DriverType, traceID, d.DriverOptions...)
|
defer trace.Remove(ctx, d.DriverType, traceID, d.DriverOptions...)
|
||||||
|
|
||||||
// Add first node as root
|
// Add first node as root
|
||||||
_, err = manager.Add("root", types.TraceNodeOption{Label: "Root"})
|
_, err = manager.Add("root", types.TraceNodeOption{Label: "Root"})
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
|
|
||||||
// Create parallel nodes
|
// Create parallel nodes
|
||||||
nodes, err := manager.Parallel([]types.TraceParallelInput{
|
nodes, err := manager.Parallel([]types.TraceParallelInput{
|
||||||
{
|
{
|
||||||
Input: "task A",
|
Input: "task A",
|
||||||
Option: types.TraceNodeOption{Label: "Worker A", Icon: "cpu"},
|
Option: types.TraceNodeOption{Label: "Worker A", Icon: "cpu"},
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue