Skip to content

Commit 69a03e5

Browse files
authored
Clean up unused exports (#1101)
1 parent 2b331d3 commit 69a03e5

File tree

20 files changed

+2157
-942
lines changed

20 files changed

+2157
-942
lines changed

tests/.eslintrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"ignorePatterns": [
3+
"jest.config.ts"
4+
]
5+
}

tests/azure-hosted-copilot-sdk/util.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export async function setupCopilotSdkApp(workspace: string): Promise<void> {
3939

4040
// --- Invocation rate helpers ---
4141

42-
export function logRate(skillName: string, label: string, successCount: number, runsPerPrompt: number): number {
42+
function logRate(skillName: string, label: string, successCount: number, runsPerPrompt: number): number {
4343
const rate = successCount / runsPerPrompt;
4444
const msg = `${skillName} invocation rate for ${label}: ${(rate * 100).toFixed(1)}% (${successCount}/${runsPerPrompt})`;
4545
console.log(msg);
@@ -92,7 +92,7 @@ const TOKEN_PATTERNS = [
9292
* Redact token-like values from a string.
9393
* Returns the string with tokens replaced by `[REDACTED]`.
9494
*/
95-
export function redactTokens(text: string): string {
95+
function redactTokens(text: string): string {
9696
let result = text;
9797
for (const pattern of TOKEN_PATTERNS) {
9898
// Reset lastIndex for global regexes

tests/azure-messaging/integration.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ import {
1414
shouldSkipIntegrationTests,
1515
getIntegrationSkipReason
1616
} from "../utils/agent-runner";
17-
import { softCheckSkill } from "../utils/evaluate";
18-
import { isSkillInvoked } from "../utils/evaluate";
17+
import { softCheckSkill, isSkillInvoked } from "../utils/evaluate";
1918

2019
const SKILL_NAME = "azure-messaging";
2120
const RUNS_PER_PROMPT = 3;

tests/azure-prepare/integration.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ import {
1717
import { hasValidationCommand } from "../azure-validate/utils";
1818
import { hasPlanReadyForValidation, getDockerContext, hasServicesSection, getServiceProject } from "./utils";
1919
import { cloneRepo } from "../utils/git-clone";
20-
import { expectFiles, getToolCalls, softCheckSkill } from "../utils/evaluate";
21-
import { isSkillInvoked } from "../utils/evaluate";
20+
import { expectFiles, getToolCalls, softCheckSkill, isSkillInvoked } from "../utils/evaluate";
2221

2322
const SKILL_NAME = "azure-prepare";
2423
const RUNS_PER_PROMPT = 1;

tests/azure-rbac/integration.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ import {
1616
shouldSkipIntegrationTests,
1717
getIntegrationSkipReason
1818
} from "../utils/agent-runner";
19-
import { softCheckSkill } from "../utils/evaluate";
20-
import { isSkillInvoked } from "../utils/evaluate";
19+
import { softCheckSkill, isSkillInvoked } from "../utils/evaluate";
2120

2221
const SKILL_NAME = "azure-rbac";
2322
const RUNS_PER_PROMPT = 5;

tests/azure-resource-visualizer/integration.test.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ import {
1717
getIntegrationSkipReason
1818
} from "../utils/agent-runner";
1919
import type { AgentMetadata } from "../utils/agent-runner";
20-
import { softCheckSkill } from "../utils/evaluate";
21-
import { isSkillInvoked } from "../utils/evaluate";
22-
import { getToolCalls } from "../utils/evaluate";
20+
import { softCheckSkill, isSkillInvoked, getToolCalls } from "../utils/evaluate";
2321

2422
const SKILL_NAME = "azure-resource-visualizer";
2523
const RUNS_PER_PROMPT = 5;

tests/azure-validate/integration.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ import {
1919
matchesFileEdit,
2020
} from "./utils";
2121
import { cloneRepo } from "../utils/git-clone";
22-
import { matchesCommand, softCheckSkill } from "../utils/evaluate";
23-
import { isSkillInvoked } from "../utils/evaluate";
22+
import { matchesCommand, softCheckSkill, isSkillInvoked } from "../utils/evaluate";
2423

2524
const SKILL_NAME = "azure-validate";
2625
const RUNS_PER_PROMPT = 5;

tests/azure-validate/utils.ts

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -29,30 +29,10 @@ export function hasValidationCommand(metadata: AgentMetadata): boolean {
2929
});
3030
}
3131

32-
/**
33-
* Check whether any tool call's serialized arguments match the given
34-
* pattern. Searches across all tool types (powershell, create, edit, etc.)
35-
* unless a specific toolName is provided.
36-
*/
37-
export function matchesToolCallArgs(
38-
metadata: AgentMetadata,
39-
pattern: RegExp,
40-
toolName?: string,
41-
): boolean {
42-
return getToolCalls(metadata, toolName).some(event => {
43-
const argsStr = JSON.stringify(event.data);
44-
return pattern.test(argsStr);
45-
});
46-
}
47-
4832
/**
4933
* Check whether any file-mutating tool call (create or edit) targets a file
5034
* whose path matches {@link pathPattern} AND whose serialized arguments
5135
* match {@link contentPattern}.
52-
*
53-
* This is stricter than {@link matchesToolCallArgs} because it ensures the
54-
* content appeared in a write to a specific file, not just in any tool call
55-
* (e.g. a plan document).
5636
*/
5737
export function matchesFileEdit(
5838
metadata: AgentMetadata,

tests/eslint.config.mjs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { defineConfig } from "eslint/config";
33
import tseslint from "typescript-eslint";
44
import jest from "eslint-plugin-jest";
55
import integrationTestNameRule from "./eslint-rules/integration-test-name.mjs";
6+
import importPlugin from "eslint-plugin-import";
67

78
const tsFiles = ["**/*.ts"];
89
const jsFiles = ["**/*.js", "**/*.mjs"];
@@ -59,6 +60,8 @@ export default defineConfig(
5960
extends: [
6061
eslint.configs.recommended,
6162
...tseslint.configs.recommended,
63+
importPlugin.flatConfigs.recommended,
64+
importPlugin.flatConfigs.typescript
6265
],
6366
plugins: {
6467
jest,
@@ -81,7 +84,8 @@ export default defineConfig(
8184
"@typescript-eslint/no-require-imports": "error",
8285
// A significant number of integration tests generate reports for human review.
8386
// We don't have deterministic metrics for them yet.
84-
"jest/expect-expect": "off"
87+
"jest/expect-expect": "off",
88+
"import/no-unused-modules": [1, { "unusedExports": true }]
8589
},
8690
},
8791
// JavaScript files - no TypeScript project needed

tests/microsoft-foundry/foundry-agent/create/integration.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ import {
1515
shouldSkipIntegrationTests,
1616
getIntegrationSkipReason,
1717
} from "../../../utils/agent-runner";
18-
import { softCheckSkill } from "../../../utils/evaluate";
19-
import { getToolCalls } from "../../../utils/evaluate";
18+
import { softCheckSkill, getToolCalls } from "../../../utils/evaluate";
2019

2120
const SKILL_NAME = "microsoft-foundry";
2221
const RUNS_PER_PROMPT = 5;

0 commit comments

Comments
 (0)