Bug 1573418 Run Talos harness tests in CI r=rwood,igoldan,perftest-reviewers

Differential Revision: https://phabricator.services.mozilla.com/D56680

--HG--
extra : moz-landing-system : lando
This commit is contained in:
alexandru.ionescu 2020-01-29 08:29:13 +00:00
parent ec2a667824
commit 1535129890
15 changed files with 80 additions and 165 deletions

View File

@ -336,3 +336,16 @@ condprof:
files-changed:
- 'testing/condprofile/condprof**'
- 'testing/condprofile/setup.py'
talos:
description: testing/talos unit tests
platform: windows10-64/opt
python-version: [2]
treeherder:
symbol: tal
run:
using: python-test
subsuite: talos
when:
files-changed:
- 'testing/talos/**'

View File

@ -3,6 +3,5 @@ subsuite = talos
skip-if = python == 3
[test_config.py]
[test_ffsetup.py]
[test_test.py]
[test_xtalos/test_etlparser.py]
[test_xtalos.py]

View File

@ -1,92 +0,0 @@
from __future__ import absolute_import
import os
import mock
import mozunit
from talos.ffsetup import FFSetup
class TestFFSetup(object):
def setup_method(self, method):
self.ffsetup = FFSetup(
# browser_config
{
"env": {},
"symbols_path": "",
"preferences": {},
"webserver": "",
"extensions": []
},
# test_config
{
"preferences": {},
"extensions": [],
"profile": None
}
)
# setup proxy logger
def test_clean(self):
# tmp dir removed
assert self.ffsetup._tmp_dir is not None
assert os.path.exists(self.ffsetup._tmp_dir) is True
self.ffsetup.clean()
assert self.ffsetup._tmp_dir is not None
assert os.path.exists(self.ffsetup._tmp_dir) is False
# gecko profile also cleaned
gecko_profile = mock.Mock()
self.ffsetup.gecko_profile = gecko_profile
self.ffsetup.clean()
assert gecko_profile.clean.called is True
# def test_as_context_manager(self):
# self.ffsetup._init_env = mock.Mock()
# self.ffsetup._init_profile = mock.Mock()
# self.ffsetup._run_profile = mock.Mock()
# self.ffsetup._init_gecko_profile = mock.Mock()
#
# with self.ffsetup as setup:
# # env initiated
# self.assertIsNotNone(setup.env)
# # profile initiated
# self.assertTrue(setup._init_profile.called)
# # gecko profile initiated
#
# # except raised
# pass
#
# def test_environment_init(self):
# # self.env not empty
# # browser_config env vars in self.env
# # multiple calls return same self.env
# pass
#
# def test_profile_init(self):
# # addons get installed
# # webextensions get installed
# # preferences contain interpolated values
# # profile path is added
# pass
#
# def test_run_profile(self):
# # exception raised
# # browser process launched
# pass
#
# def test_gecko_profile_init(self):
# # complains on not provided upload_dir
# # self.gecko_profile not None
# pass
if __name__ == '__main__':
mozunit.main()

View File

