Repository navigation
Description
Original author: @github-actions[bot]
🤖 Test Improver — automated AI assistant for test improvements.
Goal and rationale
Three core modules in packages/shared had no tests despite containing meaningful logic:
DependencyGraph— cycle detection, topological sort, BFS ancestor/descendant traversal, and root-failure filtering are all complex enough to regress silentlynormalizeCriteria— v1/v2 format dispatch, whitespace trimming; straightforward but part of the evaluation pipelineFileSystemCriteriaProvider— YAML file loading, field validation,depends_on/dependsOnnormalisation, and transitive ancestor resolution via BFS
Approach
| File | Tests | Strategy |
|---|---|---|
graph/dependency-graph.test.ts |
35 | Pure unit; covers construction, cycles, topological sort, ancestor/descendant BFS, getRootFailures (both result formats), deprecated aliases |
criteria/normalize-criteria.test.ts |
6 | Pure unit; v1 string array, v2 passthrough, trimming, sequential IDs |
criteria/criteria-provider-fs.test.ts |
20 | Creates/destroys temp dirs per test; covers file loading, YAML variants (.yaml/.yml), snake/camelCase dependsOn, duplicate IDs, missing fields, resolveWithAncestors with diamond deduplication |
Coverage impact
| Metric | Before | After |
|---|---|---|
| Test files | 59 | 62 |
| Tests | 678 | 733 |
| New tests | — | +55 |
Test status
Test Files 62 passed (62)
Tests 733 passed (733)
(2 pre-existing process.exit errors in apps/version-checkers/ are unrelated to these changes.)
Reproducibility
export PATH="$HOME/bin:$PATH"
pnpm --filter shared --filter github-auth build
pnpm testTrade-offs
FileSystemCriteriaProvidertests usemkdtempSync+afterEachcleanup — reliable and fast- No mocking of
fsmodule; tests exercise real I/O with temp dirs for higher fidelity
Generated by Daily Test Improver · ◷
To install this agentic workflow, run
gh aw add githubnext/agentics/workflows/daily-test-improver.md@ee86d0ffcb1705d4ee4146e92125227bf9136aae
Warning
⚠️ Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
169.254.169.254
To allow these domains, add them to the network.allowed list in your workflow frontmatter:
network:
allowed:
- defaults
- "169.254.169.254"See Network Configuration for more information.
Note
This was originally intended as a pull request, but GitHub Actions is not permitted to create or approve pull requests in this repository.
The changes have been pushed to branch test-assist/criteria-and-graph-tests-3fe836ffe983e21a.
To fix the permissions issue, go to Settings → Actions → General and enable Allow GitHub Actions to create and approve pull requests.
Show patch preview (484 of 484 lines)
From 2f6558027358591f1393ae39c73be9bd9b5698c4 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]" <github-actions[bot]@users.noreply.github.com>
Date: Sat, 21 Mar 2026 06:30:35 +0000
Subject: [PATCH] test(shared): add unit tests for DependencyGraph,
normalizeCriteria, FileSystemCriteriaProvider
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- DependencyGraph (35 tests): construction, cycle detection (direct/indirect/self-loop),
topological sort, ancestor/descendant BFS, getRootFailures with both
criterionId/passed and featureId/detected formats, deprecated aliases
- normalizeCriteria (6 tests): v1 string→CriteriaConfig conversion, v2 passthrough,
whitespace trimming, sequential id generation
- FileSystemCriteriaProvider (20 tests): YAML loading (yaml/yml), depends_on/dependsOn
normalisation, duplicate id detection, missing field validation, resolveWithAncestors
with transitive parents and diamond deduplication
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---
.../src/criteria/criteria-provider-fs.test.ts | 170 +++++++++++++
.../src/criteria/normalize-criteria.test.ts | 41 ++++
.../shared/src/graph/dependency-graph.test.ts | 223 ++++++++++++++++++
3 files changed, 434 insertions(+)
create mode 100644 packages/shared/src/criteria/criteria-provider-fs.test.ts
create mode 100644 packages/shared/src/criteria/normalize-criteria.test.ts
create mode 100644 packages/shared/src/graph/dependency-graph.test.ts
diff --git a/packages/shared/src/criteria/criteria-provider-fs.test.ts b/packages/shared/src/criteria/criteria-provider-fs.test.ts
new file mode 100644
index 0000000..bf23191
--- /dev/null
+++ b/packages/shared/src/criteria/criteria-provider-fs.test.ts
@@ -0,0 +1,170 @@
+import { describe, it, expect, afterEach } from 'vitest';
+import { mkdtempSync, writeFileSync, mkdirSync, rmSync } from 'fs';
+import { join } from 'path';
+import { tmpdir } from 'os';
+import { FileSystemCriteria
... (truncated)
Activity
cedricvidal commentedon Jul 29, 2026
Original author: Cedric Vidal (@cedricvidal)
Closing as not planned — superseded / obsolete.
Superseded by: #367, #369
Why: 3rd of 5 identical bot Test-Improver requests; superseded
Evidence: #367, #369
Triaged during a stale-issue review. Please reopen if it's still relevant.