Page MenuHomeDevCentral

Allow to resolve __salt__ in rust module tests
ClosedPublic

Authored by dereckson on Mar 7 2022, 19:35.
Tags
None
Referenced Files
F3988067: D2574.diff
Wed, Jan 8, 15:59
Unknown Object (File)
Thu, Jan 2, 02:22
Unknown Object (File)
Thu, Jan 2, 02:22
Unknown Object (File)
Thu, Jan 2, 01:42
Unknown Object (File)
Thu, Jan 2, 00:56
Unknown Object (File)
Sun, Dec 22, 11:48
Unknown Object (File)
Sun, Dec 22, 08:55
Unknown Object (File)
Wed, Dec 18, 14:34
Subscribers
None

Details

Summary

Fixes the following issue:

======================================================================
ERROR: test_get_rustc_triplet (test_rust.Testinstance)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/opt/salt/nasqueron-operations/_tests/modules/test_rust.py", line 11, in test_get_rustc_triplet
    triplet = rust.get_rustc_triplet()
  File "../_modules/rust.py", line 35, in get_rustc_triplet
    return __salt__["cmd.shell"]("rustc -vV | sed -ne 's/^host: //p'")
NameError: name '__salt__' is not defined
Test Plan

make test

Diff Detail

Repository
rOPS Nasqueron Operations
Lint
Lint Passed
Unit
No Test Coverage
Branch
mock
Build Status
Buildable 4034
Build 4286: arc lint + arc unit

Event Timeline

dereckson created this revision.
This revision is now accepted and ready to land.Mar 7 2022, 19:36
$ cd _tests
$ ./modules/test_rust.py
<frozen importlib._bootstrap>:283: DeprecationWarning: the load_module() method is deprecated and slated for removal in Python 3.12; use exec_module() instead
.
----------------------------------------------------------------------
Ran 1 test in 0.108s

OK