Skip to content
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

Merged
merged 25 commits into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
25c1589
Add unit test workflow based on salt-test
agraul Jan 3, 2024
8a1c0e4
Add integration test workflow based on salt-test
agraul Feb 1, 2024
7961890
Align boto imports in tests with Salt modules
agraul Jan 10, 2024
9e33dd2
Fix mock order in test_dig (test_network.py)
agraul Jan 12, 2024
12fdbff
Fix mock calls
s0undt3ch Jun 13, 2023
7c3b84a
Skip venafiapi test if vcert module not available
agraul Feb 5, 2024
6789525
Moving tests/integration/modules/test_cmdmod.py to pytest, Gareth J G…
garethgreenaway Dec 8, 2023
279a461
The repo.saltproject.io `index.html` file changed it's contents. Fix …
s0undt3ch Apr 19, 2023
1b066da
Skip hwclock test when executed inside a container
agraul Feb 5, 2024
cf5699a
Skip git pillar tests when executed inside a container
agraul Feb 9, 2024
3ada277
Skip test requiring systemd inside container
agraul Feb 12, 2024
73498d2
Exclude tests for hgfs if missing hglib
meaksh Feb 14, 2024
2e2dcde
Adjust GH actions to run all tests subsets and include functional
meaksh Feb 14, 2024
840d73c
Add new GH action to trigger scenarios tests
meaksh Feb 14, 2024
9f09aa7
Skip and fix tests when running on containers
meaksh Feb 14, 2024
c4a2186
Fix some failing test causing problem in SUSE environments
meaksh Feb 14, 2024
0ba8be1
Skip more tests when running on containers
meaksh Feb 15, 2024
44662a6
Use skipif instead of skip_if as it seems not behaving equally
meaksh Feb 15, 2024
5554064
Skip more tests that cannot run in a container
meaksh Feb 15, 2024
a966469
Remove SSH test which doesn't make sense after lock mechanism
meaksh Feb 15, 2024
8d169f5
Fix failing boto tests
meaksh Feb 15, 2024
1ba30b1
Skip unmaintained tests upstream around zcbuildout
meaksh Feb 15, 2024
cb87472
Arrange GH actions into fast and full executions
meaksh Feb 15, 2024
bc8bfdf
GH Actions: Fix Salt version in _version.txt file
meaksh Feb 21, 2024
c7be52c
Skip some tests that does not run well in GH Actions
meaksh Feb 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/functional-fast-opensuse-leap.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Fast functional tests

on:
push:
branches: [openSUSE/release/3006.0]
pull_request:
branches: [openSUSE/release/3006.0]
workflow_dispatch:

jobs:
fast-functional-tests:
runs-on: ubuntu-latest
env:
GITHUB_ACTIONS: 1
container:
image: registry.opensuse.org/systemsmanagement/saltstack/products/testing/containers/leap15.5/containers/salt-testsuite-github:leap15.5
options: --hostname=salt-test-container
steps:
- name: Checkout Salt
uses: actions/checkout@v4
- name: Fix the Salt version in _version.txt file
run: rpm -q python3-salt-testsuite --queryformat '%{VERSION}' > $GITHUB_WORKSPACE/salt/_version.txt
- name: Run Fast functional tests
run: |
salt-test --skiplist https://raw.githubusercontent.com/openSUSE/salt-test-skiplist/main/skipped_tests.toml \
--directory . --package-flavor classic functional -- -vvv
26 changes: 26 additions & 0 deletions .github/workflows/functional-full-opensuse-leap.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Full functional tests

on:
push:
branches: [openSUSE/release/3006.0]
pull_request:
branches: [openSUSE/release/3006.0]
workflow_dispatch:

jobs:
full-functional-tests:
runs-on: ubuntu-latest
env:
GITHUB_ACTIONS: 1
container:
image: registry.opensuse.org/systemsmanagement/saltstack/products/testing/containers/leap15.5/containers/salt-testsuite-github:leap15.5
options: --hostname=salt-test-container
steps:
- name: Checkout Salt
uses: actions/checkout@v4
- name: Fix the Salt version in _version.txt file
run: rpm -q python3-salt-testsuite --queryformat '%{VERSION}' > $GITHUB_WORKSPACE/salt/_version.txt
- name: Run Full functional tests
run: |
salt-test --skiplist https://raw.githubusercontent.com/openSUSE/salt-test-skiplist/main/skipped_tests.toml \
--directory . --package-flavor classic functional -- --core-tests --slow --run-expensive --ssh-tests --run-destructive -vvv
39 changes: 0 additions & 39 deletions .github/workflows/functional-opensuse-leap.yml

