Skip to content

Commit d2956f7

Browse files
committed
chore: Expanding lll coverage to queue
1 parent d27064f commit d2956f7

3 files changed

Lines changed: 13 additions & 7 deletions

File tree

.golangci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ linters:
114114
# trying to get this merged in.
115115
- linters:
116116
- lll
117-
path-except: '^(internal/awshelper/|internal/cas/|internal/cli/commands/(backend/(delete|migrate)|catalog/tui/command|exec|find|help|list|stack)/|internal/cloner/|internal/configbridge/|internal/engine/|internal/errorconfig/|internal/errors/|internal/experiment/|internal/gcphelper/|internal/git/|internal/os/exec/|internal/prepare/|internal/runner/(common|graph|run/creds)/|internal/stacks/(generate|output)/|internal/tf/cache/(controllers|middleware)/|internal/tflint/|internal/tips/|internal/vfs/|internal/worktrees/|pkg/log/(format/placeholders|writer)/)'
117+
path-except: '^(internal/awshelper/|internal/cas/|internal/cli/commands/(backend/(delete|migrate)|catalog/tui/command|exec|find|help|list|stack)/|internal/cloner/|internal/configbridge/|internal/engine/|internal/errorconfig/|internal/errors/|internal/experiment/|internal/gcphelper/|internal/git/|internal/os/exec/|internal/prepare/|internal/queue/|internal/runner/(common|graph|run/creds)/|internal/stacks/(generate|output)/|internal/tf/cache/(controllers|middleware)/|internal/tflint/|internal/tips/|internal/vfs/|internal/worktrees/|pkg/log/(format/placeholders|writer)/)'
118118
paths:
119119
- docs
120120
- _ci

internal/queue/queue.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,10 @@ type Entry struct {
3939
// including its path, dependencies, and discovery context (such as the command being run).
4040
Component component.Component
4141

42-
// Status represents the current lifecycle state of this entry in the queue. It tracks whether the entry is pending,
43-
// blocked, ready, running, succeeded, or failed. Status is updated as dependencies are resolved and as execution progresses.
42+
// Status represents the current lifecycle state of this entry in the
43+
// queue. It tracks whether the entry is pending, blocked, ready,
44+
// running, succeeded, or failed. Status is updated as dependencies
45+
// are resolved and as execution progresses.
4446
Status Status
4547
}
4648

@@ -294,7 +296,8 @@ func NewQueue(discovered component.Components) (*Queue, error) {
294296
return q, errors.New("cycle detected during queue construction")
295297
}
296298

297-
// GetReadyWithDependencies returns all entries that are ready to run and have all dependencies completed (or no dependencies).
299+
// GetReadyWithDependencies returns all entries that are ready to run and
300+
// have all dependencies completed (or no dependencies).
298301
func (q *Queue) GetReadyWithDependencies(l log.Logger) []*Entry {
299302
q.mu.RLock()
300303
defer q.mu.RUnlock()

internal/queue/queue_test.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,8 @@ func TestQueue_LinearDependencyExecution(t *testing.T) {
272272
// Check that all entries are ready initially and in order A, B, C
273273
readyEntries := q.GetReadyWithDependencies(logger.CreateLogger())
274274
assert.Len(t, readyEntries, 1, "Initially only A should be ready")
275-
assert.Equal(t, queue.StatusReady, readyEntries[0].Status, "Entry %s should have StatusReady", readyEntries[0].Component.Path())
275+
assert.Equal(t, queue.StatusReady, readyEntries[0].Status,
276+
"Entry %s should have StatusReady", readyEntries[0].Component.Path())
276277
assert.Equal(t, "A", readyEntries[0].Component.Path(), "First ready entry should be A")
277278

278279
// Mark A as running and complete it
@@ -325,7 +326,8 @@ func TestQueue_ParallelExecution(t *testing.T) {
325326
// 1. Initially, only A should be ready
326327
readyEntries := q.GetReadyWithDependencies(logger.CreateLogger())
327328
assert.Len(t, readyEntries, 1, "Initially only A should be ready")
328-
assert.Equal(t, queue.StatusReady, readyEntries[0].Status, "Entry %s should have StatusReady", readyEntries[0].Component.Path())
329+
assert.Equal(t, queue.StatusReady, readyEntries[0].Status,
330+
"Entry %s should have StatusReady", readyEntries[0].Component.Path())
329331
assert.Equal(t, "A", readyEntries[0].Component.Path(), "First ready entry should be A")
330332

331333
// Mark A as running and complete it
@@ -418,7 +420,8 @@ func TestQueue_FailFast(t *testing.T) {
418420

419421
// All entries should be listed as terminal (A: Failed, B/C: EarlyExit)
420422
for _, entry := range q.Entries {
421-
assert.True(t, entry.Status == queue.StatusFailed || entry.Status == queue.StatusEarlyExit, "Entry %s should be terminal", entry.Component.Path())
423+
assert.True(t, entry.Status == queue.StatusFailed || entry.Status == queue.StatusEarlyExit,
424+
"Entry %s should be terminal", entry.Component.Path())
422425
}
423426

424427
// Now all should be terminal

0 commit comments

Comments
 (0)