Skip to content

Commit fa2ac45

Browse files
committed
feat: use spec for tests
1 parent 0b2765d commit fa2ac45

File tree

12 files changed

+276
-283
lines changed

12 files changed

+276
-283
lines changed

command-snapshot.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,7 @@
7474
},
7575
{
7676
"alias": [],
77-
"command": "agent:generate:test-cases",
78-
"flagAliases": [],
79-
"flagChars": [],
80-
"flags": ["flags-dir"],
81-
"plugin": "@salesforce/plugin-agent"
82-
},
83-
{
84-
"alias": [],
85-
"command": "agent:generate:test-definition",
77+
"command": "agent:generate:test-spec",
8678
"flagAliases": [],
8779
"flagChars": [],
8880
"flags": ["flags-dir"],
@@ -104,6 +96,14 @@
10496
"flags": ["api-version", "flags-dir", "job-id", "json", "target-org", "use-most-recent"],
10597
"plugin": "@salesforce/plugin-agent"
10698
},
99+
{
100+
"alias": [],
101+
"command": "agent:test:create",
102+
"flagAliases": [],
103+
"flagChars": ["o", "p", "s"],
104+
"flags": ["api-version", "flags-dir", "json", "no-prompt", "preview", "spec", "target-org"],
105+
"plugin": "@salesforce/plugin-agent"
106+
},
107107
{
108108
"alias": [],
109109
"command": "agent:test:list",

messages/agent.generate.test-cases.md

Lines changed: 0 additions & 11 deletions
This file was deleted.

messages/agent.generate.test-definition.md

Lines changed: 0 additions & 13 deletions
This file was deleted.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# summary
2+
3+
Interactively generate a specification file for a AI evaluation test.
4+
5+
# description
6+
7+
This command will prompt you for the necessary information to create a new spec file (in yaml format). You can then create a new AI evaluation using "sf agent test create --spec <spec-file>".
8+
9+
# examples
10+
11+
- <%= config.bin %> <%= command.id %>

messages/agent.test.create.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# summary
2+
3+
Summary of a command.
4+
5+
# description
6+
7+
More information about a command. Don't repeat the summary.
8+
9+
# flags.spec.summary
10+
11+
Description of a flag.
12+
13+
# flags.spec.description
14+
15+
More information about a flag. Don't repeat the summary.
16+
17+
# flags.preview.summary
18+
19+
Preview the test metadata without deploying to your org.
20+
21+
# flags.no-prompt.summary
22+
23+
Don't prompt for confirmation when overwriting an existing test.
24+
25+
# examples
26+
27+
- <%= config.bin %> <%= command.id %>

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"@salesforce/core": "^8.8.0",
1414
"@salesforce/kit": "^3.2.1",
1515
"@salesforce/sf-plugins-core": "^12.1.0",
16+
"@salesforce/source-deploy-retrieve": "^12.14.0",
1617
"ansis": "^3.3.2",
1718
"fast-xml-parser": "^4.5.1",
1819
"ink": "^5.0.1",
@@ -77,6 +78,9 @@
7778
},
7879
"generate": {
7980
"external": true
81+
},
82+
"create": {
83+
"external": true
8084
}
8185
}
8286
}

schemas/agent-test-create.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"$ref": "#/definitions/AgentTestCreateResult",
4+
"definitions": {
5+
"AgentTestCreateResult": {
6+
"type": "object",
7+
"properties": {
8+
"path": {
9+
"type": "string"
10+
},
11+
"contents": {
12+
"type": "string"
13+
}
14+
},
15+
"required": ["path", "contents"],
16+
"additionalProperties": false
17+
}
18+
}
19+
}

src/commands/agent/generate/test-definition.ts

Lines changed: 0 additions & 93 deletions
This file was deleted.

0 commit comments

Comments
 (0)