Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 30, 2026

The runtime-imports macro supports recursive file imports but lacked systematic test coverage for arbitrary dependency graphs. This adds 69 test cases validating complex import patterns.

Test Coverage Added

Graph Topologies (23 tests)

  • Trees: balanced binary, wide fan-out (1→10), deep chains (15 levels), unbalanced
  • DAGs: diamond patterns, convergent graphs, multi-level dependencies
  • Stars: hub-and-spoke, reverse convergence
  • Complex: grids, pyramids, layered architectures

Edge Cases & Performance (10 tests)

  • Circular dependency detection in complex graphs (length 1-10 cycles)
  • Import caching efficiency (validates 19 cache hits on 20 imports)
  • Large graphs (50+ files, 5 levels × 4 branches)
  • Line range imports with independent caching
  • Mixed optional/required imports

Example Test Pattern

// Diamond dependency with caching validation
it("should handle diamond dependency pattern", async () => {
  // Root → [A, B], A → Shared, B → Shared
  fs.writeFileSync(path.join(githubDir, "shared.md"), "Shared content");
  fs.writeFileSync(path.join(githubDir, "path-a.md"), "Path A\n{{#runtime-import shared.md}}");
  fs.writeFileSync(path.join(githubDir, "path-b.md"), "Path B\n{{#runtime-import shared.md}}");
  
  const result = await processRuntimeImports("{{#runtime-import root.md}}", tempDir);
  
  expect(result).toBe("Root\nPath A\nShared content\n---\nPath B\nShared content");
  expect(core.info).toHaveBeenCalledWith("Reusing cached content for shared.md");
});

All 142 tests in runtime_import.test.cjs pass in <100ms.

Original prompt

Add extensive test suite for agentic workflow with runtime-imports macro that recursively import each other. Generate arbitrary graphs of imported files.


💡 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.

… graph patterns

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add test suite for agentic workflow with runtime-imports macro Add comprehensive test coverage for recursive runtime-import graphs Jan 30, 2026
Copilot AI requested a review from pelikhan January 30, 2026 14:53
@pelikhan pelikhan marked this pull request as ready for review January 30, 2026 14:54
@pelikhan pelikhan merged commit f0901b8 into main Jan 30, 2026
@pelikhan pelikhan deleted the copilot/add-agentic-workflow-tests branch January 30, 2026 15:37
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.

2 participants