Skip to content

Commit

Permalink
fix: agent test run
Browse files Browse the repository at this point in the history
  • Loading branch information
shetzel committed Oct 31, 2024
1 parent e9cf53e commit d7db1ea
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 6 deletions.
2 changes: 1 addition & 1 deletion command-snapshot.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
},
{
"alias": [],
"command": "agent:run:test",
"command": "agent:test:run",
"flagAliases": [],
"flagChars": ["d", "i", "o", "w"],
"flags": ["flags-dir", "id", "json", "output-dir", "target-org", "wait"],
Expand Down
File renamed without changes.
22 changes: 22 additions & 0 deletions schemas/agent-test-run.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$ref": "#/definitions/AgentTestRunResult",
"definitions": {
"AgentTestRunResult": {
"type": "object",
"properties": {
"buildVersion": {
"type": "number"
},
"jobId": {
"type": "string"
},
"errorRepresentation": {
"type": "string"
}
},
"required": ["buildVersion", "jobId"],
"additionalProperties": false
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
import { Messages } from '@salesforce/core';

Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
const messages = Messages.loadMessages('@salesforce/plugin-agent', 'agent.run.test');
const messages = Messages.loadMessages('@salesforce/plugin-agent', 'agent.test.run');

export type AgentRunTestResult = {
export type AgentTestRunResult = {
buildVersion: number;
jobId: string;
errorRepresentation?: string;
};

export default class AgentRunTest extends SfCommand<AgentRunTestResult> {
export default class AgentTestRun extends SfCommand<AgentTestRunResult> {
public static readonly summary = messages.getMessage('summary');
public static readonly description = messages.getMessage('description');
public static readonly examples = messages.getMessages('examples');
Expand Down Expand Up @@ -50,8 +50,8 @@ export default class AgentRunTest extends SfCommand<AgentRunTestResult> {
// ??? api-version or build-version ???
};

public async run(): Promise<AgentRunTestResult> {
const { flags } = await this.parse(AgentRunTest);
public async run(): Promise<AgentTestRunResult> {
const { flags } = await this.parse(AgentTestRun);

this.log(`Starting tests for AiEvalDefinitionVersion: ${flags.id}`);

Expand Down

0 comments on commit d7db1ea

Please sign in to comment.