diff --git a/src/BaseCommand.js b/src/BaseCommand.js index 83c1e5b6d..54a8326cd 100644 --- a/src/BaseCommand.js +++ b/src/BaseCommand.js @@ -66,7 +66,7 @@ class BaseCommand extends Command { } async getAppExtConfigs (flags, options = {}) { - const all = (await this.getFullConfig(options)).all + const all = (await this.getFullConfig(options, flags)).all // default case: no flags, return all let ret = all @@ -96,41 +96,41 @@ class BaseCommand extends Command { return ret } - async getRuntimeManifestConfigFile (implName) { + async getRuntimeManifestConfigFile (implName, flags) { let configKey if (implName === APPLICATION_CONFIG_KEY) { configKey = APPLICATION_CONFIG_KEY } else { configKey = `${EXTENSIONS_CONFIG_KEY}.${implName}` } - let configData = await this.getConfigFileForKey(`${configKey}.runtimeManifest`) + let configData = await this.getConfigFileForKey(`${configKey}.runtimeManifest`, flags) if (!configData.file) { // first action manifest is not defined - configData = await this.getConfigFileForKey(`${configKey}`) + configData = await this.getConfigFileForKey(`${configKey}`, flags) configData.key = configData.key + '.runtimeManifest' } return configData } - async getEventsConfigFile (implName) { + async getEventsConfigFile (implName, flags) { let configKey if (implName === APPLICATION_CONFIG_KEY) { configKey = APPLICATION_CONFIG_KEY } else { configKey = `${EXTENSIONS_CONFIG_KEY}.${implName}` } - let configData = await this.getConfigFileForKey(`${configKey}.events`) + let configData = await this.getConfigFileForKey(`${configKey}.events`, flags) if (!configData.file) { // first events manifest is not defined - configData = await this.getConfigFileForKey(`${configKey}`) + configData = await this.getConfigFileForKey(`${configKey}`, flags) configData.key = configData.key + '.events' } return configData } - async getConfigFileForKey (fullKey) { + async getConfigFileForKey (fullKey, flags = {}) { // NOTE: the index returns undefined if the key is loaded from a legacy configuration file - const fullConfig = await this.getFullConfig() + const fullConfig = await this.getFullConfig({}, flags) // full key like 'extensions.dx/excshell/1.runtimeManifest' // returns { key: relKey, file: configFile} const configData = fullConfig.includeIndex[fullKey] @@ -142,12 +142,12 @@ class BaseCommand extends Command { return configData || {} } - async getFullConfig (options = {}) { - // validate appConfig defaults to false for now - const validateAppConfig = options.validateAppConfig === true + async getFullConfig (options = {}, flags = {}) { + // validate appConfig defaults to true unless flag is explicitly set to off + const validateAppConfig = flags['config-validation'] !== false + aioLogger.debug(`validateAppConfig=${validateAppConfig}`) if (!this.appConfig) { - // this will explicitly set validateAppConfig=false if not set this.appConfig = await appConfig.load({ ...options, validateAppConfig }) } return this.appConfig @@ -191,7 +191,12 @@ class BaseCommand extends Command { BaseCommand.flags = { verbose: Flags.boolean({ char: 'v', description: 'Verbose output' }), - version: Flags.boolean({ description: 'Show version' }) + version: Flags.boolean({ description: 'Show version' }), + 'config-validation': Flags.boolean({ + description: '[default: true] Validate the app configuration file(s) before continuing.', + default: true, + allowNo: true + }) } BaseCommand.args = {} diff --git a/src/commands/app/add/action.js b/src/commands/app/add/action.js index 56f6c4afd..f7f034f42 100644 --- a/src/commands/app/add/action.js +++ b/src/commands/app/add/action.js @@ -32,7 +32,7 @@ class AddActionCommand extends TemplatesCommand { const config = entries[0][1] const actionFolder = path.relative(config.root, config.actions.src) - const configData = await this.getRuntimeManifestConfigFile(configName) + const configData = await this.getRuntimeManifestConfigFile(configName, flags) const projectOrgId = aioConfigLoader.get('project.org.id') if (!projectOrgId) { diff --git a/src/commands/app/add/event.js b/src/commands/app/add/event.js index 218e5545c..a6f796329 100644 --- a/src/commands/app/add/event.js +++ b/src/commands/app/add/event.js @@ -31,8 +31,8 @@ class AddEventCommand extends TemplatesCommand { const configName = entries[0][0] const config = entries[0][1] const actionFolder = path.relative(config.root, config.actions.src) - const runtimeManifestData = await this.getRuntimeManifestConfigFile(configName) - const eventsData = await this.getEventsConfigFile(configName) + const runtimeManifestData = await this.getRuntimeManifestConfigFile(configName, flags) + const eventsData = await this.getEventsConfigFile(configName, flags) const templateOptions = { 'skip-prompt': false, 'action-folder': actionFolder, diff --git a/src/commands/app/add/extension.js b/src/commands/app/add/extension.js index a7e7aea3b..7f0ec266f 100644 --- a/src/commands/app/add/extension.js +++ b/src/commands/app/add/extension.js @@ -24,7 +24,7 @@ class AddExtensionCommand extends TemplatesCommand { this.error('--extension= must also be provided when using --yes') } - const fullConfig = await this.getFullConfig({ allowNoImpl: true }) + const fullConfig = await this.getFullConfig({ allowNoImpl: true }, flags) const alreadyImplemented = fullConfig.implements if (flags.extension) { diff --git a/src/commands/app/add/web-assets.js b/src/commands/app/add/web-assets.js index 00d619b62..e25cc8819 100644 --- a/src/commands/app/add/web-assets.js +++ b/src/commands/app/add/web-assets.js @@ -19,7 +19,7 @@ class AddWebAssetsCommand extends TemplatesCommand { const { flags } = await this.parse(AddWebAssetsCommand) aioLogger.debug(`add web-assets with flags: ${JSON.stringify(flags)}`) - const projectName = (await this.getFullConfig()).packagejson.name + const projectName = (await this.getFullConfig({}, flags)).packagejson.name // guaranteed to have at least one, otherwise would throw in config load or in matching the ext name const entries = Object.entries(await this.getAppExtConfigs(flags)) if (entries.length > 1) { diff --git a/src/commands/app/config/get/log-forwarding.js b/src/commands/app/config/get/log-forwarding.js index 7962e4589..60e8fbaf2 100644 --- a/src/commands/app/config/get/log-forwarding.js +++ b/src/commands/app/config/get/log-forwarding.js @@ -15,7 +15,8 @@ const { setRuntimeApiHostAndAuthHandler } = require('../../../../lib/auth-helper class LogForwardingCommand extends BaseCommand { async run () { - let aioConfig = (await this.getFullConfig()).aio + const { flags } = await this.parse(LogForwardingCommand) + let aioConfig = (await this.getFullConfig({}, flags)).aio aioConfig = setRuntimeApiHostAndAuthHandler(aioConfig) const lf = await LogForwarding.init(aioConfig) @@ -50,4 +51,8 @@ class LogForwardingCommand extends BaseCommand { LogForwardingCommand.description = 'Get log forwarding destination configuration' LogForwardingCommand.aliases = ['app:config:get:log-forwarding', 'app:config:get:lf'] +LogForwardingCommand.flags = { + ...BaseCommand.flags +} + module.exports = LogForwardingCommand diff --git a/src/commands/app/config/get/log-forwarding/errors.js b/src/commands/app/config/get/log-forwarding/errors.js index f35ab16df..175e9150b 100644 --- a/src/commands/app/config/get/log-forwarding/errors.js +++ b/src/commands/app/config/get/log-forwarding/errors.js @@ -16,8 +16,9 @@ const { setRuntimeApiHostAndAuthHandler } = require('../../../../../lib/auth-hel class ErrorsCommand extends BaseCommand { async run () { + const { flags } = await this.parse(ErrorsCommand) const spinner = ora() - const lf = await this.getLogForwarding() + const lf = await this.getLogForwarding(flags) spinner.start('Checking for errors...') const res = await lf.getErrors() const destinationMessage = res.configured_forwarder !== undefined @@ -30,8 +31,8 @@ class ErrorsCommand extends BaseCommand { } } - async getLogForwarding () { - let aioConfig = (await this.getFullConfig()).aio + async getLogForwarding (flags) { + let aioConfig = (await this.getFullConfig({}, flags)).aio aioConfig = setRuntimeApiHostAndAuthHandler(aioConfig) const runtimeConfig = aioConfig.runtime @@ -46,5 +47,8 @@ class ErrorsCommand extends BaseCommand { ErrorsCommand.description = 'Get log forwarding errors' ErrorsCommand.aliases = ['app:config:get:log-forwarding:errors', 'app:config:get:lf:errors'] +ErrorsCommand.flags = { + ...BaseCommand.flags +} module.exports = ErrorsCommand diff --git a/src/commands/app/config/set/log-forwarding.js b/src/commands/app/config/set/log-forwarding.js index b64de2210..f307dc740 100644 --- a/src/commands/app/config/set/log-forwarding.js +++ b/src/commands/app/config/set/log-forwarding.js @@ -16,7 +16,8 @@ const { setRuntimeApiHostAndAuthHandler } = require('../../../../lib/auth-helper class LogForwardingCommand extends BaseCommand { async run () { - let aioConfig = (await this.getFullConfig()).aio + const { flags } = await this.parse(LogForwardingCommand) + let aioConfig = (await this.getFullConfig({}, flags)).aio aioConfig = setRuntimeApiHostAndAuthHandler(aioConfig) const lf = await LogForwarding.init(aioConfig) @@ -50,5 +51,8 @@ class LogForwardingCommand extends BaseCommand { LogForwardingCommand.description = 'Set log forwarding destination configuration' LogForwardingCommand.aliases = ['app:config:set:log-forwarding', 'app:config:set:lf'] +LogForwardingCommand.flags = { + ...BaseCommand.flags +} module.exports = LogForwardingCommand diff --git a/src/commands/app/delete/action.js b/src/commands/app/delete/action.js index 585f8684d..d04dc5afd 100644 --- a/src/commands/app/delete/action.js +++ b/src/commands/app/delete/action.js @@ -30,8 +30,8 @@ class DeleteActionCommand extends BaseCommand { this.error(' must also be provided when using --yes') } - const fullConfig = await this.getFullConfig() - const { actions, actionsByImpl } = await this.getAllActions(fullConfig) + const fullConfig = await this.getFullConfig({}, flags) + const { actions, actionsByImpl } = await this.getAllActions(fullConfig, flags) if (actions.length <= 0) { this.error('There are no actions in this project!') } @@ -108,7 +108,7 @@ class DeleteActionCommand extends BaseCommand { ))) } - async getAllActions (config) { + async getAllActions (config, flags = {}) { const actions = [] const actionsByImpl = {} const allConfigEntries = Object.entries(config.all) @@ -121,7 +121,7 @@ class DeleteActionCommand extends BaseCommand { for (const [actionName, action] of actionEntries) { const fullActionName = `${pkgName}/${actionName}` const startKey = implName === 'application' ? 'application' : `extensions.${implName}` - const configData = await this.getConfigFileForKey(`${startKey}.runtimeManifest.packages.${pkgName}.actions.${actionName}`) + const configData = await this.getConfigFileForKey(`${startKey}.runtimeManifest.packages.${pkgName}.actions.${actionName}`, flags) const actionObj = { // assumes path is not relative path: action.function, @@ -157,13 +157,13 @@ DeleteActionCommand.flags = { } DeleteActionCommand.args = - { - 'action-name': Args.string({ - description: 'Action `pkg/name` to delete, you can specify multiple actions via a comma separated list', - default: '', - required: false - }) - } +{ + 'action-name': Args.string({ + description: 'Action `pkg/name` to delete, you can specify multiple actions via a comma separated list', + default: '', + required: false + }) +} DeleteActionCommand.aliases = ['app:delete:actions'] diff --git a/src/commands/app/delete/extension.js b/src/commands/app/delete/extension.js index 221316b7c..9dfee888d 100644 --- a/src/commands/app/delete/extension.js +++ b/src/commands/app/delete/extension.js @@ -28,7 +28,7 @@ class DeleteExtensionCommand extends BaseCommand { this.error('--extension= must also be provided when using --yes') } - const fullConfig = await this.getFullConfig({ allowNoImpl: true }) + const fullConfig = await this.getFullConfig({ allowNoImpl: true }, flags) const configs = await this.selectOrGetConfigsToDelete(flags, fullConfig) const resConfirm = await this.prompt([ @@ -44,7 +44,7 @@ class DeleteExtensionCommand extends BaseCommand { this.error('aborting..') } - await this.deleteImplementations(configs) + await this.deleteImplementations(configs, flags) this.log(chalk.bold(chalk.green( `✔ Successfully deleted implementation(s) '${Object.keys(configs)}'` + EOL + @@ -71,7 +71,7 @@ class DeleteExtensionCommand extends BaseCommand { return await this.getAppExtConfigs(flags) } - async deleteImplementations (configs) { + async deleteImplementations (configs, flags) { for (const [id, c] of Object.entries(configs)) { // delete actions if (c.app.hasBackend) { @@ -89,12 +89,12 @@ class DeleteExtensionCommand extends BaseCommand { // delete config // try to find another config file => case of init extension in another folder const configKey = id === 'application' ? 'application' : `extensions.${id}` - const configDataOp = await this.getConfigFileForKey(configKey + '.operations') + const configDataOp = await this.getConfigFileForKey(configKey + '.operations', flags) if (configDataOp.file) { fs.removeSync(configDataOp.file) } // delete config in parent config file - const configData = await this.getConfigFileForKey(configKey) + const configData = await this.getConfigFileForKey(configKey, flags) deleteUserConfig(configData) } } diff --git a/src/commands/app/delete/web-assets.js b/src/commands/app/delete/web-assets.js index 4e72c3193..ccd9a773b 100644 --- a/src/commands/app/delete/web-assets.js +++ b/src/commands/app/delete/web-assets.js @@ -25,7 +25,7 @@ class DeleteWebAssetsCommand extends BaseCommand { aioLogger.debug(`deleting web assets from the project, using flags: ${JSON.stringify(flags)}`) - const fullConfig = await this.getFullConfig() + const fullConfig = await this.getFullConfig({}, flags) const webAssetsByImpl = this.getAllWebAssets(fullConfig) if (!webAssetsByImpl) { this.error('web-assets not found') diff --git a/src/commands/app/deploy.js b/src/commands/app/deploy.js index 03fa59bb2..ecb4261ef 100644 --- a/src/commands/app/deploy.js +++ b/src/commands/app/deploy.js @@ -57,7 +57,7 @@ class Deploy extends BuildCommand { const spinner = ora() try { - const { aio: aioConfig, packagejson: packageJson } = await this.getFullConfig() + const { aio: aioConfig, packagejson: packageJson } = await this.getFullConfig({}, flags) const cliDetails = await getAccessToken({ useCachedToken: !flags.publish }) const appInfo = { name: packageJson.name, diff --git a/src/commands/app/get-url.js b/src/commands/app/get-url.js index 0e304dade..a58b39369 100644 --- a/src/commands/app/get-url.js +++ b/src/commands/app/get-url.js @@ -30,7 +30,7 @@ class GetUrlCommand extends BaseCommand { options.cdn = flags.cdn const urls = {} - const fullConfig = await this.getFullConfig() + const fullConfig = await this.getFullConfig({}, flags) if (options.action) { let action // search for action @@ -107,9 +107,9 @@ GetUrlCommand.flags = { } GetUrlCommand.args = - { - action: Args.string({ - }) - } +{ + action: Args.string({ + }) +} module.exports = GetUrlCommand diff --git a/src/commands/app/info.js b/src/commands/app/info.js index c63a2cf7a..c9d9a68aa 100644 --- a/src/commands/app/info.js +++ b/src/commands/app/info.js @@ -19,7 +19,7 @@ class Info extends BaseCommand { async run () { // cli input const { flags } = await this.parse(Info) - const appConfig = deepCopy(await this.getFullConfig({ allowNoImpl: true })) + const appConfig = deepCopy(await this.getFullConfig({ allowNoImpl: true }, flags)) // includes .env secret delete all aio config for now delete appConfig.aio diff --git a/src/commands/app/logs.js b/src/commands/app/logs.js index d0af82d6b..20a64edbe 100644 --- a/src/commands/app/logs.js +++ b/src/commands/app/logs.js @@ -36,7 +36,7 @@ class Logs extends BaseCommand { async run () { const { flags } = await this.parse(Logs) - const fullConfig = await this.getFullConfig() + const fullConfig = await this.getFullConfig({}, flags) // has any backend const hasAnyBackend = Object.values(fullConfig.all).reduce((hasBackend, config) => hasBackend && config.app.hasBackend, true) diff --git a/src/commands/app/pack.js b/src/commands/app/pack.js index 89e46e905..e51789a3e 100644 --- a/src/commands/app/pack.js +++ b/src/commands/app/pack.js @@ -383,11 +383,11 @@ Pack.flags = { } Pack.args = - { - path: Args.string({ - description: 'Path to the app directory to package', - default: '.' - }) - } +{ + path: Args.string({ + description: 'Path to the app directory to package', + default: '.' + }) +} module.exports = Pack diff --git a/src/commands/app/test.js b/src/commands/app/test.js index a02e6c5e1..81b57d5ef 100644 --- a/src/commands/app/test.js +++ b/src/commands/app/test.js @@ -31,7 +31,7 @@ class Test extends BaseCommand { unit = true } - const buildConfigs = await this.getAppExtConfigs({ extension }) + const buildConfigs = await this.getAppExtConfigs(flags, { extension }) aioLogger.debug(`run buildConfigs:${JSON.stringify(buildConfigs, null, 2)}`) const totalResults = [] @@ -202,6 +202,7 @@ class Test extends BaseCommand { } Test.flags = { + ...BaseCommand.flags, extension: Flags.string({ char: 'e', description: 'the extension(s) to test', diff --git a/src/commands/app/undeploy.js b/src/commands/app/undeploy.js index d1609b785..aca2ecc05 100644 --- a/src/commands/app/undeploy.js +++ b/src/commands/app/undeploy.js @@ -51,7 +51,7 @@ class Undeploy extends BaseCommand { const spinner = ora() try { - const { aio: aioConfig, packagejson: packageJson } = await this.getFullConfig() + const { aio: aioConfig, packagejson: packageJson } = await this.getFullConfig({}, flags) const cliDetails = await getAccessToken({ useCachedToken: !flags.unpublish }) const appInfo = { name: packageJson.name, diff --git a/test/BaseCommand.test.js b/test/BaseCommand.test.js index 3cb5a8941..c77d56f00 100644 --- a/test/BaseCommand.test.js +++ b/test/BaseCommand.test.js @@ -123,15 +123,22 @@ describe('getFullConfig', () => { mockConfigLoader.load.mockResolvedValue({ a: 'hello' }) const config = await cmd.getFullConfig({ someOptions: {} }) expect(config).toEqual({ a: 'hello' }) - expect(mockConfigLoader.load).toHaveBeenCalledWith({ someOptions: {}, validateAppConfig: false }) + expect(mockConfigLoader.load).toHaveBeenCalledWith({ someOptions: {}, validateAppConfig: true }) }) - test('with validateAppConfig=true', async () => { + test('with config-validation=true', async () => { const cmd = new TheCommand() mockConfigLoader.load.mockResolvedValue({ a: 'hello' }) - const config = await cmd.getFullConfig({ someOptions: {}, validateAppConfig: true }) + const config = await cmd.getFullConfig({ someOptions: {} }, { 'config-validation': true }) expect(config).toEqual({ a: 'hello' }) expect(mockConfigLoader.load).toHaveBeenCalledWith({ someOptions: {}, validateAppConfig: true }) }) + test('with config-validation=false', async () => { + const cmd = new TheCommand() + mockConfigLoader.load.mockResolvedValue({ a: 'hello' }) + const config = await cmd.getFullConfig({ someOptions: {} }, { 'config-validation': false }) + expect(config).toEqual({ a: 'hello' }) + expect(mockConfigLoader.load).toHaveBeenCalledWith({ someOptions: {}, validateAppConfig: false }) + }) }) describe('getConfigFileForKey', () => { @@ -139,7 +146,7 @@ describe('getConfigFileForKey', () => { mockConfigLoader.load.mockResolvedValue(getMockConfig('exc', {})) const cmd = new TheCommand() expect(await cmd.getConfigFileForKey('notexist.key.abc')).toEqual({}) - expect(mockConfigLoader.load).toHaveBeenCalledWith({ validateAppConfig: false }) + expect(mockConfigLoader.load).toHaveBeenCalledWith({ validateAppConfig: true }) }) test('returns file and key if found', async () => { const config = getMockConfig('exc', {}) @@ -154,7 +161,7 @@ describe('getRuntimeManifestConfigFile', () => { mockConfigLoader.load.mockResolvedValue(getMockConfig('app-no-actions', {})) const cmd = new TheCommand() expect(await cmd.getRuntimeManifestConfigFile('application')).toEqual({ file: 'app.config.yaml', key: 'application.runtimeManifest' }) - expect(mockConfigLoader.load).toHaveBeenCalledWith({ validateAppConfig: false }) + expect(mockConfigLoader.load).toHaveBeenCalledWith({ validateAppConfig: true }) }) test('multiple implementations', async () => { const config = getMockConfig('app-exc-nui', {}) @@ -171,7 +178,7 @@ describe('getEventsConfigFile', () => { mockConfigLoader.load.mockResolvedValue(getMockConfig('app-no-actions', {})) const cmd = new TheCommand() expect(await cmd.getEventsConfigFile('application')).toEqual({ file: 'app.config.yaml', key: 'application.events' }) - expect(mockConfigLoader.load).toHaveBeenCalledWith({ validateAppConfig: false }) + expect(mockConfigLoader.load).toHaveBeenCalledWith({ validateAppConfig: true }) }) test('multiple implementations', async () => { const config = getMockConfig('app-exc-nui', {}) @@ -189,13 +196,20 @@ describe('getAppExtConfigs', () => { mockConfigLoader.load.mockResolvedValue(config) const cmd = new TheCommand() expect(await cmd.getAppExtConfigs({})).toEqual(config.all) - expect(mockConfigLoader.load).toHaveBeenCalledWith({ validateAppConfig: false }) + expect(mockConfigLoader.load).toHaveBeenCalledWith({ validateAppConfig: true }) }) test('with options', async () => { const config = getMockConfig('app-exc-nui', {}) mockConfigLoader.load.mockResolvedValue(config) const cmd = new TheCommand() expect(await cmd.getAppExtConfigs({}, { some: 'options' })).toEqual(config.all) + expect(mockConfigLoader.load).toHaveBeenCalledWith({ some: 'options', validateAppConfig: true }) + }) + test('with flag validateAppConfig=false', async () => { + const config = getMockConfig('app-exc-nui', {}) + mockConfigLoader.load.mockResolvedValue(config) + const cmd = new TheCommand() + expect(await cmd.getAppExtConfigs({ 'config-validation': false }, { some: 'options' })).toEqual(config.all) expect(mockConfigLoader.load).toHaveBeenCalledWith({ some: 'options', validateAppConfig: false }) }) test('-e exc -e asset', async () => { diff --git a/test/commands/app/add/event.test.js b/test/commands/app/add/event.test.js index 48cf2c7fa..468ebcbe1 100644 --- a/test/commands/app/add/event.test.js +++ b/test/commands/app/add/event.test.js @@ -98,7 +98,7 @@ describe('good flags', () => { command.selectTemplates.mockResolvedValue(['@adobe/generator-add-events-generic']) await command.run() expect(command.installTemplates).toHaveBeenCalledWith(installOptions) - expect(await command.getConfigFileForKey).toHaveBeenCalledWith('application.events') + expect(await command.getConfigFileForKey).toHaveBeenCalledWith('application.events', { 'config-validation': true, extension: ['application'], install: true, yes: false }) }) test('multiple ext configs', async () => { diff --git a/test/commands/app/deploy.test.js b/test/commands/app/deploy.test.js index 054b58367..864af55e9 100644 --- a/test/commands/app/deploy.test.js +++ b/test/commands/app/deploy.test.js @@ -1328,6 +1328,7 @@ describe('run', () => { cliCommandFlags: { actions: true, build: true, + 'config-validation': true, 'content-hash': true, 'force-build': true, 'force-deploy': false, @@ -1451,6 +1452,7 @@ describe('run', () => { cliCommandFlags: { actions: true, build: true, + 'config-validation': true, 'content-hash': true, 'force-build': true, 'force-deploy': false, diff --git a/test/commands/app/info.test.js b/test/commands/app/info.test.js index fdbc6c214..ea3d055d9 100644 --- a/test/commands/app/info.test.js +++ b/test/commands/app/info.test.js @@ -75,7 +75,7 @@ describe('run', () => { command.error = jest.fn() command.log = jest.fn() await command.run() - expect(mockConfigLoader.load).toHaveBeenCalledWith({ allowNoImpl: true, validateAppConfig: false }) + expect(mockConfigLoader.load).toHaveBeenCalledWith({ allowNoImpl: true, validateAppConfig: true }) expect(command.error).toHaveBeenCalledTimes(0) checkHiddenSecrets(command.log) const json = JSON.parse(command.log.mock.calls[0][0]) @@ -92,7 +92,7 @@ describe('run', () => { command.error = jest.fn() command.log = jest.fn() await command.run() - expect(mockConfigLoader.load).toHaveBeenCalledWith({ allowNoImpl: true, validateAppConfig: false }) + expect(mockConfigLoader.load).toHaveBeenCalledWith({ allowNoImpl: true, validateAppConfig: true }) expect(command.error).toHaveBeenCalledTimes(0) checkHiddenSecrets(command.log) const json = JSON.parse(command.log.mock.calls[0][0]) @@ -108,7 +108,7 @@ describe('run', () => { command.error = jest.fn() command.log = jest.fn() await command.run() - expect(mockConfigLoader.load).toHaveBeenCalledWith({ allowNoImpl: true, validateAppConfig: false }) + expect(mockConfigLoader.load).toHaveBeenCalledWith({ allowNoImpl: true, validateAppConfig: true }) expect(command.error).toHaveBeenCalledTimes(0) checkHiddenSecrets(command.log) const json = yaml.load(command.log.mock.calls[0][0]) @@ -124,7 +124,7 @@ describe('run', () => { command.error = jest.fn() command.log = jest.fn() await command.run() - expect(mockConfigLoader.load).toHaveBeenCalledWith({ allowNoImpl: true, validateAppConfig: false }) + expect(mockConfigLoader.load).toHaveBeenCalledWith({ allowNoImpl: true, validateAppConfig: true }) expect(command.error).toHaveBeenCalledTimes(0) checkHiddenSecrets(command.log) const json = JSON.parse(command.log.mock.calls[0][0]) diff --git a/test/commands/app/undeploy.test.js b/test/commands/app/undeploy.test.js index 7bdebeca5..68a96e233 100644 --- a/test/commands/app/undeploy.test.js +++ b/test/commands/app/undeploy.test.js @@ -579,6 +579,7 @@ describe('run', () => { }, cliCommandFlags: { actions: true, + 'config-validation': true, events: true, 'force-unpublish': false, unpublish: false,