-
Notifications
You must be signed in to change notification settings - Fork 792
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[manuf] Make orchestrator resolve paths using runfiles library
This simplifies use of the packaged orchestrator script. Instead of having to extract the packaged runfiles manually, the rules_python machinery extracts it into a temp dir and the library handles path resolution. Some hackery was required to preserve the scheme used previously for referring to the main repo vs external repos. Signed-off-by: Noah Moroze <[email protected]>
- Loading branch information
Showing
9 changed files
with
114 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import os | ||
import unittest | ||
|
||
from util import must_resolve_runfile | ||
|
||
|
||
class TestRunfileMustResolve(unittest.TestCase): | ||
|
||
def test_main_workspace_path(self): | ||
resolved = must_resolve_runfile( | ||
"sw/device/silicon_creator/manuf/keys/fake/dice_ca.pem") | ||
self.assertTrue(os.path.exists(resolved)) | ||
|
||
def test_external_path(self): | ||
resolved = must_resolve_runfile( | ||
"external/openocd/tcl/interface/cmsis-dap.cfg") | ||
self.assertTrue(os.path.exists(resolved)) | ||
|
||
def test_abs_path(self): | ||
path = os.path.abspath(__file__) | ||
resolved = must_resolve_runfile(path) | ||
self.assertEqual(path, resolved) | ||
|
||
def test_non_existent(self): | ||
with self.assertRaises(ValueError): | ||
must_resolve_runfile("file-does-not-exist") | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() |