Bug 186872 - [ews-build] unit-tests fail when run from another directory
Summary: [ews-build] unit-tests fail when run from another directory
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Aakash Jain
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-06-20 19:50 PDT by Aakash Jain
Modified: 2018-06-21 11:53 PDT (History)
5 users (show)

See Also:


Attachments
Proposed patch (2.59 KB, patch)
2018-06-20 19:54 PDT, Aakash Jain
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Aakash Jain 2018-06-20 19:50:34 PDT
unit-tests fail when run from another directory, e.g.:

[~/code/OpenSource/Tools/BuildSlaveSupport]$python ews-build/loadConfig_unittest.py 
E..................
======================================================================
ERROR: test_configuration (__main__.ConfigDotJSONTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "ews-build/loadConfig_unittest.py", line 33, in test_configuration
    loadConfig.loadBuilderConfig({})
  File "/Users/jain/code1/OpenSource/Tools/BuildSlaveSupport/ews-build/loadConfig.py", line 39, in loadBuilderConfig
    config = json.load(open(os.path.join(master_prefix_path, 'config.json')))
IOError: [Errno 2] No such file or directory: './config.json'

----------------------------------------------------------------------
Ran 19 tests in 0.001s

FAILED (errors=1)


[~/code/OpenSource/Tools/BuildSlaveSupport]$cd ews-build

[~/code/OpenSource/Tools/BuildSlaveSupport/ews-build]$python loadConfig_unittest.py 
...................
----------------------------------------------------------------------
Ran 19 tests in 0.004s

OK
Comment 1 Aakash Jain 2018-06-20 19:54:39 PDT
Created attachment 343204 [details]
Proposed patch

Add support for passing master_prefix_path in loadConfig.py. This is similar to what we do in other similar Buildbot related code.
Comment 2 Aakash Jain 2018-06-21 11:52:27 PDT
Committed r233050: <https://trac.webkit.org/changeset/233050>
Comment 3 Radar WebKit Bug Importer 2018-06-21 11:53:17 PDT
<rdar://problem/41337924>