Commit graph

34 commits

Author SHA1 Message Date
Rich Megginson
bf6215dab8 [citest skip] bump tox-lsr version to 2.11.0; remove py37; add py310
tox-lsr version 2.11.0 has support for collection-requirements.yml,
runqemu improvements, and support for python 3.10

python 3.7 is not used on any supported platform, so remove it

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2022-05-09 13:21:51 -06:00
Till Maas
d3a7124f07 GitHub CI: Trigger on main branch
The network role is using `main` for the default branch, so this needs
to be used in the workflow definition.

Signed-off-by: Till Maas <opensource@till.name>
2022-03-11 15:55:25 +01:00
Rich Megginson
a029152e16 use tox-lsr version 2.10.1
Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2022-02-21 21:20:04 +01:00
Till Maas
cf04059fc8 test: Use new py26 environment
Signed-off-by: Till Maas <opensource@till.name>
2022-02-18 09:57:46 +01:00
Rich Megginson
206c354b7e [citest skip] bump tox-lsr version to 2.9.1
Signed-off-by: Rich Megginson <rmeggins@redhat.com>

The new tox-lsr also requires the use of `{toxinidir}` for the
local config file paths.
2022-02-07 18:58:27 -07:00
Gris Ge
0e3d480de7 CI: Enable CentOS 9 stream integration test
Signed-off-by: Gris Ge <fge@redhat.com>
2022-02-05 19:25:09 +01:00
Wen Liang
2307969aef Remove CentOS8 GitHub actions CI Tests
As CentOS8 is already EOL, remove CentOS8 CI integration tests.

Signed-off-by: Wen Liang <liangwen12year@gmail.com>
2022-02-04 09:23:58 +01:00
Gris Ge
f508c27674 CI: Enable CentOS 7 integration test
Removed `tests_wireless_nm.yml` as github CI has no mac80211_hwsim
kernel module.

Signed-off-by: Gris Ge <fge@redhat.com>
2022-01-28 17:47:13 +01:00
Rich Megginson
20667b0860 bump tox-lsr version to 2.8.3
Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2022-01-10 12:35:01 -05:00
Sergei Petrosian
5c7fa548ea update tox-lsr version to 2.8.0
New version adds check for proper commenting of the ansible_managed var
2021-11-23 09:36:17 +01:00
Rich Megginson
be8e38a5c6 use tox-lsr 2.7.1 with Ansible 2.12 GA
Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2021-11-08 20:01:01 +01:00
Rich Megginson
cdea768ffa drop python 3.7 from CI
None of the platforms we support use python 3.7, so drop it from
CI testing.

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2021-11-08 20:01:01 +01:00
Rich Megginson
16ac152542 support ansible-core 2.12; ansible-plugin-scan; fix pylint errors; py39
Use the new tox-lsr that uses ansible-core 2.12.
Use ansible-plugin-scan in CI.
Fix pylint errors found by new ansible-test pylinter.
CI test with py39

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2021-11-08 20:01:01 +01:00
Wen Liang
f813fb33b7 fix ensure_provider_tests.py; fix generated tests; add check to CI
Fix ensure_provider_tests.py so that the tests are correctly generated.
Because the generated tests have not been checked in a while, there was
some drift between the actual tests and what should have been generated,
so the new generated tests have also been included.
When `ensure_provider_tests.py` detects differences, it will now show
the diffs using a unified diff format.
Added a new tox testenv `ensure_provider_tests` - use
`tox -e ensure_provider_tests` to run - to pass arguments, use
`tox -e ensure_provider_tests -- generate`
Added `ensure_provider_tests` as one of the tox testenvs to run for
github tox CI.

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2021-10-19 20:21:03 +02:00
Rich Megginson
81248c01c4 use apt-get install -y
Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2021-09-15 16:17:55 -06:00
Rich Megginson
fca9ca5f36 use tox-lsr 2.5.1
Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2021-09-13 09:58:18 -06:00
Sergei Petrosian
133672663d Drop support for Ansible 2.8 by bumping the Ansible version to 2.9
Bug 1989197 - drop support for Ansible 2.8
https://bugzilla.redhat.com/show_bug.cgi?id=1989197

Signed-off-by: Sergei Petrosian <spetrosi@redhat.com>
2021-08-12 17:08:05 +08:00
Rich Megginson
4b7f5d51fc fix yamllint issue - indentation
Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2021-07-29 00:40:40 +08:00
Gris Ge
daac665933 CI: Enable integration test in Github Action
Using container to run `ansible-playbook` against localhost.

To debug it, try

```bash
sudo DEBUG=1 ./.github/run_test.sh tests_bond_nm.yml
```

Attached two container files for CentOS 8 and CentOS Stream 8.
The container image is stored under quay:
    https://quay.io/organization/linux_system_roles

Only a small mount of tests has been chose in order to give stable CI
test feedback.

The github action CI will run two instances using above container image.

Signed-off-by: Gris Ge <fge@redhat.com>
2021-07-28 19:50:09 +08:00
Till Maas
16f1898894 Revert "Add auto update GitHub action"
The auto update is creating merge commits instead of rebasing, therefore
it is not the right choice.
This reverts commit 81a602dd71.

Signed-off-by: Till Maas <opensource@till.name>
2021-04-15 21:16:32 +02:00
Till Maas
81a602dd71 Add auto update GitHub action
Enable https://github.com/tibdex/auto-update to simplify automatic
merging of PRs.

