Skip to content

Commit

Permalink
ci: use packaged salt and python-shaptools
Browse files Browse the repository at this point in the history
  • Loading branch information
yeoldegrove committed Jul 17, 2023
1 parent 04221b3 commit 4fb0a98
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 9 deletions.
23 changes: 15 additions & 8 deletions .github/workflows/salt-shaptools-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -168,25 +168,32 @@ jobs:
run: |
zypper -n in -y make python
if test -f /usr/bin/python3; then
# minimal python packages and compilers
zypper -n in -y python3-pip python3-devel gcc
# minimal salt, python packages and compilers
zypper -n in -y salt python3-pip python3-devel gcc
# use current salt version shipped with SLE 15
git clone --branch=openSUSE/release/3006.0 --depth=50 https://github.com/openSUSE/salt ../salt
# python 3.6 - official requirements from salt (works with python >3.6)
pip install -r ../salt/requirements/pytest.txt
pip install -r tests/requirements.3.6.yaml # pinned pytest-cov
# install shaptools
zypper addrepo https://download.opensuse.org/repositories/network:/ha-clustering:/sap-deployments:/devel/SLE_15_SP5/network:ha-clustering:sap-deployments:devel.repo
zypper --gpg-auto-import-keys ref
zypper -n in -y python3-shaptools
else
# minimal python packages and compilers
zypper -n in -y python-pip python-devel gcc gcc-c++
zypper -n in -y SUSEConnect
SUSEConnect -p sle-module-adv-systems-management/12/x86_64
# minimal salt, python packages and compilers
zypper -n in -y salt python-pip python-devel gcc gcc-c++
# python 2.7 - latest available versions for old python release
pip install -r tests/requirements.2.7.yaml
pip install --ignore-installed -r tests/requirements.2.7.yaml
# use current salt version shipped with SLE 12
git clone --branch=openSUSE/release/3000.3 --depth=50 https://github.com/openSUSE/salt ../salt
# install shaptools
zypper addrepo https://download.opensuse.org/repositories/network:/ha-clustering:/sap-deployments:/devel/SLE_12_SP5/network:ha-clustering:sap-deployments:devel.repo
zypper --gpg-auto-import-keys ref
zypper -n in -y python-shaptools
fi
rm ../salt/tests/conftest.py
git clone --depth=50 https://github.com/SUSE/shaptools.git ../shaptools
pip install -e ../salt
pip install ../shaptools
- name: execute test script
run: make test-python

Expand Down
7 changes: 6 additions & 1 deletion tests/run.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#!/usr/bin/env bash

PYTHON=python3
test -f /usr/bin/python2 && PYTHON=python2

cp salt/modules/*.py ../salt/salt/modules/
cp salt/states/*.py ../salt/salt/states/
cp tests/unit/modules/*.py ../salt/tests/unit/modules/
cp tests/unit/states/*.py ../salt/tests/unit/states/
py.test -vv ../salt/tests/unit/modules/test_hanamod.py ../salt/tests/unit/states/test_hanamod.py ../salt/tests/unit/modules/test_crmshmod.py ../salt/tests/unit/modules/test_saptunemod.py ../salt/tests/unit/modules/test_sapcarmod.py ../salt/tests/unit/states/test_crmshmod.py ../salt/tests/unit/modules/test_drbdmod.py ../salt/tests/unit/states/test_drbdmod.py ../salt/tests/unit/states/test_saptunemod.py ../salt/tests/unit/modules/test_netweavermod.py ../salt/tests/unit/states/test_netweavermod.py ../salt/tests/unit/states/test_sapcarmod.py --cov=salt.modules.hanamod --cov=salt.states.hanamod --cov=salt.modules.crmshmod --cov=salt.states.crmshmod --cov=salt.modules.drbdmod --cov=salt.modules.saptunemod --cov=salt.modules.sapcarmod --cov=salt.states.saptunemod --cov=salt.states.drbdmod --cov=salt.modules.netweavermod --cov=salt.states.netweavermod --cov=salt.states.sapcarmod --cov-config .coveragerc --cov-report term --cov-report xml --cov-report html
cd ../salt && $PYTHON -m pytest -vv ../salt/tests/unit/modules/test_hanamod.py ../salt/tests/unit/states/test_hanamod.py ../salt/tests/unit/modules/test_crmshmod.py ../salt/tests/unit/modules/test_saptunemod.py ../salt/tests/unit/modules/test_sapcarmod.py ../salt/tests/unit/states/test_crmshmod.py ../salt/tests/unit/modules/test_drbdmod.py ../salt/tests/unit/states/test_drbdmod.py ../salt/tests/unit/states/test_saptunemod.py ../salt/tests/unit/modules/test_netweavermod.py ../salt/tests/unit/states/test_netweavermod.py ../salt/tests/unit/states/test_sapcarmod.py --cov=salt.modules.hanamod --cov=salt.states.hanamod --cov=salt.modules.crmshmod --cov=salt.states.crmshmod --cov=salt.modules.drbdmod --cov=salt.modules.saptunemod --cov=salt.modules.sapcarmod --cov=salt.states.saptunemod --cov=salt.states.drbdmod --cov=salt.modules.netweavermod --cov=salt.states.netweavermod --cov=salt.states.sapcarmod --cov-config .coveragerc --cov-report term --cov-report xml --cov-report html

0 comments on commit 4fb0a98

Please sign in to comment.