From 4206f306cf124c09a16ee9908bceef6ab3dd7e19 Mon Sep 17 00:00:00 2001 From: Ines Fazlic Date: Fri, 26 Apr 2024 09:21:29 +0100 Subject: [PATCH] feat(cli): add deprecation notice to report cmd (#2666) --- packages/artillery/lib/cmds/report.js | 31 +++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/packages/artillery/lib/cmds/report.js b/packages/artillery/lib/cmds/report.js index c37246bce5..1821b81a84 100644 --- a/packages/artillery/lib/cmds/report.js +++ b/packages/artillery/lib/cmds/report.js @@ -4,9 +4,11 @@ const fs = require('fs'); const path = require('path'); const _ = require('lodash'); const telemetry = require('../telemetry').init(); +const chalk = require('chalk'); class ReportCommand extends Command { async run() { + console.error(deprecationNotice); telemetry.capture('report generate'); const { flags, args } = await this.parse(ReportCommand); const output = flags.output || args.file + '.html'; // TODO: path.resolve @@ -35,6 +37,35 @@ ReportCommand.flags = { }) }; +const deprecationNotice = ` +${chalk.blue(`┌───────────────────────────────────────────────────────────────────────┐ +│`)} ${chalk.yellow( + 'DEPRECATION NOTICE' +)} ${chalk.blue(`│ +├───────────────────────────────────────────────────────────────────────┤ +│`)} ${chalk.yellow( + 'The "report" command is deprecated and will be removed in a future' +)} ${chalk.blue(`│ +│`)} ${chalk.yellow( + 'release of Artillery.' +)} ${chalk.blue(`│ +│ │ +│`)} ${chalk.blueBright('Artillery Cloud')} ${chalk.white( + 'is now the recommended way to visualize test results.' +)} ${chalk.blue(`│ +│`)} ${chalk.white( + 'It provides more comprehensive reporting, advanced visualizations,' +)} ${chalk.blue(`│ +│`)} ${chalk.white( + 'and includes a free tier.' +)} ${chalk.blue(`│ +│ │ +│`)} ${chalk.white('Sign up on')} ${chalk.cyan( + chalk.underline('https://app.artillery.io') +)} ${chalk.blue(`│ +└───────────────────────────────────────────────────────────────────────┘ +`)}`; + ReportCommand.args = { file: Args.string() }; module.exports = ReportCommand;