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

container improvements #131

Merged
merged 3 commits into from
Jun 29, 2023
Merged

Conversation

richm
Copy link
Contributor

@richm richm commented Jun 28, 2023

  • Many improvements, docs for running tests in containers.
  • Add 2 options to runcontainer.sh (Initial project setup #1)
  • ci: manually install python 2.7
  • ignore vulnerability - does not affect
  • fix some coding, shellcheck issues

@richm richm requested review from nhosoi and spetrosi June 28, 2023 21:34
README.md Outdated
* `--log-dir PATH` - When using `--parallel` - for each test playbook named `TESTNAME.yml`
the log will be written to a file named `TESTNAME.log` in the `PATH` directory.
The default is the directory where `TESTNAME.yml` is found.
* `--fail-fast true|false` - default `false`, which means all of the tests will be run
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--fail-fast option was removed in this commit?
21f0018

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--fail-fast option was removed in this commit? 21f0018

Yes. It was unused.

richm and others added 2 commits June 28, 2023 18:20
See the README e.g. `tox -e container-ansible-core-2.15 -- --image-name centos-9 tests/tests_default.yml`

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
- --extra-rpm <RPM>: specifies an additional rpm package to install
      in the container. Default to none. E.g.,
      --extra-rpm diffutils --extra-rpm sudo
- --extra-skip-tag <TAG>: specifies a tag to skip. Default to none.
      E.g., --extra-skip-tag "tests::use_selinux_role"

If no `--parallel` option is given, it runs all the tests in one
ansible-playbook command line that is the original behavior.
If `--parallel` option is given, it runs each test per command
line. To run *.yml per command line in one container, '--parallel 1`
option is required.
sequentially.
* `--log-dir PATH` - When using `--parallel` - for each test playbook named `TESTNAME.yml`
the log will be written to a file named `TESTNAME.log` in the `PATH` directory.
The default is the directory where `TESTNAME.yml` is found.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May I add the description for the new options --extra-rpm and --extra-skip-tag here?

  • --extra-rpm : specifies an additional rpm package to install
    in the container. Default to none. E.g.,
    --extra-rpm diffutils --extra-rpm sudo
  • --extra-skip-tag : specifies a tag to skip. Default to none.
    E.g., --extra-skip-tag "tests::use_selinux_role"

Copy link
Contributor

@spetrosi spetrosi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super!

Copy link
Contributor

@nhosoi nhosoi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, too. Thanks a lot, Rich!

@richm
Copy link
Contributor Author

richm commented Jun 29, 2023

LGTM, too. Thanks a lot, Rich!

Thanks - have you tried this new version? If so thanks - if not, I'd rather not merge it unless it works for you

@nhosoi
Copy link
Contributor

nhosoi commented Jun 29, 2023

LGTM, too. Thanks a lot, Rich!

Thanks - have you tried this new version? If so thanks - if not, I'd rather not merge it unless it works for you

I reran this command line and it passed successfully.

time tox -e container-ansible-core-2.15 -- --erase-old-snapshot --extra-rpm diffutils \
--parallel 1 --image-name centos-9 tests/tests_*.yml
<<snip>>
  container-ansible-core-2.15: commands succeeded
  congratulations :)

real	29m31.256s
user	7m20.991s
sys	4m25.883s

@richm richm merged commit 94d95ba into linux-system-roles:main Jun 29, 2023
@richm richm deleted the container-improvements branch June 29, 2023 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants