diff --git a/packages/cli/lang/en.json b/packages/cli/lang/en.json index da8cdfd9ec..1bebb1c26e 100644 --- a/packages/cli/lang/en.json +++ b/packages/cli/lang/en.json @@ -122,51 +122,51 @@ "commands_create_readyPlugin": "You are ready to build a plugin into a Polywrap", "commands_create_readyProtocol": "You are ready to turn your protocol into a Polywrap", "commands_create_settingUp": "Setting everything up...", - "commands_run_options_workflow": "workflow", - "commands_run_options_workflowScript": "Path to workflow script", - "commands_run_options_outputFilePath": "output-file-path", - "commands_run_options_validateScript": "Validate the output of the workflow jobs", - "commands_run_options_validate": "cue-file", - "commands_run_options_outputFile": "Output file path for the workflow result", - "commands_run_options_m_path": "path", - "commands_run_options_m": "Path to the Polywrap Workflow manifest file (default: {default})", - "commands_run_options_jobIds": "jobs", - "commands_run_options_jobs": "Specify ids of jobs that you want to run", - "commands_run_error_validatorNotFound": "validate script not found at: {path}", - "commands_run_error_outputFileMissing": "{option} option missing {argument} argument", - "commands_run_error_clientConfigMissingPath": "{option} option missing {argument} argument", - "commands_run_error_clientConfigModuleMissingExport": "Custom client config module missing named export 'getClientConfig' at {module}", - "commands_run_error_clientConfigInvalidFileExt": "Custom client config file: {module} must be a JS/TS file", - "commands_run_error_clientConfigNotObject": "Custom client config must be an object", - "commands_run_error_redirectsExportNotArray": "Exported redirects must be an array", - "commands_run_error_redirectsItemNotValid": "Redirect at index {index} must be an object with properties 'from' and 'to'", - "commands_run_error_redirectsItemFromNotString": "Redirect property 'from' at index {index} must be a valid wrap:// URI string", - "commands_run_error_redirectsItemToNotStringOrObject": "Redirect property 'to' at index {index} must be a valid wrap:// URI string, or a plugin", - "commands_run_error_redirectsItemToNotValidPlugin": "Redirect property 'to' at index {index} must be a valid plugin instance", - "commands_run_error_pluginsExportNotArray": "Exported plugins must be an array", - "commands_run_error_pluginsItemNotObject": "Plugin at index {index} must be an object with properties 'uri' and 'plugin'", - "commands_run_error_pluginsItemUriNotString": "Plugin property 'uri' at index {index} must be a valid wrap:// URI string", - "commands_run_error_pluginsItemPluginNotObject": "Plugin property 'plugin' at index {index} must be an object with properties 'factory' and 'manifest'", - "commands_run_error_pluginsItemPluginFactoryNotFunction": "Plugin property 'plugin.factory' at index {index} must be a function", - "commands_run_error_pluginsItemPluginManifestNotObject": "Plugin property 'plugin.manifest' at index {index} must be an object", - "commands_run_error_interfacesExportNotArray": "Exported interfaces must be an array", - "commands_run_error_interfacesItemNotObject": "Interface at index {index} must be an object with properties 'interface' and 'implementations'", - "commands_run_error_interfacesItemInterfaceNotString": "Interface property 'interface' at index {index} must be a valid wrap:// URI string", - "commands_run_error_interfacesItemImplementationsNotArray": "Interface property 'implementations' at index {index} must be an array", - "commands_run_error_interfacesItemImplementationsEmpty": "Interface property 'implementations' at index {index} must not be an empty array", - "commands_run_error_interfacesItemImplementationsItemNotString": "Implementation at index ({index}, {implementationIndex}) must be a valid wrap:// URI string", - "commands_run_error_envsExportNotArray": "Exported envs must be an array", - "commands_run_error_envsItemNotObject": "Env at index {index} must be an object with properties 'uri'", - "commands_run_error_envsItemUriNotString": "Env property 'uri' at index {index} must be a valid wrap:// URI string", - "commands_run_error_envsItemModuleNotObject": "Env property 'env' at index {index} must be an object", - "commands_run_description": "Runs Workflows", - "commands_run_error_missingScript": "Required argument {script} is missing", - "commands_run_error_noApi": "API needs to be initialized", - "commands_run_error_readFail": "Failed to read query {query}", - "commands_run_error_unsupportedOutputFileExt": "Unsupported outputFile extention: {outputFileExt}", - "commands_run_error_cueDoesNotExist": "Require cue to run validator, checkout https://cuelang.org/ for more information", - "commands_run_error_noWorkflowScriptFound": "Workflow script not found at path: {path}", - "commands_run_error_noTestEnvFound": "polywrap test-env not found, please run 'polywrap infra up --modules=eth-ens-ipfs'", + "commands_test_options_workflow": "workflow", + "commands_test_options_workflowScript": "Path to workflow script", + "commands_test_options_outputFilePath": "output-file-path", + "commands_test_options_validateScript": "Validate the output of the workflow jobs", + "commands_test_options_validate": "cue-file", + "commands_test_options_outputFile": "Output file path for the test result", + "commands_test_options_m_path": "path", + "commands_test_options_m": "Path to the Polywrap Test manifest file (default: {default})", + "commands_test_options_jobIds": "jobs", + "commands_test_options_jobs": "Specify ids of jobs that you want to run", + "commands_test_error_validatorNotFound": "validate script not found at: {path}", + "commands_test_error_outputFileMissing": "{option} option missing {argument} argument", + "commands_test_error_clientConfigMissingPath": "{option} option missing {argument} argument", + "commands_test_error_clientConfigModuleMissingExport": "Custom client config module missing named export 'getClientConfig' at {module}", + "commands_test_error_clientConfigInvalidFileExt": "Custom client config file: {module} must be a JS/TS file", + "commands_test_error_clientConfigNotObject": "Custom client config must be an object", + "commands_test_error_redirectsExportNotArray": "Exported redirects must be an array", + "commands_test_error_redirectsItemNotValid": "Redirect at index {index} must be an object with properties 'from' and 'to'", + "commands_test_error_redirectsItemFromNotString": "Redirect property 'from' at index {index} must be a valid wrap:// URI string", + "commands_test_error_redirectsItemToNotStringOrObject": "Redirect property 'to' at index {index} must be a valid wrap:// URI string, or a plugin", + "commands_test_error_redirectsItemToNotValidPlugin": "Redirect property 'to' at index {index} must be a valid plugin instance", + "commands_test_error_pluginsExportNotArray": "Exported plugins must be an array", + "commands_test_error_pluginsItemNotObject": "Plugin at index {index} must be an object with properties 'uri' and 'plugin'", + "commands_test_error_pluginsItemUriNotString": "Plugin property 'uri' at index {index} must be a valid wrap:// URI string", + "commands_test_error_pluginsItemPluginNotObject": "Plugin property 'plugin' at index {index} must be an object with properties 'factory' and 'manifest'", + "commands_test_error_pluginsItemPluginFactoryNotFunction": "Plugin property 'plugin.factory' at index {index} must be a function", + "commands_test_error_pluginsItemPluginManifestNotObject": "Plugin property 'plugin.manifest' at index {index} must be an object", + "commands_test_error_interfacesExportNotArray": "Exported interfaces must be an array", + "commands_test_error_interfacesItemNotObject": "Interface at index {index} must be an object with properties 'interface' and 'implementations'", + "commands_test_error_interfacesItemInterfaceNotString": "Interface property 'interface' at index {index} must be a valid wrap:// URI string", + "commands_test_error_interfacesItemImplementationsNotArray": "Interface property 'implementations' at index {index} must be an array", + "commands_test_error_interfacesItemImplementationsEmpty": "Interface property 'implementations' at index {index} must not be an empty array", + "commands_test_error_interfacesItemImplementationsItemNotString": "Implementation at index ({index}, {implementationIndex}) must be a valid wrap:// URI string", + "commands_test_error_envsExportNotArray": "Exported envs must be an array", + "commands_test_error_envsItemNotObject": "Env at index {index} must be an object with properties 'uri'", + "commands_test_error_envsItemUriNotString": "Env property 'uri' at index {index} must be a valid wrap:// URI string", + "commands_test_error_envsItemModuleNotObject": "Env property 'env' at index {index} must be an object", + "commands_test_description": "Execute Tests", + "commands_test_error_missingScript": "Required argument {script} is missing", + "commands_test_error_noApi": "API needs to be initialized", + "commands_test_error_readFail": "Failed to read query {query}", + "commands_test_error_unsupportedOutputFileExt": "Unsupported outputFile extention: {outputFileExt}", + "commands_test_error_cueDoesNotExist": "Require cue to run validator, checkout https://cuelang.org/ for more information", + "commands_test_error_noWorkflowScriptFound": "Workflow script not found at path: {path}", + "commands_test_error_noTestEnvFound": "polywrap test-env not found, please run 'polywrap infra up --modules=eth-ens-ipfs'", "commands_polywrap_error_notACommand": "is not a command", "commands_polywrap_helpPrompt": "Type {command} to view common commands", "commands_manifest_description": "Inspect & Migrade Polywrap Manifests", diff --git a/packages/cli/lang/es.json b/packages/cli/lang/es.json index da8cdfd9ec..1bebb1c26e 100644 --- a/packages/cli/lang/es.json +++ b/packages/cli/lang/es.json @@ -122,51 +122,51 @@ "commands_create_readyPlugin": "You are ready to build a plugin into a Polywrap", "commands_create_readyProtocol": "You are ready to turn your protocol into a Polywrap", "commands_create_settingUp": "Setting everything up...", - "commands_run_options_workflow": "workflow", - "commands_run_options_workflowScript": "Path to workflow script", - "commands_run_options_outputFilePath": "output-file-path", - "commands_run_options_validateScript": "Validate the output of the workflow jobs", - "commands_run_options_validate": "cue-file", - "commands_run_options_outputFile": "Output file path for the workflow result", - "commands_run_options_m_path": "path", - "commands_run_options_m": "Path to the Polywrap Workflow manifest file (default: {default})", - "commands_run_options_jobIds": "jobs", - "commands_run_options_jobs": "Specify ids of jobs that you want to run", - "commands_run_error_validatorNotFound": "validate script not found at: {path}", - "commands_run_error_outputFileMissing": "{option} option missing {argument} argument", - "commands_run_error_clientConfigMissingPath": "{option} option missing {argument} argument", - "commands_run_error_clientConfigModuleMissingExport": "Custom client config module missing named export 'getClientConfig' at {module}", - "commands_run_error_clientConfigInvalidFileExt": "Custom client config file: {module} must be a JS/TS file", - "commands_run_error_clientConfigNotObject": "Custom client config must be an object", - "commands_run_error_redirectsExportNotArray": "Exported redirects must be an array", - "commands_run_error_redirectsItemNotValid": "Redirect at index {index} must be an object with properties 'from' and 'to'", - "commands_run_error_redirectsItemFromNotString": "Redirect property 'from' at index {index} must be a valid wrap:// URI string", - "commands_run_error_redirectsItemToNotStringOrObject": "Redirect property 'to' at index {index} must be a valid wrap:// URI string, or a plugin", - "commands_run_error_redirectsItemToNotValidPlugin": "Redirect property 'to' at index {index} must be a valid plugin instance", - "commands_run_error_pluginsExportNotArray": "Exported plugins must be an array", - "commands_run_error_pluginsItemNotObject": "Plugin at index {index} must be an object with properties 'uri' and 'plugin'", - "commands_run_error_pluginsItemUriNotString": "Plugin property 'uri' at index {index} must be a valid wrap:// URI string", - "commands_run_error_pluginsItemPluginNotObject": "Plugin property 'plugin' at index {index} must be an object with properties 'factory' and 'manifest'", - "commands_run_error_pluginsItemPluginFactoryNotFunction": "Plugin property 'plugin.factory' at index {index} must be a function", - "commands_run_error_pluginsItemPluginManifestNotObject": "Plugin property 'plugin.manifest' at index {index} must be an object", - "commands_run_error_interfacesExportNotArray": "Exported interfaces must be an array", - "commands_run_error_interfacesItemNotObject": "Interface at index {index} must be an object with properties 'interface' and 'implementations'", - "commands_run_error_interfacesItemInterfaceNotString": "Interface property 'interface' at index {index} must be a valid wrap:// URI string", - "commands_run_error_interfacesItemImplementationsNotArray": "Interface property 'implementations' at index {index} must be an array", - "commands_run_error_interfacesItemImplementationsEmpty": "Interface property 'implementations' at index {index} must not be an empty array", - "commands_run_error_interfacesItemImplementationsItemNotString": "Implementation at index ({index}, {implementationIndex}) must be a valid wrap:// URI string", - "commands_run_error_envsExportNotArray": "Exported envs must be an array", - "commands_run_error_envsItemNotObject": "Env at index {index} must be an object with properties 'uri'", - "commands_run_error_envsItemUriNotString": "Env property 'uri' at index {index} must be a valid wrap:// URI string", - "commands_run_error_envsItemModuleNotObject": "Env property 'env' at index {index} must be an object", - "commands_run_description": "Runs Workflows", - "commands_run_error_missingScript": "Required argument {script} is missing", - "commands_run_error_noApi": "API needs to be initialized", - "commands_run_error_readFail": "Failed to read query {query}", - "commands_run_error_unsupportedOutputFileExt": "Unsupported outputFile extention: {outputFileExt}", - "commands_run_error_cueDoesNotExist": "Require cue to run validator, checkout https://cuelang.org/ for more information", - "commands_run_error_noWorkflowScriptFound": "Workflow script not found at path: {path}", - "commands_run_error_noTestEnvFound": "polywrap test-env not found, please run 'polywrap infra up --modules=eth-ens-ipfs'", + "commands_test_options_workflow": "workflow", + "commands_test_options_workflowScript": "Path to workflow script", + "commands_test_options_outputFilePath": "output-file-path", + "commands_test_options_validateScript": "Validate the output of the workflow jobs", + "commands_test_options_validate": "cue-file", + "commands_test_options_outputFile": "Output file path for the test result", + "commands_test_options_m_path": "path", + "commands_test_options_m": "Path to the Polywrap Test manifest file (default: {default})", + "commands_test_options_jobIds": "jobs", + "commands_test_options_jobs": "Specify ids of jobs that you want to run", + "commands_test_error_validatorNotFound": "validate script not found at: {path}", + "commands_test_error_outputFileMissing": "{option} option missing {argument} argument", + "commands_test_error_clientConfigMissingPath": "{option} option missing {argument} argument", + "commands_test_error_clientConfigModuleMissingExport": "Custom client config module missing named export 'getClientConfig' at {module}", + "commands_test_error_clientConfigInvalidFileExt": "Custom client config file: {module} must be a JS/TS file", + "commands_test_error_clientConfigNotObject": "Custom client config must be an object", + "commands_test_error_redirectsExportNotArray": "Exported redirects must be an array", + "commands_test_error_redirectsItemNotValid": "Redirect at index {index} must be an object with properties 'from' and 'to'", + "commands_test_error_redirectsItemFromNotString": "Redirect property 'from' at index {index} must be a valid wrap:// URI string", + "commands_test_error_redirectsItemToNotStringOrObject": "Redirect property 'to' at index {index} must be a valid wrap:// URI string, or a plugin", + "commands_test_error_redirectsItemToNotValidPlugin": "Redirect property 'to' at index {index} must be a valid plugin instance", + "commands_test_error_pluginsExportNotArray": "Exported plugins must be an array", + "commands_test_error_pluginsItemNotObject": "Plugin at index {index} must be an object with properties 'uri' and 'plugin'", + "commands_test_error_pluginsItemUriNotString": "Plugin property 'uri' at index {index} must be a valid wrap:// URI string", + "commands_test_error_pluginsItemPluginNotObject": "Plugin property 'plugin' at index {index} must be an object with properties 'factory' and 'manifest'", + "commands_test_error_pluginsItemPluginFactoryNotFunction": "Plugin property 'plugin.factory' at index {index} must be a function", + "commands_test_error_pluginsItemPluginManifestNotObject": "Plugin property 'plugin.manifest' at index {index} must be an object", + "commands_test_error_interfacesExportNotArray": "Exported interfaces must be an array", + "commands_test_error_interfacesItemNotObject": "Interface at index {index} must be an object with properties 'interface' and 'implementations'", + "commands_test_error_interfacesItemInterfaceNotString": "Interface property 'interface' at index {index} must be a valid wrap:// URI string", + "commands_test_error_interfacesItemImplementationsNotArray": "Interface property 'implementations' at index {index} must be an array", + "commands_test_error_interfacesItemImplementationsEmpty": "Interface property 'implementations' at index {index} must not be an empty array", + "commands_test_error_interfacesItemImplementationsItemNotString": "Implementation at index ({index}, {implementationIndex}) must be a valid wrap:// URI string", + "commands_test_error_envsExportNotArray": "Exported envs must be an array", + "commands_test_error_envsItemNotObject": "Env at index {index} must be an object with properties 'uri'", + "commands_test_error_envsItemUriNotString": "Env property 'uri' at index {index} must be a valid wrap:// URI string", + "commands_test_error_envsItemModuleNotObject": "Env property 'env' at index {index} must be an object", + "commands_test_description": "Execute Tests", + "commands_test_error_missingScript": "Required argument {script} is missing", + "commands_test_error_noApi": "API needs to be initialized", + "commands_test_error_readFail": "Failed to read query {query}", + "commands_test_error_unsupportedOutputFileExt": "Unsupported outputFile extention: {outputFileExt}", + "commands_test_error_cueDoesNotExist": "Require cue to run validator, checkout https://cuelang.org/ for more information", + "commands_test_error_noWorkflowScriptFound": "Workflow script not found at path: {path}", + "commands_test_error_noTestEnvFound": "polywrap test-env not found, please run 'polywrap infra up --modules=eth-ens-ipfs'", "commands_polywrap_error_notACommand": "is not a command", "commands_polywrap_helpPrompt": "Type {command} to view common commands", "commands_manifest_description": "Inspect & Migrade Polywrap Manifests", diff --git a/packages/cli/src/__tests__/e2e/help.spec.ts b/packages/cli/src/__tests__/e2e/help.spec.ts index 0c368a76ec..455940204e 100644 --- a/packages/cli/src/__tests__/e2e/help.spec.ts +++ b/packages/cli/src/__tests__/e2e/help.spec.ts @@ -14,7 +14,7 @@ Commands: create|c Create New Projects deploy|d [options] Deploys Polywrap Projects infra|i [options] Modular Infrastructure-As-Code Orchestrator - run|r [options] Runs Workflows + test|t [options] Execute Tests docgen|o [options] Generate wrapper documentation manifest|m Inspect & Migrade Polywrap Manifests help [command] display help for command diff --git a/packages/cli/src/__tests__/e2e/no-command.spec.ts b/packages/cli/src/__tests__/e2e/no-command.spec.ts index 69289461a6..c870cb2ee6 100644 --- a/packages/cli/src/__tests__/e2e/no-command.spec.ts +++ b/packages/cli/src/__tests__/e2e/no-command.spec.ts @@ -14,7 +14,7 @@ Commands: create|c Create New Projects deploy|d [options] Deploys Polywrap Projects infra|i [options] Modular Infrastructure-As-Code Orchestrator - run|r [options] Runs Workflows + test|t [options] Execute Tests docgen|o [options] Generate wrapper documentation manifest|m Inspect & Migrade Polywrap Manifests help [command] display help for command diff --git a/packages/cli/src/__tests__/e2e/run.spec.ts b/packages/cli/src/__tests__/e2e/test.spec.ts similarity index 92% rename from packages/cli/src/__tests__/e2e/run.spec.ts rename to packages/cli/src/__tests__/e2e/test.spec.ts index 0af143d438..58404d54bc 100644 --- a/packages/cli/src/__tests__/e2e/run.spec.ts +++ b/packages/cli/src/__tests__/e2e/test.spec.ts @@ -9,18 +9,17 @@ import { GetPathToCliTestFiles } from "@polywrap/test-cases"; jest.setTimeout(200000); -const HELP = `Usage: polywrap run|r [options] +const HELP = `Usage: polywrap test|t [options] -Runs Workflows +Execute Tests Options: - -m, --manifest-file Path to the Polywrap Workflow manifest - file (default: polywrap.test.yaml | + -m, --manifest-file Path to the Polywrap Test manifest file + (default: polywrap.test.yaml | polywrap.test.yml) -c, --client-config Add custom configuration to the PolywrapClient - -o, --output-file Output file path for the workflow - result + -o, --output-file Output file path for the test result -j, --jobs Specify ids of jobs that you want to run -v, --verbose Verbose output (default: false) @@ -29,8 +28,8 @@ Options: -h, --help display help for command `; -describe("e2e tests for run command", () => { - const testCaseRoot = path.join(GetPathToCliTestFiles(), "run"); +describe("e2e tests for test command", () => { + const testCaseRoot = path.join(GetPathToCliTestFiles(), "test"); const testCases = fs .readdirSync(testCaseRoot, { withFileTypes: true }) .filter((dirent) => dirent.isDirectory() && !isNaN(parseInt(dirent.name))) @@ -57,7 +56,7 @@ describe("e2e tests for run command", () => { it("Should show help text", async () => { const { exitCode: code, stdout: output, stderr: error } = await runCLI({ - args: ["run", "--help"], + args: ["test", "--help"], cwd: getTestCaseDir(0), }); @@ -76,7 +75,7 @@ describe("e2e tests for run command", () => { for (const [option, errorMessage] of Object.entries(missingOptionArgs)) { it(`Should throw error if params not specified for ${option} option`, async () => { const { exitCode: code, stdout: output, stderr: error } = await runCLI({ - args: ["run", option], + args: ["test", option], cwd: getTestCaseDir(0), cli: polywrapCli, }); @@ -94,7 +93,7 @@ describe("e2e tests for run command", () => { const testCaseDir = getTestCaseDir(0); const args = getCmdArgs(testCaseDir); const { exitCode, stdout, stderr } = await runCLI({ - args: ["run", ...args], + args: ["test", ...args], cwd: testCaseDir, cli: polywrapCli, }); @@ -114,7 +113,7 @@ describe("e2e tests for run command", () => { const testCaseDir = getTestCaseDir(1); const args = getCmdArgs(testCaseDir); const { exitCode, stdout, stderr } = await runCLI({ - args: ["run", ...args], + args: ["test", ...args], cwd: testCaseDir, cli: polywrapCli, }); @@ -134,7 +133,7 @@ describe("e2e tests for run command", () => { const testCaseDir = getTestCaseDir(2); const args = getCmdArgs(testCaseDir); const { exitCode, stdout, stderr } = await runCLI({ - args: ["run", ...args], + args: ["test", ...args], cwd: testCaseDir, cli: polywrapCli, }); @@ -158,7 +157,7 @@ describe("e2e tests for run command", () => { const testCaseDir = getTestCaseDir(3); const args = getCmdArgs(testCaseDir); const { exitCode, stdout, stderr } = await runCLI({ - args: ["run", ...args], + args: ["test", ...args], cwd: testCaseDir, cli: polywrapCli, }); @@ -184,7 +183,7 @@ describe("e2e tests for run command", () => { it("Should suppress the output if --quiet option is specified", async () => { const { exitCode, stdout, stderr } = await runCLI({ - args: ["run", "--quiet" ], + args: ["test", "--quiet" ], cwd: getTestCaseDir(0), cli: polywrapCli, }); @@ -198,7 +197,7 @@ describe("e2e tests for run command", () => { const testCaseDir = getTestCaseDir(4); const args = getCmdArgs(testCaseDir); const { exitCode, stdout, stderr } = await runCLI({ - args: ["run", ...args], + args: ["test", ...args], cwd: testCaseDir, cli: polywrapCli, }); @@ -216,7 +215,7 @@ describe("e2e tests for run command", () => { const testCaseDir = getTestCaseDir(5); const args = getCmdArgs(testCaseDir); const { exitCode, stdout, stderr } = await runCLI({ - args: ["run", ...args], + args: ["test", ...args], cwd: testCaseDir, cli: polywrapCli, }); @@ -238,7 +237,7 @@ describe("e2e tests for run command", () => { const testCaseDir = getTestCaseDir(6); const args = getCmdArgs(testCaseDir); const { exitCode, stderr } = await runCLI({ - args: ["run", ...args], + args: ["test", ...args], cwd: testCaseDir, cli: polywrapCli, }); @@ -253,7 +252,7 @@ describe("e2e tests for run command", () => { const testCaseDir = getTestCaseDir(7); const args = getCmdArgs(testCaseDir); const { exitCode, stdout, stderr } = await runCLI({ - args: ["run", ...args], + args: ["test", ...args], cwd: testCaseDir, cli: polywrapCli, }); @@ -272,7 +271,7 @@ describe("e2e tests for run command", () => { const testCaseDir = getTestCaseDir(8); const args = getCmdArgs(testCaseDir); const { exitCode, stdout, stderr } = await runCLI({ - args: ["run", ...args], + args: ["test", ...args], cwd: testCaseDir, cli: polywrapCli, }); @@ -290,7 +289,7 @@ describe("e2e tests for run command", () => { const testCaseDir = getTestCaseDir(9); const args = getCmdArgs(testCaseDir); const { exitCode, stderr } = await runCLI({ - args: ["run", ...args], + args: ["test", ...args], cwd: testCaseDir, cli: polywrapCli, }); @@ -305,7 +304,7 @@ describe("e2e tests for run command", () => { const testCaseDir = getTestCaseDir(10); const args = getCmdArgs(testCaseDir); const { exitCode, stdout, stderr } = await runCLI({ - args: ["run", ...args], + args: ["test", ...args], cwd: testCaseDir, cli: polywrapCli, }); @@ -324,7 +323,7 @@ describe("e2e tests for run command", () => { it("Should validate expected error", async () => { const testCaseDir = getTestCaseDir(11); const { exitCode, stdout } = await runCLI({ - args: ["run"], + args: ["test"], cwd: testCaseDir, cli: polywrapCli, }); diff --git a/packages/cli/src/commands/deploy.ts b/packages/cli/src/commands/deploy.ts index f712f51768..af39d437ef 100644 --- a/packages/cli/src/commands/deploy.ts +++ b/packages/cli/src/commands/deploy.ts @@ -157,7 +157,9 @@ async function run(options: DeployCommandOptions): Promise { break; default: throw new Error( - intlMsg.commands_run_error_unsupportedOutputFileExt({ outputFileExt }) + intlMsg.commands_test_error_unsupportedOutputFileExt({ + outputFileExt, + }) ); } } diff --git a/packages/cli/src/commands/index.ts b/packages/cli/src/commands/index.ts index 679a6877ff..978a0c4149 100644 --- a/packages/cli/src/commands/index.ts +++ b/packages/cli/src/commands/index.ts @@ -3,6 +3,6 @@ export * from "./codegen"; export * from "./create"; export * from "./deploy"; export * from "./infra"; -export * from "./run"; +export * from "./test"; export * from "./docgen"; export * from "./manifest"; diff --git a/packages/cli/src/commands/run.ts b/packages/cli/src/commands/test.ts similarity index 86% rename from packages/cli/src/commands/run.ts rename to packages/cli/src/commands/test.ts index faa9322b48..2ba80a8750 100644 --- a/packages/cli/src/commands/run.ts +++ b/packages/cli/src/commands/test.ts @@ -35,17 +35,17 @@ type WorkflowCommandOptions = { }; const defaultManifestStr = defaultWorkflowManifest.join(" | "); -const pathStr = intlMsg.commands_run_options_m_path(); +const pathStr = intlMsg.commands_test_options_m_path(); -export const run: Command = { +export const test: Command = { setup: (program: Program) => { program - .command("run") - .alias("r") - .description(intlMsg.commands_run_description()) + .command("test") + .alias("t") + .description(intlMsg.commands_test_description()) .option( `-m, --manifest-file <${pathStr}>`, - intlMsg.commands_run_options_m({ + intlMsg.commands_test_options_m({ default: defaultManifestStr, }) ) @@ -54,12 +54,12 @@ export const run: Command = { `${intlMsg.commands_common_options_config()}` ) .option( - `-o, --output-file <${intlMsg.commands_run_options_outputFilePath()}>`, - `${intlMsg.commands_run_options_outputFile()}` + `-o, --output-file <${intlMsg.commands_test_options_outputFilePath()}>`, + `${intlMsg.commands_test_options_outputFile()}` ) .option( - `-j, --jobs <${intlMsg.commands_run_options_jobIds()}...>`, - intlMsg.commands_run_options_jobs() + `-j, --jobs <${intlMsg.commands_test_options_jobIds()}...>`, + intlMsg.commands_test_options_jobs() ) .option("-v, --verbose", intlMsg.commands_common_options_verbose()) .option("-q, --quiet", intlMsg.commands_common_options_quiet()) @@ -147,7 +147,9 @@ const _run = async (options: WorkflowCommandOptions) => { break; default: throw new Error( - intlMsg.commands_run_error_unsupportedOutputFileExt({ outputFileExt }) + intlMsg.commands_test_error_unsupportedOutputFileExt({ + outputFileExt, + }) ); } } diff --git a/packages/cli/src/lib/helpers/validate-client-config.ts b/packages/cli/src/lib/helpers/validate-client-config.ts index 1a42c9d4a6..c4f82f244b 100644 --- a/packages/cli/src/lib/helpers/validate-client-config.ts +++ b/packages/cli/src/lib/helpers/validate-client-config.ts @@ -12,7 +12,7 @@ export function validateRedirects( redirects: readonly IUriRedirect[] ): void { if (!Array.isArray(redirects)) { - throw new Error(intlMsg.commands_run_error_redirectsExportNotArray()); + throw new Error(intlMsg.commands_test_error_redirectsExportNotArray()); } // Ensure each redirect in the array is valid @@ -21,19 +21,19 @@ export function validateRedirects( if (typeof redirect !== "object" || !redirect.from || !redirect.to) { throw new Error( - intlMsg.commands_run_error_redirectsItemNotValid({ + intlMsg.commands_test_error_redirectsItemNotValid({ index: i.toString(), }) ); } else if (typeof redirect.from !== "string") { throw new Error( - intlMsg.commands_run_error_redirectsItemFromNotString({ + intlMsg.commands_test_error_redirectsItemFromNotString({ index: i.toString(), }) ); } else if (typeof redirect.to !== "string") { throw new Error( - intlMsg.commands_run_error_redirectsItemToNotStringOrObject({ + intlMsg.commands_test_error_redirectsItemToNotStringOrObject({ index: i.toString(), }) ); @@ -45,32 +45,32 @@ export function validateInterfaces( interfaces: readonly InterfaceImplementations[] ): void { if (!Array.isArray(interfaces)) { - throw new Error(intlMsg.commands_run_error_interfacesExportNotArray()); + throw new Error(intlMsg.commands_test_error_interfacesExportNotArray()); } // Ensure each interface in the array is valid for (let i = 0; i < interfaces.length; ++i) { const interfaceImplementations = interfaces[i]; if (typeof interfaceImplementations !== "object") { throw new Error( - intlMsg.commands_run_error_interfacesItemNotObject({ + intlMsg.commands_test_error_interfacesItemNotObject({ index: i.toString(), }) ); } else if (typeof interfaceImplementations.interface !== "string") { throw new Error( - intlMsg.commands_run_error_interfacesItemInterfaceNotString({ + intlMsg.commands_test_error_interfacesItemInterfaceNotString({ index: i.toString(), }) ); } else if (!Array.isArray(interfaceImplementations.implementations)) { throw new Error( - intlMsg.commands_run_error_interfacesItemImplementationsNotArray({ + intlMsg.commands_test_error_interfacesItemImplementationsNotArray({ index: i.toString(), }) ); } else if (interfaceImplementations.implementations.length === 0) { throw new Error( - intlMsg.commands_run_error_interfacesItemImplementationsEmpty({ + intlMsg.commands_test_error_interfacesItemImplementationsEmpty({ index: i.toString(), }) ); @@ -79,7 +79,7 @@ export function validateInterfaces( const implementation = interfaceImplementations.implementations[j]; if (typeof implementation !== "string") { throw new Error( - intlMsg.commands_run_error_interfacesItemImplementationsItemNotString( + intlMsg.commands_test_error_interfacesItemImplementationsItemNotString( { index: i.toString(), implementationIndex: j.toString(), @@ -95,25 +95,25 @@ export function validateEnvs( envs: readonly Env[] ): void { if (!Array.isArray(envs)) { - throw new Error(intlMsg.commands_run_error_envsExportNotArray()); + throw new Error(intlMsg.commands_test_error_envsExportNotArray()); } for (let i = 0; i < envs.length; ++i) { const env = envs[i]; if (typeof env !== "object") { throw new Error( - intlMsg.commands_run_error_envsItemNotObject({ + intlMsg.commands_test_error_envsItemNotObject({ index: i.toString(), }) ); } else if (typeof env.uri !== "string") { throw new Error( - intlMsg.commands_run_error_envsItemUriNotString({ + intlMsg.commands_test_error_envsItemUriNotString({ index: i.toString(), }) ); } else if (!env.env && typeof env.env !== "object") { throw new Error( - intlMsg.commands_run_error_envsItemModuleNotObject({ + intlMsg.commands_test_error_envsItemModuleNotObject({ index: i.toString(), }) ); @@ -123,7 +123,7 @@ export function validateEnvs( export function validateClientConfig(config: Partial): void { if (!config || typeof config !== "object") { - throw new Error(intlMsg.commands_run_error_clientConfigNotObject()); + throw new Error(intlMsg.commands_test_error_clientConfigNotObject()); } if (config.envs) validateEnvs(config.envs); if (config.interfaces) validateInterfaces(config.interfaces); diff --git a/packages/cli/src/lib/helpers/workflow-validator.ts b/packages/cli/src/lib/helpers/workflow-validator.ts index 91c0a3e9ab..b75c9fdd88 100644 --- a/packages/cli/src/lib/helpers/workflow-validator.ts +++ b/packages/cli/src/lib/helpers/workflow-validator.ts @@ -20,7 +20,7 @@ export function validateOutput( logger: Logger ): void { if (!cueExists(logger)) { - console.warn(intlMsg.commands_run_error_cueDoesNotExist()); + console.warn(intlMsg.commands_test_error_cueDoesNotExist()); } const { id, data, error } = output; diff --git a/packages/cli/src/lib/option-parsers/client-config.ts b/packages/cli/src/lib/option-parsers/client-config.ts index 3b7064abe6..80c766daf7 100644 --- a/packages/cli/src/lib/option-parsers/client-config.ts +++ b/packages/cli/src/lib/option-parsers/client-config.ts @@ -18,7 +18,7 @@ export async function parseClientConfigOption( try { builder.add(getTestEnvClientConfig()); } catch (e) { - console.error(intlMsg.commands_run_error_noTestEnvFound()); + console.error(intlMsg.commands_test_error_noTestEnvFound()); process.exit(1); } @@ -31,7 +31,7 @@ export async function parseClientConfigOption( } else if (configPath.endsWith(".ts")) { configModule = await importTypescriptModule(path.resolve(configPath)); } else { - const configsModuleMissingExportMessage = intlMsg.commands_run_error_clientConfigInvalidFileExt( + const configsModuleMissingExportMessage = intlMsg.commands_test_error_clientConfigInvalidFileExt( { module: configPath } ); console.error(configsModuleMissingExportMessage); @@ -39,7 +39,7 @@ export async function parseClientConfigOption( } if (!configModule || !configModule.getCustomConfig) { - const configsModuleMissingExportMessage = intlMsg.commands_run_error_clientConfigModuleMissingExport( + const configsModuleMissingExportMessage = intlMsg.commands_test_error_clientConfigModuleMissingExport( { module: configModule } ); console.error(configsModuleMissingExportMessage); diff --git a/packages/cli/src/lib/option-parsers/index.ts b/packages/cli/src/lib/option-parsers/index.ts index 41098d6c62..75866c1380 100644 --- a/packages/cli/src/lib/option-parsers/index.ts +++ b/packages/cli/src/lib/option-parsers/index.ts @@ -1,6 +1,6 @@ -export * from "./client-config"; -export * from "./codegen"; -export * from "./dir"; -export * from "./log-file"; -export * from "./manifestFile"; -export * from "./run"; +export * from "./client-config"; +export * from "./codegen"; +export * from "./dir"; +export * from "./test"; +export * from "./manifestFile"; +export * from "./log-file"; diff --git a/packages/cli/src/lib/option-parsers/run.ts b/packages/cli/src/lib/option-parsers/test.ts similarity index 84% rename from packages/cli/src/lib/option-parsers/run.ts rename to packages/cli/src/lib/option-parsers/test.ts index cab0a10afa..0e9b07ba45 100644 --- a/packages/cli/src/lib/option-parsers/run.ts +++ b/packages/cli/src/lib/option-parsers/test.ts @@ -7,7 +7,7 @@ export function parseWorkflowScriptPathOption(script: string): string { const absPath = path.resolve(script); if (!fs.existsSync(absPath)) { throw new Error( - intlMsg.commands_run_error_noWorkflowScriptFound({ path: absPath }) + intlMsg.commands_test_error_noWorkflowScriptFound({ path: absPath }) ); } return absPath; diff --git a/packages/cli/src/lib/workflow/util.ts b/packages/cli/src/lib/workflow/util.ts index adba189b4b..2bbdc6df73 100644 --- a/packages/cli/src/lib/workflow/util.ts +++ b/packages/cli/src/lib/workflow/util.ts @@ -28,7 +28,7 @@ export function loadValidationScript( if (!fs.existsSync(cueFilepath)) { console.error( - intlMsg.commands_run_error_validatorNotFound({ + intlMsg.commands_test_error_validatorNotFound({ path: cueFilepath, }) ); diff --git a/packages/test-cases/cases/cli/run/001-yaml-workflow/polywrap.test.yaml b/packages/test-cases/cases/cli/test/001-yaml-workflow/polywrap.test.yaml similarity index 100% rename from packages/test-cases/cases/cli/run/001-yaml-workflow/polywrap.test.yaml rename to packages/test-cases/cases/cli/test/001-yaml-workflow/polywrap.test.yaml diff --git a/packages/test-cases/cases/cli/run/002-json-workflow/cmd.json b/packages/test-cases/cases/cli/test/002-json-workflow/cmd.json similarity index 100% rename from packages/test-cases/cases/cli/run/002-json-workflow/cmd.json rename to packages/test-cases/cases/cli/test/002-json-workflow/cmd.json diff --git a/packages/test-cases/cases/cli/run/002-json-workflow/polywrap.test.json b/packages/test-cases/cases/cli/test/002-json-workflow/polywrap.test.json similarity index 100% rename from packages/test-cases/cases/cli/run/002-json-workflow/polywrap.test.json rename to packages/test-cases/cases/cli/test/002-json-workflow/polywrap.test.json diff --git a/packages/test-cases/cases/cli/run/003-json-output/cmd.json b/packages/test-cases/cases/cli/test/003-json-output/cmd.json similarity index 100% rename from packages/test-cases/cases/cli/run/003-json-output/cmd.json rename to packages/test-cases/cases/cli/test/003-json-output/cmd.json diff --git a/packages/test-cases/cases/cli/run/003-json-output/polywrap.test.yaml b/packages/test-cases/cases/cli/test/003-json-output/polywrap.test.yaml similarity index 100% rename from packages/test-cases/cases/cli/run/003-json-output/polywrap.test.yaml rename to packages/test-cases/cases/cli/test/003-json-output/polywrap.test.yaml diff --git a/packages/test-cases/cases/cli/run/004-yaml-output/cmd.json b/packages/test-cases/cases/cli/test/004-yaml-output/cmd.json similarity index 100% rename from packages/test-cases/cases/cli/run/004-yaml-output/cmd.json rename to packages/test-cases/cases/cli/test/004-yaml-output/cmd.json diff --git a/packages/test-cases/cases/cli/run/004-yaml-output/polywrap.test.yaml b/packages/test-cases/cases/cli/test/004-yaml-output/polywrap.test.yaml similarity index 100% rename from packages/test-cases/cases/cli/run/004-yaml-output/polywrap.test.yaml rename to packages/test-cases/cases/cli/test/004-yaml-output/polywrap.test.yaml diff --git a/packages/test-cases/cases/cli/run/005-validate/polywrap.test.yaml b/packages/test-cases/cases/cli/test/005-validate/polywrap.test.yaml similarity index 100% rename from packages/test-cases/cases/cli/run/005-validate/polywrap.test.yaml rename to packages/test-cases/cases/cli/test/005-validate/polywrap.test.yaml diff --git a/packages/test-cases/cases/cli/run/005-validate/validator.cue b/packages/test-cases/cases/cli/test/005-validate/validator.cue similarity index 100% rename from packages/test-cases/cases/cli/run/005-validate/validator.cue rename to packages/test-cases/cases/cli/test/005-validate/validator.cue diff --git a/packages/test-cases/cases/cli/run/006-validation-fail/polywrap.test.yaml b/packages/test-cases/cases/cli/test/006-validation-fail/polywrap.test.yaml similarity index 100% rename from packages/test-cases/cases/cli/run/006-validation-fail/polywrap.test.yaml rename to packages/test-cases/cases/cli/test/006-validation-fail/polywrap.test.yaml diff --git a/packages/test-cases/cases/cli/run/006-validation-fail/validator.cue b/packages/test-cases/cases/cli/test/006-validation-fail/validator.cue similarity index 100% rename from packages/test-cases/cases/cli/run/006-validation-fail/validator.cue rename to packages/test-cases/cases/cli/test/006-validation-fail/validator.cue diff --git a/packages/test-cases/cases/cli/run/007-invalid-manifest/polywrap.test.yaml b/packages/test-cases/cases/cli/test/007-invalid-manifest/polywrap.test.yaml similarity index 100% rename from packages/test-cases/cases/cli/run/007-invalid-manifest/polywrap.test.yaml rename to packages/test-cases/cases/cli/test/007-invalid-manifest/polywrap.test.yaml diff --git a/packages/test-cases/cases/cli/run/008-custom-config/cmd.json b/packages/test-cases/cases/cli/test/008-custom-config/cmd.json similarity index 100% rename from packages/test-cases/cases/cli/run/008-custom-config/cmd.json rename to packages/test-cases/cases/cli/test/008-custom-config/cmd.json diff --git a/packages/test-cases/cases/cli/run/008-custom-config/config.ts b/packages/test-cases/cases/cli/test/008-custom-config/config.ts similarity index 100% rename from packages/test-cases/cases/cli/run/008-custom-config/config.ts rename to packages/test-cases/cases/cli/test/008-custom-config/config.ts diff --git a/packages/test-cases/cases/cli/run/008-custom-config/polywrap.test.yaml b/packages/test-cases/cases/cli/test/008-custom-config/polywrap.test.yaml similarity index 100% rename from packages/test-cases/cases/cli/run/008-custom-config/polywrap.test.yaml rename to packages/test-cases/cases/cli/test/008-custom-config/polywrap.test.yaml diff --git a/packages/test-cases/cases/cli/run/008-custom-config/validator.cue b/packages/test-cases/cases/cli/test/008-custom-config/validator.cue similarity index 100% rename from packages/test-cases/cases/cli/run/008-custom-config/validator.cue rename to packages/test-cases/cases/cli/test/008-custom-config/validator.cue diff --git a/packages/test-cases/cases/cli/run/009-nested-props/polywrap.test.yaml b/packages/test-cases/cases/cli/test/009-nested-props/polywrap.test.yaml similarity index 100% rename from packages/test-cases/cases/cli/run/009-nested-props/polywrap.test.yaml rename to packages/test-cases/cases/cli/test/009-nested-props/polywrap.test.yaml diff --git a/packages/test-cases/cases/cli/run/009-nested-props/validator.cue b/packages/test-cases/cases/cli/test/009-nested-props/validator.cue similarity index 100% rename from packages/test-cases/cases/cli/run/009-nested-props/validator.cue rename to packages/test-cases/cases/cli/test/009-nested-props/validator.cue diff --git a/packages/test-cases/cases/cli/run/010-reserved-job-names/polywrap.test.yaml b/packages/test-cases/cases/cli/test/010-reserved-job-names/polywrap.test.yaml similarity index 100% rename from packages/test-cases/cases/cli/run/010-reserved-job-names/polywrap.test.yaml rename to packages/test-cases/cases/cli/test/010-reserved-job-names/polywrap.test.yaml diff --git a/packages/test-cases/cases/cli/run/011-id-subset/cmd.json b/packages/test-cases/cases/cli/test/011-id-subset/cmd.json similarity index 100% rename from packages/test-cases/cases/cli/run/011-id-subset/cmd.json rename to packages/test-cases/cases/cli/test/011-id-subset/cmd.json diff --git a/packages/test-cases/cases/cli/run/011-id-subset/polywrap.test.yaml b/packages/test-cases/cases/cli/test/011-id-subset/polywrap.test.yaml similarity index 100% rename from packages/test-cases/cases/cli/run/011-id-subset/polywrap.test.yaml rename to packages/test-cases/cases/cli/test/011-id-subset/polywrap.test.yaml diff --git a/packages/test-cases/cases/cli/run/011-id-subset/validator.cue b/packages/test-cases/cases/cli/test/011-id-subset/validator.cue similarity index 100% rename from packages/test-cases/cases/cli/run/011-id-subset/validator.cue rename to packages/test-cases/cases/cli/test/011-id-subset/validator.cue diff --git a/packages/test-cases/cases/cli/run/012-validation-error-expected/polywrap.test.yaml b/packages/test-cases/cases/cli/test/012-validation-error-expected/polywrap.test.yaml similarity index 100% rename from packages/test-cases/cases/cli/run/012-validation-error-expected/polywrap.test.yaml rename to packages/test-cases/cases/cli/test/012-validation-error-expected/polywrap.test.yaml diff --git a/packages/test-cases/cases/cli/run/012-validation-error-expected/validator.cue b/packages/test-cases/cases/cli/test/012-validation-error-expected/validator.cue similarity index 100% rename from packages/test-cases/cases/cli/run/012-validation-error-expected/validator.cue rename to packages/test-cases/cases/cli/test/012-validation-error-expected/validator.cue diff --git a/packages/test-cases/cases/cli/run/run-test-wrapper/package.json b/packages/test-cases/cases/cli/test/run-test-wrapper/package.json similarity index 100% rename from packages/test-cases/cases/cli/run/run-test-wrapper/package.json rename to packages/test-cases/cases/cli/test/run-test-wrapper/package.json diff --git a/packages/test-cases/cases/cli/run/run-test-wrapper/polywrap.build.yaml b/packages/test-cases/cases/cli/test/run-test-wrapper/polywrap.build.yaml similarity index 100% rename from packages/test-cases/cases/cli/run/run-test-wrapper/polywrap.build.yaml rename to packages/test-cases/cases/cli/test/run-test-wrapper/polywrap.build.yaml diff --git a/packages/test-cases/cases/cli/run/run-test-wrapper/polywrap.yaml b/packages/test-cases/cases/cli/test/run-test-wrapper/polywrap.yaml similarity index 100% rename from packages/test-cases/cases/cli/run/run-test-wrapper/polywrap.yaml rename to packages/test-cases/cases/cli/test/run-test-wrapper/polywrap.yaml diff --git a/packages/test-cases/cases/cli/run/run-test-wrapper/src/index.ts b/packages/test-cases/cases/cli/test/run-test-wrapper/src/index.ts similarity index 100% rename from packages/test-cases/cases/cli/run/run-test-wrapper/src/index.ts rename to packages/test-cases/cases/cli/test/run-test-wrapper/src/index.ts diff --git a/packages/test-cases/cases/cli/run/run-test-wrapper/src/schema.graphql b/packages/test-cases/cases/cli/test/run-test-wrapper/src/schema.graphql similarity index 100% rename from packages/test-cases/cases/cli/run/run-test-wrapper/src/schema.graphql rename to packages/test-cases/cases/cli/test/run-test-wrapper/src/schema.graphql