@ -1,64 +1,64 @@
from __future__ import absolute_import
import re
import mozunit
from talos.xtalos.etlparser import NAME_SUBSTITUTIONS
def test_NAME_SUBSTITUTIONS():
filepaths_map = {
# tp5n files
r'{talos}\talos\tests\tp5n\alibaba.com\i03.i.aliimg.com\images\eng\style\css_images':
r'{talos}\talos\tests\{tp5n_files}',
r'{talos}\talos\tests\tp5n\cnet.com\i.i.com.com\cnwk.1d\i\tron\fd':
r'{talos}\talos\tests\{tp5n_files}',
r'{talos}\talos\tests\tp5n\tp5n.manifest':
r'{talos}\talos\tests\{tp5n_files}',
r'{talos}\talos\tests\tp5n\tp5n.manifest.develop':
r'{talos}\talos\tests\{tp5n_files}',
r'{talos}\talos\tests\tp5n\yelp.com\media1.ct.yelpcdn.com\photo':
r'{talos}\talos\tests\{tp5n_files}',
# cltbld for Windows 7 32bit
r'c:\users\cltbld.t-w732-ix-015.000\appdata\locallow\mozilla':
r'c:\users\{cltbld}\appdata\locallow\mozilla',
r'c:\users\cltbld.t-w732-ix-035.000\appdata\locallow\mozilla':
r'c:\users\{cltbld}\appdata\locallow\mozilla',
r'c:\users\cltbld.t-w732-ix-058.000\appdata\locallow\mozilla':
r'c:\users\{cltbld}\appdata\locallow\mozilla',
r'c:\users\cltbld.t-w732-ix-112.001\appdata\local\temp':
r'c:\users\{cltbld}\appdata\local\temp',
# nvidia's 3D Vision
r'c:\program files\nvidia corporation\3d vision\npnv3dv.dll':
r'c:\program files\{nvidia_3d_vision}',
r'c:\program files\nvidia corporation\3d vision\npnv3dvstreaming.dll':
r'c:\program files\{nvidia_3d_vision}',
r'c:\program files\nvidia corporation\3d vision\nvstereoapii.dll':
r'c:\program files\{nvidia_3d_vision}',
r'{firefox}\browser\extensions\{45b6d270-f6ec-4930-a6ad-14bac5ea2204}.xpi':
r'{firefox}\browser\extensions\{uuid}.xpi',
r'c:\slave\test\build\venv\lib\site-packages\pip\_vendor\html5lib\treebuilders':
r'c:\slave\test\build\venv\lib\site-packages\{pip_vendor}',
r'c:\slave\test\build\venv\lib\site-packages\pip\_vendor\colorama':
r'c:\slave\test\build\venv\lib\site-packages\{pip_vendor}',
r'c:\slave\test\build\venv\lib\site-packages\pip\_vendor\cachecontrol\caches':
r'c:\slave\test\build\venv\lib\site-packages\{pip_vendor}',
r'c:\slave\test\build\venv\lib\site-packages\pip\_vendor\requests\packages\urllib3'
r'\packages\ssl_match_hostname':
r'c:\slave\test\build\venv\lib\site-packages\{pip_vendor}',
}
for given_raw_path, exp_normal_path in filepaths_map.items():
normal_path = given_raw_path
for pattern, substitution in NAME_SUBSTITUTIONS:
normal_path = re.sub(pattern, substitution, normal_path)
assert exp_normal_path == normal_path
if __name__ == '__main__':
mozunit.main()
from __future__ import absolute_import
import re
import mozunit
from talos.xtalos.etlparser import NAME_SUBSTITUTIONS
def test_NAME_SUBSTITUTIONS():
filepaths_map = {
# tp5n files
r'{talos}\talos\tests\tp5n\alibaba.com\i03.i.aliimg.com\images\eng\style\css_images':
r'{talos}\talos\tests\{tp5n_files}',
r'{talos}\talos\tests\tp5n\cnet.com\i.i.com.com\cnwk.1d\i\tron\fd':
r'{talos}\talos\tests\{tp5n_files}',
r'{talos}\talos\tests\tp5n\tp5n.manifest':
r'{talos}\talos\tests\{tp5n_files}',
r'{talos}\talos\tests\tp5n\tp5n.manifest.develop':
r'{talos}\talos\tests\{tp5n_files}',
r'{talos}\talos\tests\tp5n\yelp.com\media1.ct.yelpcdn.com\photo':
r'{talos}\talos\tests\{tp5n_files}',
# cltbld for Windows 7 32bit
r'c:\users\cltbld.t-w732-ix-015.000\appdata\locallow\mozilla':
r'c:\users\{cltbld}\appdata\locallow\mozilla',
r'c:\users\cltbld.t-w732-ix-035.000\appdata\locallow\mozilla':
r'c:\users\{cltbld}\appdata\locallow\mozilla',
r'c:\users\cltbld.t-w732-ix-058.000\appdata\locallow\mozilla':
r'c:\users\{cltbld}\appdata\locallow\mozilla',
r'c:\users\cltbld.t-w732-ix-112.001\appdata\local\temp':
r'c:\users\{cltbld}\appdata\local\temp',
# nvidia's 3D Vision
r'c:\program files\nvidia corporation\3d vision\npnv3dv.dll':
r'c:\program files\{nvidia_3d_vision}',
r'c:\program files\nvidia corporation\3d vision\npnv3dvstreaming.dll':
r'c:\program files\{nvidia_3d_vision}',
r'c:\program files\nvidia corporation\3d vision\nvstereoapii.dll':
r'c:\program files\{nvidia_3d_vision}',
r'{firefox}\browser\extensions\{45b6d270-f6ec-4930-a6ad-14bac5ea2204}.xpi':
r'{firefox}\browser\extensions\{uuid}.xpi',
r'c:\slave\test\build\venv\lib\site-packages\pip\_vendor\html5lib\treebuilders':
r'c:\slave\test\build\venv\lib\site-packages\{pip_vendor}',
r'c:\slave\test\build\venv\lib\site-packages\pip\_vendor\colorama':
r'c:\slave\test\build\venv\lib\site-packages\{pip_vendor}',
r'c:\slave\test\build\venv\lib\site-packages\pip\_vendor\cachecontrol\caches':
r'c:\slave\test\build\venv\lib\site-packages\{pip_vendor}',
r'c:\slave\test\build\venv\lib\site-packages\pip\_vendor\requests\packages\urllib3'
r'\packages\ssl_match_hostname':
r'c:\slave\test\build\venv\lib\site-packages\{pip_vendor}',
}
for given_raw_path, exp_normal_path in filepaths_map.items():
normal_path = given_raw_path
for pattern, substitution in NAME_SUBSTITUTIONS:
normal_path = re.sub(pattern, substitution, normal_path)
assert exp_normal_path == normal_path
if __name__ == '__main__':
mozunit.main()

View File

@ -1,5 +1 @@
# xtalos: talos + xperf
from __future__ import absolute_import
from start_xperf import start, start_from_config # noqa
import etlparser # noqa

View File

@ -13,7 +13,7 @@ import shutil
import subprocess
import sys
import xtalos
from talos.xtalos import xtalos
EVENTNAME_INDEX = 0
PROCESS_INDEX = 2

View File

@ -53,9 +53,8 @@ file-whitespace:
- testing/talos/talos/cmanager_base.py
- testing/talos/talos/profiler/profiling.py
- testing/talos/talos/unittests/conftest.py
- testing/talos/talos/unittests/test_ffsetup.py
- testing/talos/talos/unittests/test_test.py
- testing/talos/talos/unittests/test_xtalos/test_etlparser.py
- testing/talos/talos/unittests/test_xtalos.py
- testing/web-platform/tests/content-security-policy/embedded-enforcement/support/echo-allow-csp-from.py
- testing/web-platform/tests/content-security-policy/embedded-enforcement/support/echo-policy-multiple.py
- testing/web-platform/tests/css/tools/apiclient/apiclient/__init__.py