From b7ec43643fb81e3608fe6ef42bdaea5209fe1d70 Mon Sep 17 00:00:00 2001 From: Marian Raiciof Date: Wed, 5 Jun 2019 14:59:16 +0000 Subject: [PATCH] Bug 1556311 - Fix the error "ImportError: no module named ini" while running raptor tests. r=sparky Differential Revision: https://phabricator.services.mozilla.com/D33457 --HG-- extra : moz-landing-system : lando --- testing/raptor/raptor/raptor.py | 6 ------ testing/raptor/raptor/utils.py | 11 ----------- testing/raptor/test/conftest.py | 8 -------- testing/raptor/test/test_manifest.py | 7 ------- testing/raptor/test/test_raptor.py | 7 ------- testing/raptor/test/test_utils.py | 7 ------- 6 files changed, 46 deletions(-) diff --git a/testing/raptor/raptor/raptor.py b/testing/raptor/raptor/raptor.py index 4997d0a2926f..32df89b22046 100644 --- a/testing/raptor/raptor/raptor.py +++ b/testing/raptor/raptor/raptor.py @@ -28,12 +28,6 @@ from mozrunner import runners # need this so raptor imports work both from /raptor and via mach here = os.path.abspath(os.path.dirname(__file__)) paths = [here] -if os.environ.get('SCRIPTSPATH') is not None: - # in production it is env SCRIPTS_PATH - paths.append(os.environ['SCRIPTSPATH']) -else: - # locally it's in source tree - paths.append(os.path.join(here, '..', '..', 'mozharness')) webext_dir = os.path.join(here, '..', 'webext') paths.append(webext_dir) diff --git a/testing/raptor/raptor/utils.py b/testing/raptor/raptor/utils.py index 1e3cfff8c018..3cb9ebce0def 100644 --- a/testing/raptor/raptor/utils.py +++ b/testing/raptor/raptor/utils.py @@ -15,22 +15,11 @@ from mozlog import get_proxy_logger, get_default_logger LOG = get_proxy_logger(component="raptor-utils") here = os.path.dirname(os.path.realpath(__file__)) -if os.environ.get('SCRIPTSPATH', None) is not None: - # in production it is env SCRIPTS_PATH - mozharness_dir = os.environ['SCRIPTSPATH'] -else: - # locally it's in source tree - mozharness_dir = os.path.join(here, '../../mozharness') -sys.path.insert(0, mozharness_dir) - external_tools_path = os.environ.get('EXTERNALTOOLSPATH', None) if external_tools_path is not None: # running in production via mozharness TOOLTOOL_PATH = os.path.join(external_tools_path, 'tooltool.py') -else: - # running locally via mach - TOOLTOOL_PATH = os.path.join(mozharness_dir, 'external_tools', 'tooltool.py') def transform_platform(str_to_transform, config_platform, config_processor=None): diff --git a/testing/raptor/test/conftest.py b/testing/raptor/test/conftest.py index e1b270a94d5c..8073a4bbea76 100644 --- a/testing/raptor/test/conftest.py +++ b/testing/raptor/test/conftest.py @@ -2,7 +2,6 @@ from __future__ import absolute_import import json import os -import sys import pytest @@ -10,13 +9,6 @@ from argparse import Namespace # need this so raptor imports work both from /raptor and via mach here = os.path.abspath(os.path.dirname(__file__)) -if os.environ.get('SCRIPTSPATH') is not None: - # in production it is env SCRIPTS_PATH - mozharness_dir = os.environ['SCRIPTSPATH'] -else: - # locally it's in source tree - mozharness_dir = os.path.join(here, '../../mozharness') -sys.path.insert(0, mozharness_dir) from raptor.raptor import RaptorDesktopFirefox diff --git a/testing/raptor/test/test_manifest.py b/testing/raptor/test/test_manifest.py index ee7191a01f4f..9a9162c823ed 100644 --- a/testing/raptor/test/test_manifest.py +++ b/testing/raptor/test/test_manifest.py @@ -8,13 +8,6 @@ import sys # need this so raptor imports work both from /raptor and via mach here = os.path.abspath(os.path.dirname(__file__)) -if os.environ.get('SCRIPTSPATH', None) is not None: - # in production it is env SCRIPTS_PATH - mozharness_dir = os.environ['SCRIPTSPATH'] -else: - # locally it's in source tree - mozharness_dir = os.path.join(here, '../../mozharness') -sys.path.insert(1, mozharness_dir) raptor_dir = os.path.join(os.path.dirname(here), 'raptor') sys.path.insert(0, raptor_dir) diff --git a/testing/raptor/test/test_raptor.py b/testing/raptor/test/test_raptor.py index de475f937997..7aab0f1e27d6 100644 --- a/testing/raptor/test/test_raptor.py +++ b/testing/raptor/test/test_raptor.py @@ -14,13 +14,6 @@ from mozrunner.errors import RunnerNotStartedError # need this so raptor imports work both from /raptor and via mach here = os.path.abspath(os.path.dirname(__file__)) -if os.environ.get('SCRIPTSPATH', None) is not None: - # in production it is env SCRIPTS_PATH - mozharness_dir = os.environ['SCRIPTSPATH'] -else: - # locally it's in source tree - mozharness_dir = os.path.join(here, '../../mozharness') -sys.path.insert(0, mozharness_dir) from raptor.raptor import RaptorDesktopFirefox, RaptorDesktopChrome, RaptorAndroid diff --git a/testing/raptor/test/test_utils.py b/testing/raptor/test/test_utils.py index eda01af23539..b92fd1c7b73e 100644 --- a/testing/raptor/test/test_utils.py +++ b/testing/raptor/test/test_utils.py @@ -7,13 +7,6 @@ import sys # need this so raptor imports work both from /raptor and via mach here = os.path.abspath(os.path.dirname(__file__)) -if os.environ.get('SCRIPTSPATH', None) is not None: - # in production it is env SCRIPTS_PATH - mozharness_dir = os.environ['SCRIPTSPATH'] -else: - # locally it's in source tree - mozharness_dir = os.path.join(here, '../../mozharness') -sys.path.insert(1, mozharness_dir) raptor_dir = os.path.join(os.path.dirname(here), 'raptor') sys.path.insert(0, raptor_dir)