def test_manifest_with_extra_args(self): manifest = swarming.Manifest( isolate_server='http://localhost:8081', namespace='default-gzip', isolated_hash=FILE_HASH, task_name=TEST_NAME, extra_args=['--extra-cmd-arg=1234', 'some more'], env={}, dimensions={'os': 'Windows'}, deadline=60*60, verbose=False, profile=False, priority=101) swarming.setup_run_isolated(manifest, None) manifest_json = json.loads(manifest.to_json()) expected = generate_expected_json( shards=1, shard_index=0, dimensions={u'os': u'Windows'}, env={}, isolate_server=u'http://localhost:8081', profile=False, extra_args=['--extra-cmd-arg=1234', 'some more']) self.assertEqual(expected, manifest_json)
def test_manifest_for_shard(self): manifest = swarming.Manifest( isolate_server='http://localhost:8081', namespace='default-gzip', isolated_hash=FILE_HASH, task_name=TEST_NAME, extra_args=None, env=swarming.setup_googletest({}, 5, 3), dimensions={'os': 'Linux'}, deadline=60*60, verbose=False, profile=False, priority=101) swarming.setup_run_isolated(manifest, None) manifest_json = json.loads(manifest.to_json()) expected = generate_expected_json( shards=5, shard_index=3, dimensions={u'os': u'Linux'}, env={}, isolate_server=u'http://localhost:8081', profile=False) self.assertEqual(expected, manifest_json)
def test_zip_bundle_files(self): manifest = swarming.Manifest( isolate_server='http://localhost:8081', namespace='default-gzip', isolated_hash=FILE_HASH, task_name=TEST_NAME, extra_args=None, env={}, dimensions={'os': 'Linux'}, deadline=60*60, verbose=False, profile=False, priority=101) bundle = zip_package.ZipPackage(swarming.ROOT_DIR) swarming.setup_run_isolated(manifest, bundle) self.assertEqual( set(['run_isolated.zip', 'swarm_cleanup.py']), set(bundle.files))