Page MenuHomeDevCentral

Allow to resolve __salt__ in rust module tests
ClosedPublic

Authored by dereckson on Mar 7 2022, 19:35.
Tags
None
Referenced Files
F3742520: D2574.id.diff
Thu, Nov 14, 07:47
Unknown Object (File)
Sun, Nov 10, 04:54
Unknown Object (File)
Wed, Nov 6, 17:50
Unknown Object (File)
Mon, Nov 4, 05:19
Unknown Object (File)
Thu, Oct 31, 20:04
Unknown Object (File)
Tue, Oct 29, 21:54
Unknown Object (File)
Tue, Oct 29, 21:38
Unknown Object (File)
Sun, Oct 20, 15:16
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 Not Applicable
Unit
Tests Not Applicable

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