Exemplo n.º 1
0
  def test_basic_linux_profile(self):
    dimensions = {'os': 'Linux'}
    manifest = swarming.Manifest(
        isolate_server='http://localhost:8081',
        namespace='default-gzip',
        isolated_hash=FILE_HASH,
        task_name=TEST_NAME,
        shards=1,
        env={},
        dimensions=dimensions,
        working_dir='swarm_tests',
        verbose=False,
        profile=True,
        priority=101,
        algo=ALGO)

    swarming.chromium_setup(manifest)
    manifest_json = json.loads(manifest.to_json())

    expected = generate_expected_json(
        shards=1,
        dimensions={u'os': u'Linux'},
        env={},
        working_dir='swarm_tests',
        isolate_server=u'http://localhost:8081',
        profile=True)
    self.assertEqual(expected, manifest_json)
Exemplo n.º 2
0
    def test_basic_linux(self):
        """A basic linux manifest test to ensure that windows specific values
       aren't used.
    """
        manifest = swarming.Manifest(isolated_hash=FILE_HASH,
                                     test_name=TEST_NAME,
                                     shards=1,
                                     test_filter='*',
                                     slave_os='Linux',
                                     working_dir='swarm_tests',
                                     isolate_server='http://localhost:8081',
                                     verbose=False,
                                     profile=False,
                                     priority=101,
                                     algo=ALGO)

        swarming.chromium_setup(manifest)
        manifest_json = json.loads(manifest.to_json())

        expected = generate_expected_json(
            shards=1,
            slave_os='linux2',
            working_dir='swarm_tests',
            isolate_server=u'http://localhost:8081',
            profile=False)
        self.assertEqual(expected, manifest_json)
Exemplo n.º 3
0
  def test_basic_manifest(self):
    env = {
      u'GTEST_SHARD_INDEX': u'%(instance_index)s',
      u'GTEST_TOTAL_SHARDS': u'%(num_instances)s',
    }
    dimensions = {'os': 'Windows'}
    manifest = swarming.Manifest(
        isolate_server='http://localhost:8081',
        namespace='default-gzip',
        isolated_hash=FILE_HASH,
        task_name=TEST_NAME,
        shards=2,
        env=env,
        dimensions=dimensions,
        working_dir='swarm_tests',
        verbose=False,
        profile=False,
        priority=101,
        algo=ALGO)

    swarming.chromium_setup(manifest)
    manifest_json = json.loads(manifest.to_json())

    expected = generate_expected_json(
        shards=2,
        dimensions={u'os': u'Windows'},
        env={},
        working_dir='swarm_tests',
        isolate_server=u'http://localhost:8081',
        profile=False)
    self.assertEqual(expected, manifest_json)
Exemplo n.º 4
0
    def test_manifest_with_extra_args(self):
        env = {u"GTEST_SHARD_INDEX": u"%(instance_index)s", u"GTEST_TOTAL_SHARDS": u"%(num_instances)s"}
        dimensions = {"os": "Windows"}
        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"],
            shards=2,
            env=env,
            dimensions=dimensions,
            working_dir="swarm_tests",
            deadline=60 * 60,
            verbose=False,
            profile=False,
            priority=101,
        )

        swarming.chromium_setup(manifest)
        manifest_json = json.loads(manifest.to_json())

        expected = generate_expected_json(
            shards=2,
            dimensions={u"os": u"Windows"},
            env={},
            working_dir="swarm_tests",
            isolate_server=u"http://localhost:8081",
            profile=False,
            extra_args=["--extra-cmd-arg=1234", "some more"],
        )
        self.assertEqual(expected, manifest_json)
Exemplo n.º 5
0
    def test_basic_linux_profile(self):
        dimensions = {"os": "Linux"}
        manifest = swarming.Manifest(
            isolate_server="http://localhost:8081",
            namespace="default-gzip",
            isolated_hash=FILE_HASH,
            task_name=TEST_NAME,
            extra_args=None,
            shards=1,
            env={},
            dimensions=dimensions,
            working_dir="swarm_tests",
            deadline=60 * 60,
            verbose=False,
            profile=True,
            priority=101,
        )

        swarming.chromium_setup(manifest)
        manifest_json = json.loads(manifest.to_json())

        expected = generate_expected_json(
            shards=1,
            dimensions={u"os": u"Linux"},
            env={},
            working_dir="swarm_tests",
            isolate_server=u"http://localhost:8081",
            profile=True,
        )
        self.assertEqual(expected, manifest_json)
Exemplo n.º 6
0
  def test_basic_linux(self):
    """A basic linux manifest test to ensure that windows specific values
       aren't used.
    """
    manifest = swarming.Manifest(
        isolated_hash=FILE_HASH,
        test_name=TEST_NAME,
        shards=1,
        test_filter='*',
        slave_os='Linux',
        working_dir='swarm_tests',
        isolate_server='http://localhost:8081',
        verbose=False,
        profile=False,
        priority=101,
        algo=ALGO)

    swarming.chromium_setup(manifest)
    manifest_json = json.loads(manifest.to_json())

    expected = generate_expected_json(
        shards=1,
        slave_os='linux2',
        working_dir='swarm_tests',
        isolate_server=u'http://localhost:8081',
        profile=False)
    self.assertEqual(expected, manifest_json)
Exemplo n.º 7
0
    def test_basic_manifest(self):
        manifest = swarming.Manifest(isolated_hash=FILE_HASH,
                                     test_name=TEST_NAME,
                                     shards=2,
                                     test_filter='*',
                                     slave_os='Windows',
                                     working_dir='swarm_tests',
                                     isolate_server='http://localhost:8081',
                                     verbose=False,
                                     profile=False,
                                     priority=101,
                                     algo=ALGO)

        swarming.chromium_setup(manifest)
        manifest_json = json.loads(manifest.to_json())

        expected = generate_expected_json(
            shards=2,
            slave_os='win32',
            working_dir='swarm_tests',
            isolate_server=u'http://localhost:8081',
            profile=False)
        self.assertEqual(expected, manifest_json)
Exemplo n.º 8
0
  def test_basic_manifest(self):
    manifest = swarming.Manifest(
        isolated_hash=FILE_HASH,
        test_name=TEST_NAME,
        shards=2,
        test_filter='*',
        slave_os='Windows',
        working_dir='swarm_tests',
        isolate_server='http://localhost:8081',
        verbose=False,
        profile=False,
        priority=101,
        algo=ALGO)

    swarming.chromium_setup(manifest)
    manifest_json = json.loads(manifest.to_json())

    expected = generate_expected_json(
        shards=2,
        slave_os='win32',
        working_dir='swarm_tests',
        isolate_server=u'http://localhost:8081',
        profile=False)
    self.assertEqual(expected, manifest_json)