Signed-off-by: Till Maas <opensource@till.name>
2021-04-15 20:55:54 +02:00
Rich Megginson
f5ff30a66c fix most ansible-test issues, suppress the rest
Automation Hub, and possibly Galaxy in the future, require the
collection to be screened with `ansible-test sanity` among other
checks.  The role had a number of issues:
* Use `AssertionError` instead of `assert`
* Use of `logging` module not in accordance with standards, but these
  are ok and the errors were suppressed
* Several import errors which are ok because they are checked
  elsewhere
* __init__.py in the module_utils directories must be empty, so a
  new file myerror.py was added to move the code from __init__.py
  * NOTE: network_lsr/nm/__init__.py is not empty
* The documentation block in the module was not properly constructed
  or formatted.
* shellcheck issues, including removing unused files
* use `unused` instead of `_` (underscore) for variables that are
  unused

add WARNING to module docs - collection users should not use directly

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2021-04-09 19:57:55 +02:00
Till Maas
87a9c5bd60 Enable github actions for push
Also run github actions for pushing to get CI updates for changes to the
main branch and a baseline to compare PRs to.

Signed-off-by: Till Maas <opensource@till.name>
2021-04-08 17:21:54 +02:00
Rich Megginson
167edabe8d use lsr-gh-action-py26 for python 2.6 unit tests
Use the new https://github.com/linux-system-roles/lsr-gh-action-py26
for running unit tests on python 2.6.  This uses an EL6 VM so more
closely corresponds to the managed hosts that still use python 2.6.

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2021-04-07 20:12:28 +02:00
Till Maas
a83372d5ee Add markdownlint GitHub Action
Setup https://github.com/marketplace/actions/markdownlint-mdl-action for
automatic markdown linting.

Signed-off-by: Till Maas <opensource@till.name>
2021-04-07 18:06:31 +02:00
Rich Megginson
a3ccd5561e update to tox-lsr 2.4.0 - add support for ansible-test sanity with docker
set `LSR_ANSIBLE_TEST_DOCKER: "true"` so that we run ansible-test sanity
with docker
This should fix issues we are seeing with tox ansible-test failures

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2021-04-07 13:26:22 +02:00
Noriko Hosoi
ef655447b3 use tox-lsr 2.2.0
Upgrade to tox-lsr 2.2.0 to pick up fix for improving collection
testing to get rid of black.

Signed-off-by: Noriko Hosoi <nhosoi@redhat.com>
2021-02-15 11:19:41 +01:00
Rich Megginson
e109d52e77 use molecule v3, drop v2 - use tox-lsr 2.1.2
Switch to molecule v3.  This drops support for v2.
This requires tox-lsr 2 or later.
Upgrade to tox-lsr 2.1.2 to pick up fix for collection dependency
on python six.

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2021-02-10 15:26:04 -06:00
Rich Megginson
ba932115fb remove ansible 2.7 support from molecule
ansible 2.7 has been deprecated
https://docs.ansible.com/ansible/devel/reference_appendices/release_and_maintenance.html
We need to remove ansible 2.7 from molecule testing in order to
* make room for ansible 2.10 testing
* move to molecule v3

ansible 2.8 and later support platform-python on el8 and later
so we don't have to handle that case explicitly by setting
ansible_python_interpreter for centos8 in molecule.yml

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2021-02-09 11:44:13 -06:00
Rich Megginson
26bbce0065 use tox-lsr 1.0.2
Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2021-01-19 13:21:58 -06:00
Rich Megginson
7798dcdfd3 add ansible-lint to github actions
Since we have disabled linting in molecule, use tox for running
ansible-lint.
In addition, fix molecule config to use `false` instead of `False`
since the former is the correct YAML boolean value.  This also
will make network consistent with the other roles.

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2021-01-15 16:21:07 +08:00
Rich Megginson
977f149f1e Fix centos6 repos; use standard centos images; add centos8
Use the new vault.centos.org repos.  Fix the yum repo configs in the
image if necessary to use these new repos.
Use the standard centos images from the centos registry rather than
custom lsr images from dockerhub.
Add support for centos8.  Note that using ansible 2.7 on centos8
requires setting /usr/bin/python3 to be the ansible python
interpreter.  Later versions of ansible have better auto-detection.
We can get rid of this once we drop support for ansible 2.7
Use tox-lsr 1.0.1 - which means we do not need
molecule_extra_requirements.txt

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2021-01-13 23:43:11 +08:00
Rich Megginson
4f9f7a4c94 make CI work with tox-lsr
Use tox-lsr instead of the scripts in the `.travis/` directory and the
asssociated config files.  Yes, `.travis/custom.sh` is still there,
but once you are familiar with the way that tox-lsr works, you can
remove it and use your own custom tox.ini action.  The goal of this
commit was to make as few changes as possible, to keep feature parity
with the old `.travis/` script way of running CI.  Also note that
linting has moved into tox, so we needed to disable molecule linting.
The new version of ansible-lint adds a lot of checks, so these are
disabled for now, and should be fixed later.  Also, shellcheck is
turned off until the network team can address the issues.

The `.travis/custom.sh` script is not run in the CI environment, so
this was changed slightly to remove the check for `$TRAVIS`, and it is
no longer run as a tox testenv in CI.

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2020-12-18 10:32:16 +08:00
Rich Megginson
c64b3b15ba use github actions instead of travis
adds a github actions tox workflow for CI testing, since
travis is discontinuing support for open source projects

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2020-12-11 14:46:40 +08:00