@salesforce/plugin-agent 1.36.0 → 1.36.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +55 -24
- package/lib/agentTestCache.d.ts +4 -1
- package/lib/agentTestCache.js +2 -2
- package/lib/agentTestCache.js.map +1 -1
- package/lib/commands/agent/test/list.js +6 -1
- package/lib/commands/agent/test/list.js.map +1 -1
- package/lib/commands/agent/test/results.d.ts +3 -2
- package/lib/commands/agent/test/results.js +5 -3
- package/lib/commands/agent/test/results.js.map +1 -1
- package/lib/commands/agent/test/resume.d.ts +1 -0
- package/lib/commands/agent/test/resume.js +12 -4
- package/lib/commands/agent/test/resume.js.map +1 -1
- package/lib/commands/agent/test/run.d.ts +1 -0
- package/lib/commands/agent/test/run.js +21 -8
- package/lib/commands/agent/test/run.js.map +1 -1
- package/lib/flags.d.ts +6 -1
- package/lib/flags.js +21 -4
- package/lib/flags.js.map +1 -1
- package/lib/handleTestResults.d.ts +4 -2
- package/lib/handleTestResults.js +137 -5
- package/lib/handleTestResults.js.map +1 -1
- package/lib/testRunnerFactory.d.ts +7 -0
- package/lib/testRunnerFactory.js +30 -0
- package/lib/testRunnerFactory.js.map +1 -0
- package/lib/testStages.d.ts +4 -3
- package/lib/testStages.js.map +1 -1
- package/messages/agent.test.list.md +1 -1
- package/messages/shared.md +8 -0
- package/oclif.manifest.json +162 -126
- package/package.json +5 -5
- package/schemas/agent-activate.json +5 -2
- package/schemas/agent-create.json +39 -8
- package/schemas/agent-deactivate.json +5 -2
- package/schemas/agent-generate-agent__spec.json +18 -4
- package/schemas/agent-generate-authoring__bundle.json +6 -2
- package/schemas/agent-generate-template.json +5 -2
- package/schemas/agent-preview-end.json +5 -2
- package/schemas/agent-preview-send.json +6 -2
- package/schemas/agent-preview-sessions.json +10 -3
- package/schemas/agent-preview-start.json +5 -2
- package/schemas/agent-preview.json +1 -1
- package/schemas/agent-test-create.json +5 -2
- package/schemas/agent-test-list.json +1 -1
- package/schemas/agent-test-results.json +111 -10
- package/schemas/agent-test-resume.json +113 -10
- package/schemas/agent-test-run.json +113 -10
- package/schemas/agent-test-run__eval.json +17 -4
- package/schemas/agent-validate-authoring__bundle.json +4 -2
package/README.md
CHANGED
|
@@ -126,7 +126,7 @@ EXAMPLES
|
|
|
126
126
|
$ sf agent activate --api-name Resort_Manager --version 2 --target-org my-org
|
|
127
127
|
```
|
|
128
128
|
|
|
129
|
-
_See code: [src/commands/agent/activate.ts](https://github.com/salesforcecli/plugin-agent/blob/1.36.
|
|
129
|
+
_See code: [src/commands/agent/activate.ts](https://github.com/salesforcecli/plugin-agent/blob/1.36.1/src/commands/agent/activate.ts)_
|
|
130
130
|
|
|
131
131
|
## `sf agent create`
|
|
132
132
|
|
|
@@ -193,7 +193,7 @@ EXAMPLES
|
|
|
193
193
|
$ sf agent create --name "Resort Manager" --spec specs/resortManagerAgent.yaml --preview
|
|
194
194
|
```
|
|
195
195
|
|
|
196
|
-
_See code: [src/commands/agent/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.36.
|
|
196
|
+
_See code: [src/commands/agent/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.36.1/src/commands/agent/create.ts)_
|
|
197
197
|
|
|
198
198
|
## `sf agent deactivate`
|
|
199
199
|
|
|
@@ -234,7 +234,7 @@ EXAMPLES
|
|
|
234
234
|
$ sf agent deactivate --api-name Resort_Manager --target-org my-org
|
|
235
235
|
```
|
|
236
236
|
|
|
237
|
-
_See code: [src/commands/agent/deactivate.ts](https://github.com/salesforcecli/plugin-agent/blob/1.36.
|
|
237
|
+
_See code: [src/commands/agent/deactivate.ts](https://github.com/salesforcecli/plugin-agent/blob/1.36.1/src/commands/agent/deactivate.ts)_
|
|
238
238
|
|
|
239
239
|
## `sf agent generate agent-spec`
|
|
240
240
|
|
|
@@ -341,7 +341,7 @@ EXAMPLES
|
|
|
341
341
|
$ sf agent generate agent-spec --tone formal --agent-user resortmanager@myorg.com
|
|
342
342
|
```
|
|
343
343
|
|
|
344
|
-
_See code: [src/commands/agent/generate/agent-spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.36.
|
|
344
|
+
_See code: [src/commands/agent/generate/agent-spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.36.1/src/commands/agent/generate/agent-spec.ts)_
|
|
345
345
|
|
|
346
346
|
## `sf agent generate authoring-bundle`
|
|
347
347
|
|
|
@@ -418,7 +418,7 @@ EXAMPLES
|
|
|
418
418
|
other-package-dir/main/default --target-org my-dev-org
|
|
419
419
|
```
|
|
420
420
|
|
|
421
|
-
_See code: [src/commands/agent/generate/authoring-bundle.ts](https://github.com/salesforcecli/plugin-agent/blob/1.36.
|
|
421
|
+
_See code: [src/commands/agent/generate/authoring-bundle.ts](https://github.com/salesforcecli/plugin-agent/blob/1.36.1/src/commands/agent/generate/authoring-bundle.ts)_
|
|
422
422
|
|
|
423
423
|
## `sf agent generate template`
|
|
424
424
|
|
|
@@ -480,7 +480,7 @@ EXAMPLES
|
|
|
480
480
|
my-package --source-org my-scratch-org
|
|
481
481
|
```
|
|
482
482
|
|
|
483
|
-
_See code: [src/commands/agent/generate/template.ts](https://github.com/salesforcecli/plugin-agent/blob/1.36.
|
|
483
|
+
_See code: [src/commands/agent/generate/template.ts](https://github.com/salesforcecli/plugin-agent/blob/1.36.1/src/commands/agent/generate/template.ts)_
|
|
484
484
|
|
|
485
485
|
## `sf agent generate test-spec`
|
|
486
486
|
|
|
@@ -545,7 +545,7 @@ EXAMPLES
|
|
|
545
545
|
force-app//main/default/aiEvaluationDefinitions/Resort_Manager_Tests.aiEvaluationDefinition-meta.xml
|
|
546
546
|
```
|
|
547
547
|
|
|
548
|
-
_See code: [src/commands/agent/generate/test-spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.36.
|
|
548
|
+
_See code: [src/commands/agent/generate/test-spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.36.1/src/commands/agent/generate/test-spec.ts)_
|
|
549
549
|
|
|
550
550
|
## `sf agent preview`
|
|
551
551
|
|
|
@@ -618,7 +618,7 @@ EXAMPLES
|
|
|
618
618
|
$ sf agent preview --use-live-actions --apex-debug --output-dir transcripts/my-preview
|
|
619
619
|
```
|
|
620
620
|
|
|
621
|
-
_See code: [src/commands/agent/preview.ts](https://github.com/salesforcecli/plugin-agent/blob/1.36.
|
|
621
|
+
_See code: [src/commands/agent/preview.ts](https://github.com/salesforcecli/plugin-agent/blob/1.36.1/src/commands/agent/preview.ts)_
|
|
622
622
|
|
|
623
623
|
## `sf agent preview end`
|
|
624
624
|
|
|
@@ -673,7 +673,7 @@ EXAMPLES
|
|
|
673
673
|
$ sf agent preview end --authoring-bundle My_Local_Agent
|
|
674
674
|
```
|
|
675
675
|
|
|
676
|
-
_See code: [src/commands/agent/preview/end.ts](https://github.com/salesforcecli/plugin-agent/blob/1.36.
|
|
676
|
+
_See code: [src/commands/agent/preview/end.ts](https://github.com/salesforcecli/plugin-agent/blob/1.36.1/src/commands/agent/preview/end.ts)_
|
|
677
677
|
|
|
678
678
|
## `sf agent preview send`
|
|
679
679
|
|
|
@@ -731,7 +731,7 @@ EXAMPLES
|
|
|
731
731
|
$ sf agent preview send --utterance "what can you help me with?" --authoring-bundle My_Local_Agent
|
|
732
732
|
```
|
|
733
733
|
|
|
734
|
-
_See code: [src/commands/agent/preview/send.ts](https://github.com/salesforcecli/plugin-agent/blob/1.36.
|
|
734
|
+
_See code: [src/commands/agent/preview/send.ts](https://github.com/salesforcecli/plugin-agent/blob/1.36.1/src/commands/agent/preview/send.ts)_
|
|
735
735
|
|
|
736
736
|
## `sf agent preview sessions`
|
|
737
737
|
|
|
@@ -764,7 +764,7 @@ EXAMPLES
|
|
|
764
764
|
$ sf agent preview sessions
|
|
765
765
|
```
|
|
766
766
|
|
|
767
|
-
_See code: [src/commands/agent/preview/sessions.ts](https://github.com/salesforcecli/plugin-agent/blob/1.36.
|
|
767
|
+
_See code: [src/commands/agent/preview/sessions.ts](https://github.com/salesforcecli/plugin-agent/blob/1.36.1/src/commands/agent/preview/sessions.ts)_
|
|
768
768
|
|
|
769
769
|
## `sf agent preview start`
|
|
770
770
|
|
|
@@ -829,7 +829,7 @@ EXAMPLES
|
|
|
829
829
|
$ sf agent preview start --api-name My_Published_Agent
|
|
830
830
|
```
|
|
831
831
|
|
|
832
|
-
_See code: [src/commands/agent/preview/start.ts](https://github.com/salesforcecli/plugin-agent/blob/1.36.
|
|
832
|
+
_See code: [src/commands/agent/preview/start.ts](https://github.com/salesforcecli/plugin-agent/blob/1.36.1/src/commands/agent/preview/start.ts)_
|
|
833
833
|
|
|
834
834
|
## `sf agent publish authoring-bundle`
|
|
835
835
|
|
|
@@ -889,7 +889,7 @@ EXAMPLES
|
|
|
889
889
|
$ sf agent publish authoring-bundle --api-name MyAuthoringbundle --concise
|
|
890
890
|
```
|
|
891
891
|
|
|
892
|
-
_See code: [src/commands/agent/publish/authoring-bundle.ts](https://github.com/salesforcecli/plugin-agent/blob/1.36.
|
|
892
|
+
_See code: [src/commands/agent/publish/authoring-bundle.ts](https://github.com/salesforcecli/plugin-agent/blob/1.36.1/src/commands/agent/publish/authoring-bundle.ts)_
|
|
893
893
|
|
|
894
894
|
## `sf agent test create`
|
|
895
895
|
|
|
@@ -944,7 +944,7 @@ EXAMPLES
|
|
|
944
944
|
$ sf agent test create --spec specs/Resort_Manager-testSpec.yaml --api-name Resort_Manager_Test --preview
|
|
945
945
|
```
|
|
946
946
|
|
|
947
|
-
_See code: [src/commands/agent/test/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.36.
|
|
947
|
+
_See code: [src/commands/agent/test/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.36.1/src/commands/agent/test/create.ts)_
|
|
948
948
|
|
|
949
949
|
## `sf agent test list`
|
|
950
950
|
|
|
@@ -966,8 +966,8 @@ GLOBAL FLAGS
|
|
|
966
966
|
DESCRIPTION
|
|
967
967
|
List the available agent tests in your org.
|
|
968
968
|
|
|
969
|
-
The command outputs a table with the name (API name) of each test along with its unique ID
|
|
970
|
-
in the org.
|
|
969
|
+
The command outputs a table with the name (API name) of each test along with its unique ID, type ('agentforce-studio'
|
|
970
|
+
or 'testing-center'), and the date it was created in the org.
|
|
971
971
|
|
|
972
972
|
EXAMPLES
|
|
973
973
|
List the agent tests in your default org:
|
|
@@ -979,7 +979,7 @@ EXAMPLES
|
|
|
979
979
|
$ sf agent test list --target-org my-org
|
|
980
980
|
```
|
|
981
981
|
|
|
982
|
-
_See code: [src/commands/agent/test/list.ts](https://github.com/salesforcecli/plugin-agent/blob/1.36.
|
|
982
|
+
_See code: [src/commands/agent/test/list.ts](https://github.com/salesforcecli/plugin-agent/blob/1.36.1/src/commands/agent/test/list.ts)_
|
|
983
983
|
|
|
984
984
|
## `sf agent test results`
|
|
985
985
|
|
|
@@ -988,7 +988,7 @@ Get the results of a completed agent test run.
|
|
|
988
988
|
```
|
|
989
989
|
USAGE
|
|
990
990
|
$ sf agent test results -o <value> -i <value> [--json] [--flags-dir <value>] [--api-version <value>] [--result-format
|
|
991
|
-
json|human|junit|tap] [-d <value>] [--verbose]
|
|
991
|
+
json|human|junit|tap] [-d <value>] [--test-runner agentforce-studio|testing-center] [--verbose]
|
|
992
992
|
|
|
993
993
|
FLAGS
|
|
994
994
|
-d, --output-dir=<value> Directory to write the agent test results into.
|
|
@@ -998,6 +998,8 @@ FLAGS
|
|
|
998
998
|
--api-version=<value> Override the api version used for api requests made by this command
|
|
999
999
|
--result-format=<option> [default: human] Format of the agent test run results.
|
|
1000
1000
|
<options: json|human|junit|tap>
|
|
1001
|
+
--test-runner=<option> Explicitly specify which test runner to use (agentforce-studio or testing-center).
|
|
1002
|
+
<options: agentforce-studio|testing-center>
|
|
1001
1003
|
--verbose Show generated data in the test results output.
|
|
1002
1004
|
|
|
1003
1005
|
GLOBAL FLAGS
|
|
@@ -1035,6 +1037,14 @@ FLAG DESCRIPTIONS
|
|
|
1035
1037
|
If the agent test run completes, write the results to the specified directory. If the test is still running, the
|
|
1036
1038
|
test results aren't written.
|
|
1037
1039
|
|
|
1040
|
+
--test-runner=agentforce-studio|testing-center
|
|
1041
|
+
|
|
1042
|
+
Explicitly specify which test runner to use (agentforce-studio or testing-center).
|
|
1043
|
+
|
|
1044
|
+
By default, the command automatically detects which test runner to use based on the test definition metadata type in
|
|
1045
|
+
your org. Use this flag to explicitly specify the runner type. 'agentforce-studio' uses AiTestingDefinition
|
|
1046
|
+
metadata. 'testing-center' uses AiEvaluationDefinition metadata.
|
|
1047
|
+
|
|
1038
1048
|
--verbose Show generated data in the test results output.
|
|
1039
1049
|
|
|
1040
1050
|
When enabled, includes detailed generated data (such as invoked actions) in the human-readable test results output.
|
|
@@ -1045,7 +1055,7 @@ FLAG DESCRIPTIONS
|
|
|
1045
1055
|
expression when using custom evaluations.
|
|
1046
1056
|
```
|
|
1047
1057
|
|
|
1048
|
-
_See code: [src/commands/agent/test/results.ts](https://github.com/salesforcecli/plugin-agent/blob/1.36.
|
|
1058
|
+
_See code: [src/commands/agent/test/results.ts](https://github.com/salesforcecli/plugin-agent/blob/1.36.1/src/commands/agent/test/results.ts)_
|
|
1049
1059
|
|
|
1050
1060
|
## `sf agent test resume`
|
|
1051
1061
|
|
|
@@ -1054,7 +1064,8 @@ Resume an agent test that you previously started in your org so you can view the
|
|
|
1054
1064
|
```
|
|
1055
1065
|
USAGE
|
|
1056
1066
|
$ sf agent test resume -o <value> [--json] [--flags-dir <value>] [--api-version <value>] [-i <value>] [-r] [-w
|
|
1057
|
-
<value>] [--result-format json|human|junit|tap] [-d <value>] [--
|
|
1067
|
+
<value>] [--result-format json|human|junit|tap] [-d <value>] [--test-runner agentforce-studio|testing-center]
|
|
1068
|
+
[--verbose]
|
|
1058
1069
|
|
|
1059
1070
|
FLAGS
|
|
1060
1071
|
-d, --output-dir=<value> Directory to write the agent test results into.
|
|
@@ -1067,6 +1078,8 @@ FLAGS
|
|
|
1067
1078
|
--api-version=<value> Override the api version used for api requests made by this command
|
|
1068
1079
|
--result-format=<option> [default: human] Format of the agent test run results.
|
|
1069
1080
|
<options: json|human|junit|tap>
|
|
1081
|
+
--test-runner=<option> Explicitly specify which test runner to use (agentforce-studio or testing-center).
|
|
1082
|
+
<options: agentforce-studio|testing-center>
|
|
1070
1083
|
--verbose Show generated data in the test results output.
|
|
1071
1084
|
|
|
1072
1085
|
GLOBAL FLAGS
|
|
@@ -1108,6 +1121,14 @@ FLAG DESCRIPTIONS
|
|
|
1108
1121
|
If the agent test run completes, write the results to the specified directory. If the test is still running, the
|
|
1109
1122
|
test results aren't written.
|
|
1110
1123
|
|
|
1124
|
+
--test-runner=agentforce-studio|testing-center
|
|
1125
|
+
|
|
1126
|
+
Explicitly specify which test runner to use (agentforce-studio or testing-center).
|
|
1127
|
+
|
|
1128
|
+
By default, the command automatically detects which test runner to use based on the test definition metadata type in
|
|
1129
|
+
your org. Use this flag to explicitly specify the runner type. 'agentforce-studio' uses AiTestingDefinition
|
|
1130
|
+
metadata. 'testing-center' uses AiEvaluationDefinition metadata.
|
|
1131
|
+
|
|
1111
1132
|
--verbose Show generated data in the test results output.
|
|
1112
1133
|
|
|
1113
1134
|
When enabled, includes detailed generated data (such as invoked actions) in the human-readable test results output.
|
|
@@ -1118,7 +1139,7 @@ FLAG DESCRIPTIONS
|
|
|
1118
1139
|
expression when using custom evaluations.
|
|
1119
1140
|
```
|
|
1120
1141
|
|
|
1121
|
-
_See code: [src/commands/agent/test/resume.ts](https://github.com/salesforcecli/plugin-agent/blob/1.36.
|
|
1142
|
+
_See code: [src/commands/agent/test/resume.ts](https://github.com/salesforcecli/plugin-agent/blob/1.36.1/src/commands/agent/test/resume.ts)_
|
|
1122
1143
|
|
|
1123
1144
|
## `sf agent test run`
|
|
1124
1145
|
|
|
@@ -1127,7 +1148,7 @@ Start an agent test in your org.
|
|
|
1127
1148
|
```
|
|
1128
1149
|
USAGE
|
|
1129
1150
|
$ sf agent test run -o <value> [--json] [--flags-dir <value>] [--api-version <value>] [-n <value>] [-w <value>]
|
|
1130
|
-
[--result-format json|human|junit|tap] [-d <value>] [--verbose]
|
|
1151
|
+
[--result-format json|human|junit|tap] [-d <value>] [--test-runner agentforce-studio|testing-center] [--verbose]
|
|
1131
1152
|
|
|
1132
1153
|
FLAGS
|
|
1133
1154
|
-d, --output-dir=<value> Directory to write the agent test results into.
|
|
@@ -1140,6 +1161,8 @@ FLAGS
|
|
|
1140
1161
|
--api-version=<value> Override the api version used for api requests made by this command
|
|
1141
1162
|
--result-format=<option> [default: human] Format of the agent test run results.
|
|
1142
1163
|
<options: json|human|junit|tap>
|
|
1164
|
+
--test-runner=<option> Explicitly specify which test runner to use (agentforce-studio or testing-center).
|
|
1165
|
+
<options: agentforce-studio|testing-center>
|
|
1143
1166
|
--verbose Show generated data in the test results output.
|
|
1144
1167
|
|
|
1145
1168
|
GLOBAL FLAGS
|
|
@@ -1182,6 +1205,14 @@ FLAG DESCRIPTIONS
|
|
|
1182
1205
|
If the agent test run completes, write the results to the specified directory. If the test is still running, the
|
|
1183
1206
|
test results aren't written.
|
|
1184
1207
|
|
|
1208
|
+
--test-runner=agentforce-studio|testing-center
|
|
1209
|
+
|
|
1210
|
+
Explicitly specify which test runner to use (agentforce-studio or testing-center).
|
|
1211
|
+
|
|
1212
|
+
By default, the command automatically detects which test runner to use based on the test definition metadata type in
|
|
1213
|
+
your org. Use this flag to explicitly specify the runner type. 'agentforce-studio' uses AiTestingDefinition
|
|
1214
|
+
metadata. 'testing-center' uses AiEvaluationDefinition metadata.
|
|
1215
|
+
|
|
1185
1216
|
--verbose Show generated data in the test results output.
|
|
1186
1217
|
|
|
1187
1218
|
When enabled, includes detailed generated data (such as invoked actions) in the human-readable test results output.
|
|
@@ -1192,7 +1223,7 @@ FLAG DESCRIPTIONS
|
|
|
1192
1223
|
expression when using custom evaluations.
|
|
1193
1224
|
```
|
|
1194
1225
|
|
|
1195
|
-
_See code: [src/commands/agent/test/run.ts](https://github.com/salesforcecli/plugin-agent/blob/1.36.
|
|
1226
|
+
_See code: [src/commands/agent/test/run.ts](https://github.com/salesforcecli/plugin-agent/blob/1.36.1/src/commands/agent/test/run.ts)_
|
|
1196
1227
|
|
|
1197
1228
|
## `sf agent validate authoring-bundle`
|
|
1198
1229
|
|
|
@@ -1239,6 +1270,6 @@ EXAMPLES
|
|
|
1239
1270
|
$ sf agent validate authoring-bundle --api-name MyAuthoringBundle --target-org my-dev-org
|
|
1240
1271
|
```
|
|
1241
1272
|
|
|
1242
|
-
_See code: [src/commands/agent/validate/authoring-bundle.ts](https://github.com/salesforcecli/plugin-agent/blob/1.36.
|
|
1273
|
+
_See code: [src/commands/agent/validate/authoring-bundle.ts](https://github.com/salesforcecli/plugin-agent/blob/1.36.1/src/commands/agent/validate/authoring-bundle.ts)_
|
|
1243
1274
|
|
|
1244
1275
|
<!-- commandsstop -->
|
package/lib/agentTestCache.d.ts
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { TTLConfig } from '@salesforce/core';
|
|
2
|
+
import type { TestRunnerType } from '@salesforce/agents';
|
|
2
3
|
type ResultFormat = 'json' | 'human' | 'junit' | 'tap';
|
|
3
4
|
type CacheContents = {
|
|
4
5
|
runId: string;
|
|
5
6
|
name: string;
|
|
6
7
|
outputDir?: string;
|
|
7
8
|
resultFormat?: ResultFormat;
|
|
9
|
+
runnerType?: TestRunnerType;
|
|
8
10
|
};
|
|
9
11
|
export declare class AgentTestCache extends TTLConfig<TTLConfig.Options, CacheContents> {
|
|
10
12
|
static getFileName(): string;
|
|
11
13
|
static getDefaultOptions(): TTLConfig.Options;
|
|
12
|
-
createCacheEntry(runId: string, name: string, outputDir?: string, resultFormat?: ResultFormat): Promise<void>;
|
|
14
|
+
createCacheEntry(runId: string, name: string, outputDir?: string, resultFormat?: ResultFormat, runnerType?: TestRunnerType): Promise<void>;
|
|
13
15
|
removeCacheEntry(runId: string): Promise<void>;
|
|
14
16
|
resolveFromCache(): CacheContents;
|
|
15
17
|
useIdOrMostRecent(runId: string | undefined, useMostRecent: boolean): {
|
|
@@ -17,6 +19,7 @@ export declare class AgentTestCache extends TTLConfig<TTLConfig.Options, CacheCo
|
|
|
17
19
|
name?: string;
|
|
18
20
|
outputDir?: string;
|
|
19
21
|
resultFormat?: ResultFormat;
|
|
22
|
+
runnerType?: TestRunnerType;
|
|
20
23
|
};
|
|
21
24
|
}
|
|
22
25
|
export {};
|
package/lib/agentTestCache.js
CHANGED
|
@@ -28,10 +28,10 @@ export class AgentTestCache extends TTLConfig {
|
|
|
28
28
|
ttl: Duration.days(7),
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
|
-
async createCacheEntry(runId, name, outputDir, resultFormat) {
|
|
31
|
+
async createCacheEntry(runId, name, outputDir, resultFormat, runnerType) {
|
|
32
32
|
if (!runId)
|
|
33
33
|
throw new SfError('runId is required to create a cache entry');
|
|
34
|
-
this.set(runId, { runId, name, outputDir, resultFormat });
|
|
34
|
+
this.set(runId, { runId, name, outputDir, resultFormat, runnerType });
|
|
35
35
|
await this.write();
|
|
36
36
|
}
|
|
37
37
|
async removeCacheEntry(runId) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agentTestCache.js","sourceRoot":"","sources":["../src/agentTestCache.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"agentTestCache.js","sourceRoot":"","sources":["../src/agentTestCache.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAa3C,MAAM,OAAO,cAAe,SAAQ,SAA2C;IACtE,MAAM,CAAC,WAAW;QACvB,OAAO,uBAAuB,CAAC;IACjC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AAM,IAAI,OAAO,CAAC,qDAAqD,CAAC,CAAC;QAC3E,CAAC;QAED,IAAI,KAAK,EAAE,CAAC;YACV,OAAO,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC;QACvD,CAAC;QAED,OAAO,IAAI,CAAC,gBAAgB,EAAE,CAAC;IACjC,CAAC;CACF"}
|
|
@@ -41,11 +41,16 @@ export default class AgentTestList extends SfCommand {
|
|
|
41
41
|
const wrapped = SfError.wrap(error);
|
|
42
42
|
throw new SfError(`Failed to retrieve agent tests: ${wrapped.message}`, 'ListRetrievalFailed', [wrapped.message], 4, wrapped);
|
|
43
43
|
}
|
|
44
|
+
const rows = results.map((r) => ({
|
|
45
|
+
...r,
|
|
46
|
+
type: r.type === 'AiEvaluationDefinition' ? 'testing-center' : 'agentforce-studio',
|
|
47
|
+
}));
|
|
44
48
|
this.table({
|
|
45
|
-
data:
|
|
49
|
+
data: rows,
|
|
46
50
|
columns: [
|
|
47
51
|
{ key: 'fullName', name: 'API Name' },
|
|
48
52
|
{ key: 'id', name: 'Id' },
|
|
53
|
+
{ key: 'type', name: 'Type' },
|
|
49
54
|
{ key: 'createdDate', name: 'Created Date' },
|
|
50
55
|
],
|
|
51
56
|
sort: { fullName: 'asc' },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../../src/commands/agent/test/list.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,SAAS,EAA4B,MAAM,oBAAoB,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC9E,OAAO,EAAE,QAAQ,EAAE,mBAAmB,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE1E,QAAQ,CAAC,kCAAkC,CAA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from '@salesforce/sf-plugins-core';
|
|
2
|
-
import { AgentTestResultsResponse } from '@salesforce/agents';
|
|
3
|
-
export type AgentTestResultsResult = AgentTestResultsResponse;
|
|
2
|
+
import { AgentTestResultsResponse, AgentforceStudioTestResultsResponse } from '@salesforce/agents';
|
|
3
|
+
export type AgentTestResultsResult = AgentTestResultsResponse | AgentforceStudioTestResultsResponse;
|
|
4
4
|
export default class AgentTestResults extends SfCommand<AgentTestResultsResult> {
|
|
5
5
|
static readonly summary: string;
|
|
6
6
|
static readonly description: string;
|
|
@@ -13,6 +13,7 @@ export default class AgentTestResults extends SfCommand<AgentTestResultsResult>
|
|
|
13
13
|
'job-id': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
14
|
'result-format': import("@oclif/core/interfaces").OptionFlag<"json" | "human" | "junit" | "tap", import("@oclif/core/interfaces").CustomOptions>;
|
|
15
15
|
'output-dir': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
|
+
'test-runner': import("@oclif/core/interfaces").OptionFlag<"agentforce-studio" | "testing-center" | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
17
|
verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
17
18
|
};
|
|
18
19
|
run(): Promise<AgentTestResultsResult>;
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { SfCommand, Flags, toHelpSection } from '@salesforce/sf-plugins-core';
|
|
17
17
|
import { EnvironmentVariable, Messages, SfError } from '@salesforce/core';
|
|
18
|
-
import {
|
|
19
|
-
import { resultFormatFlag, testOutputDirFlag, verboseFlag } from '../../../flags.js';
|
|
18
|
+
import { resultFormatFlag, testOutputDirFlag, testRunnerFlag, verboseFlag } from '../../../flags.js';
|
|
20
19
|
import { handleTestResults } from '../../../handleTestResults.js';
|
|
20
|
+
import { createTestRunner } from '../../../testRunnerFactory.js';
|
|
21
21
|
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
22
22
|
const messages = Messages.loadMessages('@salesforce/plugin-agent', 'agent.test.results');
|
|
23
23
|
export default class AgentTestResults extends SfCommand {
|
|
@@ -40,11 +40,13 @@ export default class AgentTestResults extends SfCommand {
|
|
|
40
40
|
}),
|
|
41
41
|
'result-format': resultFormatFlag(),
|
|
42
42
|
'output-dir': testOutputDirFlag(),
|
|
43
|
+
'test-runner': testRunnerFlag,
|
|
43
44
|
verbose: verboseFlag,
|
|
44
45
|
};
|
|
45
46
|
async run() {
|
|
46
47
|
const { flags } = await this.parse(AgentTestResults);
|
|
47
|
-
const
|
|
48
|
+
const connection = flags['target-org'].getConnection(flags['api-version']);
|
|
49
|
+
const { runner: agentTester } = await createTestRunner(connection, flags['test-runner'], undefined, flags['job-id']);
|
|
48
50
|
let response;
|
|
49
51
|
try {
|
|
50
52
|
response = await agentTester.results(flags['job-id']);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"results.js","sourceRoot":"","sources":["../../../../src/commands/agent/test/results.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC9E,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"results.js","sourceRoot":"","sources":["../../../../src/commands/agent/test/results.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC9E,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE1E,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrG,OAAO,EAAE,i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,IAAI,CAAC,WAAW,EAAE;YAC/B,SAAS,EAAE,KAAK,CAAC,YAAY,CAAC;YAC9B,OAAO,EAAE,KAAK,CAAC,OAAO;SACvB,CAAC,CAAC;QACH,OAAO,QAAQ,CAAC;IAClB,CAAC"}
|
|
@@ -16,6 +16,7 @@ export default class AgentTestResume extends SfCommand<AgentTestRunResult> {
|
|
|
16
16
|
wait: import("@oclif/core/interfaces").OptionFlag<import("@salesforce/kit").Duration, import("@oclif/core/interfaces").CustomOptions>;
|
|
17
17
|
'result-format': import("@oclif/core/interfaces").OptionFlag<"json" | "human" | "junit" | "tap", import("@oclif/core/interfaces").CustomOptions>;
|
|
18
18
|
'output-dir': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
19
|
+
'test-runner': import("@oclif/core/interfaces").OptionFlag<"agentforce-studio" | "testing-center" | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
19
20
|
verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
20
21
|
};
|
|
21
22
|
private mso;
|
|
@@ -15,11 +15,11 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { SfCommand, Flags, toHelpSection } from '@salesforce/sf-plugins-core';
|
|
17
17
|
import { EnvironmentVariable, Messages, SfError } from '@salesforce/core';
|
|
18
|
-
import { AgentTester } from '@salesforce/agents';
|
|
19
18
|
import { AgentTestCache } from '../../../agentTestCache.js';
|
|
20
19
|
import { TestStages } from '../../../testStages.js';
|
|
21
|
-
import { resultFormatFlag, testOutputDirFlag, verboseFlag } from '../../../flags.js';
|
|
20
|
+
import { resultFormatFlag, testOutputDirFlag, testRunnerFlag, verboseFlag, } from '../../../flags.js';
|
|
22
21
|
import { handleTestResults } from '../../../handleTestResults.js';
|
|
22
|
+
import { createTestRunner } from '../../../testRunnerFactory.js';
|
|
23
23
|
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
24
24
|
const messages = Messages.loadMessages('@salesforce/plugin-agent', 'agent.test.resume');
|
|
25
25
|
export default class AgentTestResume extends SfCommand {
|
|
@@ -55,6 +55,7 @@ export default class AgentTestResume extends SfCommand {
|
|
|
55
55
|
}),
|
|
56
56
|
'result-format': resultFormatFlag(),
|
|
57
57
|
'output-dir': testOutputDirFlag(),
|
|
58
|
+
'test-runner': testRunnerFlag,
|
|
58
59
|
verbose: verboseFlag,
|
|
59
60
|
};
|
|
60
61
|
mso;
|
|
@@ -65,12 +66,14 @@ export default class AgentTestResume extends SfCommand {
|
|
|
65
66
|
let runId;
|
|
66
67
|
let outputDir;
|
|
67
68
|
let resultFormat;
|
|
69
|
+
let cachedRunnerType;
|
|
68
70
|
try {
|
|
69
71
|
const cacheEntry = agentTestCache.useIdOrMostRecent(flags['job-id'], flags['use-most-recent']);
|
|
70
72
|
name = cacheEntry.name;
|
|
71
73
|
runId = cacheEntry.runId;
|
|
72
74
|
outputDir = cacheEntry.outputDir;
|
|
73
75
|
resultFormat = cacheEntry.resultFormat;
|
|
76
|
+
cachedRunnerType = cacheEntry.runnerType;
|
|
74
77
|
}
|
|
75
78
|
catch (e) {
|
|
76
79
|
const wrapped = SfError.wrap(e);
|
|
@@ -87,7 +90,9 @@ export default class AgentTestResume extends SfCommand {
|
|
|
87
90
|
jsonEnabled: this.jsonEnabled(),
|
|
88
91
|
});
|
|
89
92
|
this.mso.start({ id: runId });
|
|
90
|
-
|
|
93
|
+
// Use explicit flag > cached runner type > ID prefix detection > org metadata query
|
|
94
|
+
const connection = flags['target-org'].getConnection(flags['api-version']);
|
|
95
|
+
const { runner: agentTester } = await createTestRunner(connection, flags['test-runner'] ?? cachedRunnerType, name, runId);
|
|
91
96
|
let completed;
|
|
92
97
|
let response;
|
|
93
98
|
try {
|
|
@@ -112,7 +117,10 @@ export default class AgentTestResume extends SfCommand {
|
|
|
112
117
|
});
|
|
113
118
|
// Set exit code to 1 only for execution errors (tests couldn't run properly)
|
|
114
119
|
// Test assertion failures are business logic and should not affect exit code
|
|
115
|
-
|
|
120
|
+
// Only applicable to legacy responses (Agentforce Studio doesn't have test case status)
|
|
121
|
+
if (response &&
|
|
122
|
+
'subjectName' in response &&
|
|
123
|
+
response.testCases.some((tc) => 'status' in tc && tc.status === 'ERROR')) {
|
|
116
124
|
process.exitCode = 1;
|
|
117
125
|
}
|
|
118
126
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resume.js","sourceRoot":"","sources":["../../../../src/commands/agent/test/resume.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC9E,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"resume.js","sourceRoot":"","sources":["../../../../src/commands/agent/test/resume.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC9E,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE1E,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAEL,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,WAAW,GACZ,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEjE,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,0BAA0B,EAA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,gBAAgB,CAAC,KAAK,CAAC,CAAC;QAE5D,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;QAEhB,MAAM,iBAAiB,CAAC;YACtB,EAAE,EAAE,KAAK;YACT,MAAM,EAAE,YAAY,IAAI,KAAK,CAAC,eAAe,CAAC;YAC9C,OAAO,EAAE,QAAQ;YACjB,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE;YAC/B,SAAS,EAAE,SAAS,IAAI,KAAK,CAAC,YAAY,CAAC;YAC3C,OAAO,EAAE,KAAK,CAAC,OAAO;SACvB,CAAC,CAAC;QAEH,6EAA6E;QAC7E,6EAA6E;QAC7E,wFAAwF;QACxF,IACE,QAAQ;YACR,aAAa,IAAI,QAAQ;YACzB,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,QAAQ,IAAI,EAAE,IAAI,EAAE,CAAC,MAAM,KAAK,OAAO,CAAC,EACxE,CAAC;YACD,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;QACvB,CAAC;QAED,4EAA4E;QAC5E,OAAO,EAAE,GAAG,QAAS,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAwB,CAAC;IAC5E,CAAC;IAES,KAAK,CAAC,KAAiC;QAC/C,IAAI,CAAC,GAAG,EAAE,KAAK,EAAE,CAAC;QAClB,OAAO,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC5B,CAAC"}
|
|
@@ -12,6 +12,7 @@ export default class AgentTestRun extends SfCommand<AgentTestRunResult> {
|
|
|
12
12
|
wait: import("@oclif/core/interfaces").OptionFlag<import("@salesforce/kit").Duration, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
13
|
'result-format': import("@oclif/core/interfaces").OptionFlag<"json" | "human" | "junit" | "tap", import("@oclif/core/interfaces").CustomOptions>;
|
|
14
14
|
'output-dir': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
|
+
'test-runner': import("@oclif/core/interfaces").OptionFlag<"agentforce-studio" | "testing-center" | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
16
|
verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
16
17
|
"api-name": import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
17
18
|
'target-org': import("@oclif/core/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/interfaces").CustomOptions>;
|
|
@@ -15,12 +15,12 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { SfCommand, Flags, toHelpSection } from '@salesforce/sf-plugins-core';
|
|
17
17
|
import { EnvironmentVariable, Messages, SfError } from '@salesforce/core';
|
|
18
|
-
import { AgentTester } from '@salesforce/agents';
|
|
19
18
|
import { colorize } from '@oclif/core/ux';
|
|
20
|
-
import { makeFlags,
|
|
19
|
+
import { makeFlags, promptForTestDefinitionApiName, resultFormatFlag, testOutputDirFlag, testRunnerFlag, verboseFlag, } from '../../../flags.js';
|
|
21
20
|
import { AgentTestCache } from '../../../agentTestCache.js';
|
|
22
21
|
import { TestStages } from '../../../testStages.js';
|
|
23
22
|
import { handleTestResults } from '../../../handleTestResults.js';
|
|
23
|
+
import { createTestRunner } from '../../../testRunnerFactory.js';
|
|
24
24
|
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
25
25
|
const messages = Messages.loadMessages('@salesforce/plugin-agent', 'agent.test.run');
|
|
26
26
|
const FLAGGABLE_PROMPTS = {
|
|
@@ -69,6 +69,7 @@ export default class AgentTestRun extends SfCommand {
|
|
|
69
69
|
}),
|
|
70
70
|
'result-format': resultFormatFlag(),
|
|
71
71
|
'output-dir': testOutputDirFlag(),
|
|
72
|
+
'test-runner': testRunnerFlag,
|
|
72
73
|
verbose: verboseFlag,
|
|
73
74
|
};
|
|
74
75
|
mso;
|
|
@@ -78,10 +79,19 @@ export default class AgentTestRun extends SfCommand {
|
|
|
78
79
|
if (this.jsonEnabled() && !flags['api-name']) {
|
|
79
80
|
throw messages.createError('error.missingRequiredFlags', ['api-name']);
|
|
80
81
|
}
|
|
81
|
-
|
|
82
|
+
let apiName;
|
|
83
|
+
let promptedTestRunner;
|
|
84
|
+
if (flags['api-name']) {
|
|
85
|
+
apiName = flags['api-name'];
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
const selection = await promptForTestDefinitionApiName(FLAGGABLE_PROMPTS['api-name'], connection);
|
|
89
|
+
apiName = selection.apiName;
|
|
90
|
+
promptedTestRunner = selection.testRunner;
|
|
91
|
+
}
|
|
82
92
|
this.mso = new TestStages({ title: `Agent Test Run: ${apiName}`, jsonEnabled: this.jsonEnabled() });
|
|
83
93
|
this.mso.start();
|
|
84
|
-
const agentTester =
|
|
94
|
+
const { runner: agentTester, type: runnerType } = await createTestRunner(connection, flags['test-runner'] ?? promptedTestRunner, apiName);
|
|
85
95
|
let response;
|
|
86
96
|
try {
|
|
87
97
|
response = await agentTester.start(apiName);
|
|
@@ -90,7 +100,8 @@ export default class AgentTestRun extends SfCommand {
|
|
|
90
100
|
const wrapped = SfError.wrap(e);
|
|
91
101
|
// Check for test definition not found
|
|
92
102
|
if (wrapped.message.includes('Invalid AiEvalDefinitionVersion identifier') ||
|
|
93
|
-
wrapped.message.toLowerCase().includes('not found')
|
|
103
|
+
wrapped.message.toLowerCase().includes('not found') ||
|
|
104
|
+
wrapped.message.includes('Failed to run test suite')) {
|
|
94
105
|
throw new SfError(`Test definition '${apiName}' not found.`, 'TestNotFound', [`Try running "sf agent test list -o ${flags['target-org'].getUsername() ?? ''}" to see available options`], 2, wrapped);
|
|
95
106
|
}
|
|
96
107
|
// API/network failures
|
|
@@ -98,7 +109,7 @@ export default class AgentTestRun extends SfCommand {
|
|
|
98
109
|
}
|
|
99
110
|
this.mso.update({ id: response.runId });
|
|
100
111
|
const agentTestCache = await AgentTestCache.create();
|
|
101
|
-
await agentTestCache.createCacheEntry(response.runId, apiName, flags['output-dir'], flags['result-format']);
|
|
112
|
+
await agentTestCache.createCacheEntry(response.runId, apiName, flags['output-dir'], flags['result-format'], runnerType);
|
|
102
113
|
if (flags.wait?.minutes) {
|
|
103
114
|
let completed;
|
|
104
115
|
let detailsResponse;
|
|
@@ -124,10 +135,12 @@ export default class AgentTestRun extends SfCommand {
|
|
|
124
135
|
});
|
|
125
136
|
// Set exit code to 1 only for execution errors (tests couldn't run properly)
|
|
126
137
|
// Test assertion failures are business logic and should not affect exit code
|
|
127
|
-
|
|
138
|
+
// Only applicable to legacy responses (Agentforce Studio doesn't have test case status)
|
|
139
|
+
if (detailsResponse &&
|
|
140
|
+
'subjectName' in detailsResponse &&
|
|
141
|
+
detailsResponse.testCases.some((tc) => 'status' in tc && tc.status === 'ERROR')) {
|
|
128
142
|
process.exitCode = 1;
|
|
129
143
|
}
|
|
130
|
-
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
|
|
131
144
|
return { ...detailsResponse, status: 'COMPLETED', runId: response.runId };
|
|
132
145
|
}
|
|
133
146
|
else {
|