This file was deleted.

26 changes: 26 additions & 0 deletions .github/workflows/integration-fast-opensuse-leap.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Fast integration tests

on:
push:
branches: [openSUSE/release/3006.0]
pull_request:
branches: [openSUSE/release/3006.0]
workflow_dispatch:

jobs:
fast-integration-tests:
runs-on: ubuntu-latest
env:
GITHUB_ACTIONS: 1
container:
image: registry.opensuse.org/systemsmanagement/saltstack/products/testing/containers/leap15.5/containers/salt-testsuite-github:leap15.5
options: --hostname=salt-test-container
steps:
- name: Checkout Salt
uses: actions/checkout@v4
- name: Fix the Salt version in _version.txt file
run: rpm -q python3-salt-testsuite --queryformat '%{VERSION}' > $GITHUB_WORKSPACE/salt/_version.txt
- name: Run Fast integration tests
run: |
salt-test --skiplist https://raw.githubusercontent.com/openSUSE/salt-test-skiplist/main/skipped_tests.toml \
--directory . --package-flavor classic integration -- -vvv
26 changes: 26 additions & 0 deletions .github/workflows/integration-full-opensuse-leap.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Full integration tests

on:
push:
branches: [openSUSE/release/3006.0]
pull_request:
branches: [openSUSE/release/3006.0]
workflow_dispatch:

jobs:
full-integration-tests:
runs-on: ubuntu-latest
env:
GITHUB_ACTIONS: 1
container:
image: registry.opensuse.org/systemsmanagement/saltstack/products/testing/containers/leap15.5/containers/salt-testsuite-github:leap15.5
options: --hostname=salt-test-container
steps:
- name: Checkout Salt
uses: actions/checkout@v4
- name: Fix the Salt version in _version.txt file
run: rpm -q python3-salt-testsuite --queryformat '%{VERSION}' > $GITHUB_WORKSPACE/salt/_version.txt
- name: Run Full integration tests
run: |
salt-test --skiplist https://raw.githubusercontent.com/openSUSE/salt-test-skiplist/main/skipped_tests.toml \
--directory . --package-flavor classic integration -- --core-tests --slow --run-expensive --ssh-tests --run-destructive -vvv
39 changes: 0 additions & 39 deletions .github/workflows/integration-opensuse-leap.yml

This file was deleted.

26 changes: 26 additions & 0 deletions .github/workflows/scenarios-fast-opensuse-leap.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Fast scenarios tests

on:
push:
branches: [openSUSE/release/3006.0]
pull_request:
branches: [openSUSE/release/3006.0]
workflow_dispatch:

jobs:
fast-scenarios-tests:
runs-on: ubuntu-latest
env:
GITHUB_ACTIONS: 1
container:
image: registry.opensuse.org/systemsmanagement/saltstack/products/testing/containers/leap15.5/containers/salt-testsuite-github:leap15.5
options: --hostname=salt-test-container
steps:
- name: Checkout Salt
uses: actions/checkout@v4
- name: Fix the Salt version in _version.txt file
run: rpm -q python3-salt-testsuite --queryformat '%{VERSION}' > $GITHUB_WORKSPACE/salt/_version.txt
- name: Run Fast scenarios tests
run: |
salt-test --skiplist https://raw.githubusercontent.com/openSUSE/salt-test-skiplist/main/skipped_tests.toml \
--directory . --package-flavor classic scenarios -- -vvv
26 changes: 26 additions & 0 deletions .github/workflows/scenarios-full-opensuse-leap.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Full scenarios tests

on:
push:
branches: [openSUSE/release/3006.0]
pull_request:
branches: [openSUSE/release/3006.0]
workflow_dispatch:

jobs:
full-scenarios-tests:
runs-on: ubuntu-latest
env:
GITHUB_ACTIONS: 1
container:
image: registry.opensuse.org/systemsmanagement/saltstack/products/testing/containers/leap15.5/containers/salt-testsuite-github:leap15.5
options: --hostname=salt-test-container
steps:
- name: Checkout Salt
uses: actions/checkout@v4
- name: Fix the Salt version in _version.txt file
run: rpm -q python3-salt-testsuite --queryformat '%{VERSION}' > $GITHUB_WORKSPACE/salt/_version.txt
- name: Run Full scenarios tests
run: |
salt-test --skiplist https://raw.githubusercontent.com/openSUSE/salt-test-skiplist/main/skipped_tests.toml \
--directory . --package-flavor classic scenarios -- --core-tests --slow --run-expensive --ssh-tests --run-destructive -vvv
26 changes: 26 additions & 0 deletions .github/workflows/unit-fast-opensuse-leap.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Fast unit tests

on:
push:
branches: [openSUSE/release/3006.0]
pull_request:
branches: [openSUSE/release/3006.0]
workflow_dispatch:

jobs:
fast-unit-tests:
runs-on: ubuntu-latest
env:
GITHUB_ACTIONS: 1
container:
image: registry.opensuse.org/systemsmanagement/saltstack/products/testing/containers/leap15.5/containers/salt-testsuite-github:leap15.5
options: --hostname=salt-test-container
steps:
- name: Checkout Salt
uses: actions/checkout@v4
- name: Fix the Salt version in _version.txt file
run: rpm -q python3-salt-testsuite --queryformat '%{VERSION}' > $GITHUB_WORKSPACE/salt/_version.txt
- name: Run Fast unit tests
run: |
salt-test --skiplist https://raw.githubusercontent.com/openSUSE/salt-test-skiplist/main/skipped_tests.toml \
--directory . --package-flavor classic unit -- -vvv
26 changes: 26 additions & 0 deletions .github/workflows/unit-full-opensuse-leap.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Full unit tests

on:
push:
branches: [openSUSE/release/3006.0]
pull_request:
branches: [openSUSE/release/3006.0]
workflow_dispatch:

jobs:
full-unit-tests:
runs-on: ubuntu-latest
env:
GITHUB_ACTIONS: 1
container:
image: registry.opensuse.org/systemsmanagement/saltstack/products/testing/containers/leap15.5/containers/salt-testsuite-github:leap15.5
options: --hostname=salt-test-container
steps:
- name: Checkout Salt
uses: actions/checkout@v4
- name: Fix the Salt version in _version.txt file
run: rpm -q python3-salt-testsuite --queryformat '%{VERSION}' > $GITHUB_WORKSPACE/salt/_version.txt
- name: Run Full unit tests
run: |
salt-test --skiplist https://raw.githubusercontent.com/openSUSE/salt-test-skiplist/main/skipped_tests.toml \
--directory . --package-flavor classic unit -- --core-tests --slow --run-expensive --ssh-tests --run-destructive -vvv
39 changes: 0 additions & 39 deletions .github/workflows/unit-opensuse-leap.yml

This file was deleted.

10 changes: 9 additions & 1 deletion tests/integration/externalapi/test_venafiapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@
from cryptography.hazmat.primitives import serialization
from cryptography.x509.oid import NameOID

try:
import vcert
from vcert.common import CertificateRequest

HAS_VCERT = True
except ImportError:
HAS_VCERT = False

from tests.support.case import ShellCase


Expand All @@ -36,6 +44,7 @@ def wrapper(self, *args, **kwargs):
return wrapper


@pytest.mark.skipif(HAS_VCERT is False, reason="The vcert module must be installed.")
class VenafiTest(ShellCase):
"""
Test the venafi runner
Expand Down Expand Up @@ -86,7 +95,6 @@ def test_request(self, name):
@with_random_name
@pytest.mark.slow_test
def test_sign(self, name):

csr_pem = """-----BEGIN CERTIFICATE REQUEST-----
MIIFbDCCA1QCAQAwgbQxCzAJBgNVBAYTAlVTMQ0wCwYDVQQIDARVdGFoMRIwEAYD
VQQHDAlTYWx0IExha2UxFDASBgNVBAoMC1ZlbmFmaSBJbmMuMRQwEgYDVQQLDAtJ
Expand Down
Loading