Add metadata suite and relax lefthook requirement (#43)
* [auth] Add metadata suite for running metadata discovery tests Adds a new 'metadata' suite that runs just the auth/metadata-* scenarios for faster iteration when testing metadata discovery specifically. Usage: node dist/index.mjs client --suite metadata --command "..." 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Don't require lefthook to be installed Set assert_lefthook_installed to false so the hooks gracefully skip if lefthook is not installed on the system. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
parent
f14895ca0e
commit
82d83f286b
4 changed files with 14 additions and 4 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
# lefthook.yml
|
# lefthook.yml
|
||||||
# Configuration reference: https://lefthook.dev/configuration/
|
# Configuration reference: https://lefthook.dev/configuration/
|
||||||
|
|
||||||
assert_lefthook_installed: true
|
assert_lefthook_installed: false
|
||||||
|
|
||||||
output:
|
output:
|
||||||
- meta # Print lefthook version
|
- meta # Print lefthook version
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,8 @@ import {
|
||||||
listScenarios,
|
listScenarios,
|
||||||
listClientScenarios,
|
listClientScenarios,
|
||||||
listActiveClientScenarios,
|
listActiveClientScenarios,
|
||||||
listAuthScenarios
|
listAuthScenarios,
|
||||||
|
listMetadataScenarios
|
||||||
} from './scenarios';
|
} from './scenarios';
|
||||||
import { ConformanceCheck } from './types';
|
import { ConformanceCheck } from './types';
|
||||||
import { ClientOptionsSchema, ServerOptionsSchema } from './schemas';
|
import { ClientOptionsSchema, ServerOptionsSchema } from './schemas';
|
||||||
|
|
@ -51,7 +52,8 @@ program
|
||||||
}
|
}
|
||||||
|
|
||||||
const suites: Record<string, () => string[]> = {
|
const suites: Record<string, () => string[]> = {
|
||||||
auth: listAuthScenarios
|
auth: listAuthScenarios,
|
||||||
|
metadata: listMetadataScenarios
|
||||||
};
|
};
|
||||||
|
|
||||||
const suiteName = options.suite.toLowerCase();
|
const suiteName = options.suite.toLowerCase();
|
||||||
|
|
@ -147,7 +149,7 @@ program
|
||||||
console.error('Either --scenario or --suite is required');
|
console.error('Either --scenario or --suite is required');
|
||||||
console.error('\nAvailable client scenarios:');
|
console.error('\nAvailable client scenarios:');
|
||||||
listScenarios().forEach((s) => console.error(` - ${s}`));
|
listScenarios().forEach((s) => console.error(` - ${s}`));
|
||||||
console.error('\nAvailable suites: auth');
|
console.error('\nAvailable suites: auth, metadata');
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -217,3 +217,8 @@ export const AuthMetadataVar3Scenario = createMetadataScenario(
|
||||||
|
|
||||||
// Export all scenarios as an array for convenience
|
// Export all scenarios as an array for convenience
|
||||||
export const metadataScenarios = SCENARIO_CONFIGS.map(createMetadataScenario);
|
export const metadataScenarios = SCENARIO_CONFIGS.map(createMetadataScenario);
|
||||||
|
|
||||||
|
// Export function to list metadata scenario names (for suite support)
|
||||||
|
export function listMetadataScenarios(): string[] {
|
||||||
|
return metadataScenarios.map((s) => s.name);
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -46,6 +46,7 @@ import {
|
||||||
} from './server/prompts.js';
|
} from './server/prompts.js';
|
||||||
|
|
||||||
import { authScenariosList } from './client/auth/index.js';
|
import { authScenariosList } from './client/auth/index.js';
|
||||||
|
import { listMetadataScenarios } from './client/auth/discovery-metadata.js';
|
||||||
|
|
||||||
// Pending client scenarios (not yet fully tested/implemented)
|
// Pending client scenarios (not yet fully tested/implemented)
|
||||||
const pendingClientScenariosList: ClientScenario[] = [
|
const pendingClientScenariosList: ClientScenario[] = [
|
||||||
|
|
@ -151,3 +152,5 @@ export function listActiveClientScenarios(): string[] {
|
||||||
export function listAuthScenarios(): string[] {
|
export function listAuthScenarios(): string[] {
|
||||||
return authScenariosList.map((scenario) => scenario.name);
|
return authScenariosList.map((scenario) => scenario.name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export { listMetadataScenarios };
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue