Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--cli-flags-path no longer works #13589

Closed
connorjclark opened this issue Jan 25, 2022 · 1 comment · Fixed by #13590
Closed

--cli-flags-path no longer works #13589

connorjclark opened this issue Jan 25, 2022 · 1 comment · Fixed by #13590
Assignees
Labels

Comments

@connorjclark
Copy link
Collaborator

{
  "budgets": [{"resourceSizes": [{"resourceType": "script", "budget": 1}]}]
}
yarn start http://localhost:9009/app/ --quiet --cli-flags-path=settings.json

Settings budgets will be undefined.

I bisected to #13045. The PR doesn't update the yargs dependency, but did make some (seemingly trivial) modifications to lighthouse-cli/cli-flags.js.

Blocking GoogleChrome/lighthouse-ci#726

@connorjclark
Copy link
Collaborator Author

connorjclark commented Jan 25, 2022

This is actually any values from the flags json file 😱

This is what cliFlags looks like when using the --cli-flags-path for this file:

{
  "budgets": [{"resourceSizes": [{"resourceType": "script", "budget": 1}]}],
  "chromeFlags": "--lol"
}
{
  '0': '{',
  '1': '\n',
  '2': ' ',
  '3': ' ',
  '4': '"',
  '5': 'b',
  '6': 'u',
  '7': 'd',
  '8': 'g',
  '9': 'e',
  '10': 't',
  '11': 's',
  '12': '"',
  '13': ':',
  '14': ' ',
  '15': '[',
  '16': '{',
  '17': '"',
  '18': 'r',
  '19': 'e',
  '20': 's',
  '21': 'o',
  '22': 'u',
  '23': 'r',
  '24': 'c',
  '25': 'e',
  '26': 'S',
  '27': 'i',
  '28': 'z',
  '29': 'e',
  '30': 's',
  '31': '"',
  '32': ':',
  '33': ' ',
  '34': '[',
  '35': '{',
  '36': '"',
  '37': 'r',
  '38': 'e',
  '39': 's',
  '40': 'o',
  '41': 'u',
  '42': 'r',
  '43': 'c',
  '44': 'e',
  '45': 'T',
  '46': 'y',
  '47': 'p',
  '48': 'e',
  '49': '"',
  '50': ':',
  '51': ' ',
  '52': '"',
  '53': 's',
  '54': 'c',
  '55': 'r',
  '56': 'i',
  '57': 'p',
  '58': 't',
  '59': '"',
  '60': ',',
  '61': ' ',
  '62': '"',
  '63': 'b',
  '64': 'u',
  '65': 'd',
  '66': 'g',
  '67': 'e',
  '68': 't',
  '69': '"',
  '70': ':',
  '71': ' ',
  '72': 1,
  '73': '}',
  '74': ']',
  '75': '}',
  '76': ']',
  '77': ',',
  '78': '\n',
  '79': ' ',
  '80': ' ',
  '81': '"',
  '82': 'c',
  '83': 'h',
  '84': 'r',
  '85': 'o',
  '86': 'm',
  '87': 'e',
  '88': 'F',
  '89': 'l',
  '90': 'a',
  '91': 'g',
  '92': 's',
  '93': '"',
  '94': ':',
  '95': ' ',
  '96': '"',
  '97': '-',
  '98': '-',
  '99': 'l',
  '100': 'o',
  '101': 'l',
  '102': '"',
  '103': '\n',
  '104': '}',
  _: [ 'http://localhost:9009/app/' ],
  quiet: true,
  'cli-flags-path': '/Users/cjamcl/src/lighthouse-ci/packages/cli/test/fixtures/budgettmp.json',
  cliFlagsPath: '/Users/cjamcl/src/lighthouse-ci/packages/cli/test/fixtures/budgettmp.json',
  verbose: false,
  'save-assets': false,
  saveAssets: false,
  'list-all-audits': false,
  listAllAudits: false,
  'list-locales': false,
  listLocales: false,
  'list-trace-categories': false,
  listTraceCategories: false,
  'print-config': false,
  printConfig: false,
  'fraggle-rock': false,
  fraggleRock: false,
  'chrome-flags': '',
  chromeFlags: '',
  port: 0,
  hostname: '127.0.0.1',
  'enable-error-reporting': undefined,
  enableErrorReporting: undefined,
  output: [ 'html' ],
  view: false,
  channel: 'cli',
  'chrome-ignore-default-flags': false,
  chromeIgnoreDefaultFlags: false,
  '$0': 'lighthouse-cli/index.js'
}

The entire input of the file is spread into the object :P

Strangest bit: the tests are just fine!

@connorjclark connorjclark changed the title --cli-flags-path no longer works for {budgets: [...]} --cli-flags-path no longer works Jan 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant