Esempio n. 1
0
  def testUploadHostBinaryExists(self):
    with mock.patch('py_utils.cloud_storage.Exists') as exists_patch:
      with mock.patch('py_utils.cloud_storage.Insert') as insert_patch:
        with mock.patch('py_utils.GetHostOsName') as get_os_patch:
          exists_patch.return_value = True
          get_os_patch.return_value = 'testos'
          binary_deps_manager.UploadHostBinary('dep', '/path/to/bin', 'abc123')

    insert_patch.assert_called_once_with(
        'chromium-telemetry',
        'perfetto_binaries/dep/testos/latest',
        mock.ANY,
        publicly_readable=True,
    )
Esempio n. 2
0
def main(args):
    parser = argparse.ArgumentParser()
    parser.add_argument('--path',
                        help='Path to trace_processor_shell binary.',
                        required=True)
    parser.add_argument(
        '--revision',
        help=(
            'Perfetto revision. '
            'If not supplied, will try to infer from //third_party/perfetto.'))

    # When this script is invoked on a CI bot, there are some extra arguments
    # that we have to ignore.
    args, _ = parser.parse_known_args(args)

    revision = args.revision or _PerfettoRevision()

    binary_deps_manager.UploadHostBinary(trace_processor.TP_BINARY_NAME,
                                         args.path, revision)
def main(args):
  parser = argparse.ArgumentParser()
  parser.add_argument(
      '--path', help='Path to trace_processor_shell binary.', required=True)
  parser.add_argument(
      '--revision',
      help=('Perfetto revision. '
            'If not supplied, will try to infer from DEPS file.'))
  parser.add_argument('--isolated-script-test-output',
                      help='Path to the output file.')

  args = parser.parse_args(args)

  # CI bot expects a valid JSON object as script output.
  if args.isolated_script_test_output is not None:
    with open(args.isolated_script_test_output, 'w') as f:
      f.write('{}')

  revision = args.revision or _PerfettoRevision()

  binary_deps_manager.UploadHostBinary(trace_processor.TP_BINARY_NAME,
                                       args.path, revision)
Esempio n. 4
0
def main(args):
    parser = argparse.ArgumentParser()
    parser.add_argument('--path',
                        help='Path to trace_processor_shell binary.',
                        required=True)
    parser.add_argument(
        '--revision',
        help=('Perfetto revision. '
              'If not supplied, will try to infer from DEPS file.'))
    parser.add_argument('--isolated-script-test-output',
                        help='Path to the output file.')

    args = parser.parse_args(args)

    revision = args.revision or _PerfettoRevision()

    binary_deps_manager.UploadHostBinary(trace_processor.TP_BINARY_NAME,
                                         args.path, revision)

    # CI bot expects a valid JSON object as script output.
    if args.isolated_script_test_output is not None:
        with open(args.isolated_script_test_output, 'w') as f:
            f.write('''{
          "interrupted": false,
          "num_failures_by_type": {
              "FAIL": 0,
              "PASS": 1
          },
          "seconds_since_epoch": %s,
          "tests": {
               "upload_trace_processor": {
                   "actual": "PASS",
                   "expected": "PASS"
               }
          },
          "version": 3
      }''' % time.time())