-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add test workflows based on salt-test #616
Add test workflows based on salt-test #616
Conversation
Some modules `import boto` to set log levels. The related tests don't import `boto`. This can cause a problem when `boto` is not available. Tests are skipped when HAS_BOTO in the test_boto_*.py is False. Not trying to `import boto` can leave HAS_BOTO=True in the test file even though HAS_BOTO is False on the application side. In this case, tests are not skipped and fail.
`salt.utils.path.which` should not be mocked before `network.__utils__`. The Salt loader calls `salt.utils.network.linux_interfaces`, which needs the real `salt.utils.path.which`.
Signed-off-by: Pedro Algarvio <[email protected]> (cherry picked from commit 3506e7f)
The same HAS_VCERT check is done in the runner module.
…reenaway original author (cherry picked from commit 2c1040b)
…tests. Signed-off-by: Pedro Algarvio <[email protected]> (cherry picked from commit 672f658)
These tests require a Git repository container, which is hard to correctly set up when executing the tests in the container in GH Actions. Using --network host can help, but there was still an error (the git repos were empty) when I tried to set this up.
f569b37
to
cf5699a
Compare
63d013b
to
2274c0f
Compare
When GH Actions are executed, they skip the default entrypoint for the container, so we need to arrange the _version.txt file manually
2274c0f
to
49fa25f
Compare
27db701
to
fb02996
Compare
Propagate GITHUB_ACTIONS variable to container environment
fb02996
to
c7be52c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general looks good to me, just one comment about removed test_cmdmod.py
.
from tests.support.runtests import RUNTIME_VARS | ||
|
||
AVAILABLE_PYTHON_EXECUTABLE = salt.utils.path.which_bin( | ||
["python", "python2", "python2.6", "python2.7"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if I understood why the whole test file was dropped, but I could assume due to missing python executable. Or am I wrong?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These tests were actually just migrated and moved to this other file: https://github.com/openSUSE/salt/pull/616/files#diff-7f58f80c7428a46156300ebfac3a3ee8d98811d3e8e69fd26a51239c2dc6ee29
(Backported from: saltstack/salt#65679)
I've also pushed some of the commits from this PR upstream, via saltstack/salt#66130 |
* Add test workflows based on salt-test (#616) * Add unit test workflow based on salt-test * Add integration test workflow based on salt-test * Adjust GH actions to run all tests subsets and include functional * Add new GH action to trigger scenarios tests * GH Actions: Fix Salt version in _version.txt file When GH Actions are executed, they skip the default entrypoint for the container, so we need to arrange the _version.txt file manually Propagate GITHUB_ACTIONS variable to container environment
* Add test workflows based on salt-test (#616) * Add unit test workflow based on salt-test * Add integration test workflow based on salt-test * Adjust GH actions to run all tests subsets and include functional * Add new GH action to trigger scenarios tests * GH Actions: Fix Salt version in _version.txt file When GH Actions are executed, they skip the default entrypoint for the container, so we need to arrange the _version.txt file manually Propagate GITHUB_ACTIONS variable to container environment
What does this PR do?
Replace the salt-toaster based unit and integration test workflows with salt-test based ones. While adding these workflows, I came across a number of tests I had to fix. Where possible, I cherry-picked upstream fixes.
The hostname is set to
salt-test-container
, which is used to conditionally disable tests that are problematic in GH Actions. If anyone has a better idea for either disabling these tests or know how to run them in GH Actions, I'm all for it.Needs updates to https://build.opensuse.org/package/show/systemsmanagement:saltstack:products:testing:containers:leap15.5/salt-testsuite-ci, see link diff