Page MenuHomeDevCentral

Allow to resolve __salt__ in rust module tests
ClosedPublic

Authored by dereckson on Mar 7 2022, 19:35.
Tags
None
Referenced Files
F3618945: D2574.id6518.diff
Thu, Oct 3, 06:28
F3618871: D2574.id6504.diff
Thu, Oct 3, 06:19
F3618375: D2574.diff
Thu, Oct 3, 04:26
Unknown Object (File)
Sun, Sep 29, 05:39
Unknown Object (File)
Sat, Sep 28, 14:20
Unknown Object (File)
Wed, Sep 25, 10:41
Unknown Object (File)
Mon, Sep 23, 00:24
Unknown Object (File)
Sat, Sep 14, 09:10
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