예제 #1
0
    def test_process_manifest_success_zip_already_uploaded(self):
        self.mock(swarming.net, 'url_read', lambda url, data=None: '{}')
        self.mock(swarming.isolateserver, 'get_storage',
                  lambda *_: MockedStorage(warm_cache=True))

        result = swarming.process_manifest(
            file_hash_or_isolated=FILE_HASH,
            test_name=TEST_NAME,
            shards=1,
            test_filter='*',
            slave_os='linux2',
            working_dir='swarm_tests',
            isolate_server='http://localhost:8081',
            swarming='http://localhost:8082',
            verbose=False,
            profile=False,
            priority=101,
            algo=ALGO)
        self.assertEqual(0, result)

        # Just assert it printed enough, since it contains variable output.
        out = sys.stdout.getvalue()
        self.assertTrue(len(out) > STDOUT_FOR_TRIGGER_LEN)
        self.assertTrue('Zip file already on server' in out)
        self.mock(sys, 'stdout', StringIO.StringIO())
예제 #2
0
  def test_process_manifest_success_zip_already_uploaded(self):
    self.mock(swarming.net, 'url_read', lambda url, data=None: '{}')
    self.mock(swarming.isolateserver, 'get_storage',
        lambda *_: MockedStorage(warm_cache=True))

    result = swarming.process_manifest(
        file_hash_or_isolated=FILE_HASH,
        test_name=TEST_NAME,
        shards=1,
        test_filter='*',
        slave_os='linux2',
        working_dir='swarm_tests',
        isolate_server='http://localhost:8081',
        swarming='http://localhost:8082',
        verbose=False,
        profile=False,
        priority=101,
        algo=ALGO)
    self.assertEqual(0, result)

    # Just assert it printed enough, since it contains variable output.
    out = sys.stdout.getvalue()
    self.assertTrue(len(out) > STDOUT_FOR_TRIGGER_LEN)
    self.assertTrue('Zip file already on server' in out)
    self.mock(sys, 'stdout', StringIO.StringIO())
예제 #3
0
  def test_process_manifest_success(self):
    self.mock(swarming.net, 'url_read', lambda url, data=None: '{}')
    self.mock(swarming.isolateserver, 'get_storage',
        lambda *_: MockedStorage(warm_cache=False))

    result = swarming.process_manifest(
        swarming='http://localhost:8082',
        isolate_server='http://localhost:8081',
        namespace='default',
        isolated_hash=FILE_HASH,
        task_name=TEST_NAME,
        shards=1,
        dimensions={},
        env={},
        working_dir='swarm_tests',
        verbose=False,
        profile=False,
        priority=101,
        algo=ALGO)
    self.assertEqual(0, result)
예제 #4
0
    def test_process_manifest_success(self):
        self.mock(swarming.net, "url_read", lambda url, data=None: "{}")
        self.mock(swarming.isolateserver, "get_storage", lambda *_: MockedStorage(warm_cache=False))

        result = swarming.process_manifest(
            swarming="http://localhost:8082",
            isolate_server="http://localhost:8081",
            namespace="default",
            isolated_hash=FILE_HASH,
            task_name=TEST_NAME,
            extra_args=["--some-arg", "123"],
            shards=1,
            dimensions={},
            env={},
            working_dir="swarm_tests",
            deadline=60 * 60,
            verbose=False,
            profile=False,
            priority=101,
        )
        self.assertEqual(0, result)