Improve test coverage and fix map enumeration bug in DAG task filters#5
Merged
badubizzle merged 3 commits intomasterfrom Mar 4, 2026
Merged
Improve test coverage and fix map enumeration bug in DAG task filters#5badubizzle merged 3 commits intomasterfrom
badubizzle merged 3 commits intomasterfrom
Conversation
…Run modules Co-authored-by: badubizzle <1519511+badubizzle@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update test coverage for existing features
Improve test coverage and fix map enumeration bug in DAG task filters
Mar 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Test coverage was minimal, leaving core DAG, task, run, and store logic largely untested. Three functions also had a silent runtime bug due to incorrect map enumeration.
Bug Fix
get_completed_tasks/1,get_pending_tasks/1, andget_running_tasks/1iterated overdag.tasks(amap) but passed the resulting{key, value}tuples directly toDAGTask.is_completed/1etc., which pattern-match on%DAGTask{}— causingFunctionClauseErroron any non-empty call.New Test Files
test/dag_task_test.exs—DAGTask.new/1,validate/1,is_pending/1,is_completed/1,is_running/1, status helpers,set_handler/2test/dag_run_test.exs—DAGRun.new/1,generate_id/0,random_string/1, uniqueness guarantees, timestamp fieldstest/dag_task_run_test.exs—DAGTaskRun.new/3, field initialization, payload storage, timestampsExpanded Coverage in
ex_dag_test.exsAdditional
ExDag.DAGcases covering:get_tasks/1,set_handler/2,set_default_task_handler/2,set_tasks_handler/2,validate_for_run/1(disconnected graph),get_deps/2,get_deps_map/1,get_runs/2, status accessors,completed?/1,get_completed_tasks/1,get_pending_tasks/1,get_running_tasks/1,sorted_tasks/1,should_run_task/2,clear_failed_tasks_runs/1,String.Charsimpl, keyword-basedadd_task, andadd_task!/2throw behavior.💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.