Skip to content

test: integration tests - #495

Merged
thalesraymond merged 3 commits into
mainfrom
test/integration-tests
Jul 29, 2026
Merged

test: integration tests#495
thalesraymond merged 3 commits into
mainfrom
test/integration-tests

Conversation

@github-actions

@github-actions github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

This pull request introduces a new, extensible execution strategy system for task execution, adds dry-run and retry support, and significantly improves test coverage for these new features. It also introduces a configurable TaskRunner API for orchestrating task graphs with pluggable strategies and options. Minor internal improvements and tests for edge cases in the executor are also included.

Execution Strategy System and Extensibility

  • Introduced the ExecutionStrategy interface and the StandardStrategy implementation, allowing flexible wrapping of task execution with behaviors such as retries or dry-run mode (execution_strategy.go).
  • Added DryRunStrategy which simulates task execution by returning success immediately, useful for validation or "what-if" runs (dryrun_strategy.go).
  • Added RetryStrategy and NewRetryStrategy, which retries failed executions with configurable attempts and backoff, respecting context cancellation (retry_strategy.go).

Task Runner API and Configuration

  • Introduced the TaskRunner type, a central orchestrator for executing task graphs with configurable concurrency, plugins, and pluggable execution strategies. Provided functional options for configuration and a method to set the execution strategy (task_runner.go).

Testing and Reliability

  • Added comprehensive tests for execution strategies, including standard, retry, and dry-run behaviors (execution_strategy_test.go, retry_strategy_test.go) [1] [2].
  • Added tests for edge cases in the workflow executor, such as handling already-completed tasks, error paths in task state transitions, and concurrency defaults (executor_internal_test.go).
  • Added basic tests for simpleTask to verify cancellation and success (main_test.go).

Internal Improvements

  • Updated handleResult in executor.go to ignore returned values from MarkDependencyFailed and MarkCompleted, clarifying intent and reducing unused variable warnings.

@thalesraymond thalesraymond self-assigned this Jul 29, 2026
@codecov

codecov Bot commented Jul 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@sonarqubecloud

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Jules Review

Jules returned an invalid response that could not be parsed. No valid code review comments are present.


Session: 1534809554080593455

@thalesraymond
thalesraymond merged commit 805be38 into main Jul 29, 2026
9 of 10 checks passed
@thalesraymond
thalesraymond deleted the test/integration-tests branch July 29, 2026 01:35

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Jules Review

This pull request successfully introduces a highly robust and extensible execution strategy system (featuring Standard, Dry-Run, and Retry strategies) along with a configurable TaskRunner API. The architectural design is clean, aligns perfectly with the project requirements, and is backed by exceptional test coverage (reaching 99.2% on internal/runner package), presenting zero blocking issues.


Session: 4853057594084152356


// Wait before retrying (with context support)
if attempt < s.maxRetries {
select {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Severity: ⚠️ Warning | Confidence: 🟢 High

Using time.After in a loop/select statement can lead to transient timer or memory leaks if the context is cancelled before the backoff timer fires. Instead, use time.NewTimer and ensure it is stopped correctly via defer timer.Stop().

🤖 Prompt for Agents

In go/internal/runner/retry_strategy.go at line 46, refactor the time.After call in the select block to use time.NewTimer(s.backoff) instead, and ensure to call timer.Stop() when exiting or on context cancellation to prevent timer resource leaks.

strategy ExecutionStrategy[T]
}

func (t *wrappedTask[T]) Run(ctx context.Context, sharedState T) TaskResult {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Severity: ⚠️ Warning | Confidence: 🟡 Medium

If TaskRunner is zero-initialized directly (e.g. tr := &runner.TaskRunner[struct{}]{}) rather than via NewTaskRunner, tr.strategy will be nil, causing a nil-pointer panic when executing tasks. Adding a fallback to StandardStrategy in wrappedTask.Run is highly recommended for zero-value safety.

🤖 Prompt for Agents

In go/internal/runner/task_runner.go at line 66, add a check inside wrappedTask.Run to fallback to direct execution (t.inner.Run) if t.strategy is nil to prevent panics during zero-value initialization of TaskRunner.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant