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

#511 + TELCOV10N-472 related broken test #532

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mvk
Copy link

@mvk mvk commented Jan 16, 2025

SUMMARY

reorganize expected text to match the actual output (changes to APIs cause this)

Fixes #511

ISSUE TYPE

regression

  • Regression Bug
Tests

running before:

ansible-test units --verbose --docker --python 3.11 --color
  • tests/unit/filter/test_ocp_compatibility.py::TestOcpCompatibility::test_filter_with_deprecated_api_in_non_empty_list

After applying, only the warning remains:

 ansible-test units --verbose --docker --python 3.11 --color
Configured locale: en_US.UTF-8
Loaded configuration: tests/config.yml
Run command: podman -v
Detected "podman" container runtime version: podman version 5.3.1
Run command: podman system connection list --format=json
Run command: podman info --format '{{ json . }}'
Run command: podman version --format '{{ json . }}'
Container runtime: podman client=5.3.1 server=5.3.1 cgroup=v2
Assuming Docker is available on localhost.
Run command: podman image inspect quay.io/ansible/ansible-test-utility-container:3.1.0
Run command: podman run --volume /sys/fs/cgroup:/probe:ro --name ansible-test-probe-NdFtEWCV --rm quay.io/ansible/ansible-test-utility-container:3.1.0 sh -c 'audit-status && cat /proc/sys/fs/nr_open && ulimit -Hn && (cat /pro ...
Container host audit status: EPERM (-1)
Container host max open files: 1048576
Container loginuid: 4294967295 (not set)
Starting new "ansible-test-controller-NdFtEWCV" container.
Run command: podman image inspect quay.io/ansible/default-test-container:10.9.0
Run command: podman network inspect podman
Run command: podman run --tmpfs /tmp:exec --tmpfs /run:exec --tmpfs /run/lock --cap-add SYS_CHROOT --cap-add AUDIT_WRITE --systemd always --cgroupns private -dt --ulimit nofile=10240 --name ansible-test-controller-NdFtEWCV -- ...
Adding "ansible-test-controller-NdFtEWCV" to container database.
Run command: podman container inspect ansible-test-controller-NdFtEWCV
Stream command with data: podman exec -i ansible-test-controller-NdFtEWCV /bin/sh
Bootstrapping Python 3.11 at: /usr/bin/python3.11
Scanning collection root: /Users/makovgan/src/github.com/workspace/collections/ansible_collections
junit_xml
Created a 9115653 byte payload archive containing 2076 files in 0 seconds.
Run command with stdin: podman exec -i ansible-test-controller-NdFtEWCV tar oxzf - -C /root
Creating container database.
Run command: podman exec ansible-test-controller-NdFtEWCV mkdir -p /root/ansible_collections/redhatci/ocp/tests/output/junit /root/ansible_collections/redhatci/ocp/tests/output/coverage
Run command: podman exec ansible-test-controller-NdFtEWCV chmod 777 /root/ansible_collections/redhatci/ocp/tests/output/junit /root/ansible_collections/redhatci/ocp/tests/output/coverage
Run command: podman exec ansible-test-controller-NdFtEWCV chmod 755 /root
Run command: podman exec ansible-test-controller-NdFtEWCV useradd pytest --create-home
Stream command: podman exec ansible-test-controller-NdFtEWCV /usr/bin/env ANSIBLE_TEST_CONTENT_ROOT=/root/ansible_collections/redhatci/ocp LC_ALL=en_US.UTF-8 /usr/bin/python3.11 /root/ansible/bin/ansible-test units --containe ...
Configured locale: en_US.UTF-8
Parsing container database.
Installing requirements for Python 3.11
Stream command with data: /usr/bin/python3.11
Execute command: /usr/bin/python3.11 /tmp/ansible-test-wzfmm7_y-pip.py install --disable-pip-version-check -r requirements/ansible.txt -r requirements/units.txt -c requirements/constraints.txt
Execute command: /usr/bin/python3.11 /tmp/ansible-test-wzfmm7_y-pip.py install --disable-pip-version-check -r tests/unit/requirements.txt -c requirements/constraints.txt
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0xffffbbd290d0>: Failed to establish a new connection: [Errno -2] Name or service not known')': /simple/junit-xml/
Collecting junit_xml (from -r tests/unit/requirements.txt (line 1))
  Downloading junit_xml-1.9-py2.py3-none-any.whl.metadata (3.2 kB)
Collecting semver (from -r tests/unit/requirements.txt (line 2))
  Downloading semver-3.0.2-py3-none-any.whl.metadata (5.0 kB)
Collecting six (from junit_xml->-r tests/unit/requirements.txt (line 1))
  Downloading six-1.17.0-py2.py3-none-any.whl.metadata (1.7 kB)
Downloading junit_xml-1.9-py2.py3-none-any.whl (7.1 kB)
Downloading semver-3.0.2-py3-none-any.whl (17 kB)
Downloading six-1.17.0-py2.py3-none-any.whl (11 kB)
Installing collected packages: six, semver, junit_xml
Successfully installed junit_xml-1.9 semver-3.0.2 six-1.17.0
Run command: /usr/bin/python3.11 /root/ansible/test/lib/ansible_test/_util/target/tools/yamlcheck.py
Run command: podman container inspect ansible-test-controller-NdFtEWCV
Run command: podman network disconnect podman ansible-test-controller-NdFtEWCV
Stream command: podman exec --user pytest ansible-test-controller-NdFtEWCV /usr/bin/env ANSIBLE_TEST_CONTENT_ROOT=/root/ansible_collections/redhatci/ocp LC_ALL=en_US.UTF-8 /usr/bin/python3.11 /root/ansible/bin/ansible-test un ...
Configured locale: en_US.UTF-8
Unit test controller with Python 3.11
Initializing "/tmp/ansible-test-5k7mraoi-injector" as the temporary injector directory.
Injecting "/tmp/python-j4vh9gme-ansible/python" as a execv wrapper for the "/usr/bin/python3.11" interpreter.
Stream command: pytest -r a -n auto --color yes -p no:cacheprovider -c /root/ansible/test/lib/ansible_test/_data/pytest/config/default.ini --junit-xml /root/ansible_collections/redhatci/ocp/tests/output/junit/python3.11-contr ...
============================= test session starts ==============================
platform linux -- Python 3.11.10, pytest-8.3.3, pluggy-1.5.0 -- /usr/bin/python3.11
rootdir: /root/ansible_collections/redhatci/ocp
configfile: ../../../ansible/test/lib/ansible_test/_data/pytest/config/default.ini
plugins: mock-3.14.0, xdist-3.6.1
created: 4/4 workers
4 workers [2 items]

scheduling tests via LoadScheduling

tests/unit/filter/test_ocp_compatibility.py::TestOcpCompatibility::test_filter_with_deprecated_api_in_non_empty_list
tests/unit/filter/test_ocp_compatibility.py::TestOcpCompatibility::test_filter_with_no_deprecated_api_with_empty_array
[gw1] [ 50%] PASSED tests/unit/filter/test_ocp_compatibility.py::TestOcpCompatibility::test_filter_with_no_deprecated_api_with_empty_array
[gw0] [100%] PASSED tests/unit/filter/test_ocp_compatibility.py::TestOcpCompatibility::test_filter_with_deprecated_api_in_non_empty_list

=============================== warnings summary ===============================
tests/unit/filter/test_ocp_compatibility.py::TestOcpCompatibility::test_filter_with_deprecated_api_in_non_empty_list
tests/unit/filter/test_ocp_compatibility.py::TestOcpCompatibility::test_filter_with_no_deprecated_api_with_empty_array
  /usr/local/lib/python3.11/dist-packages/junit_xml/__init__.py:268: DeprecationWarning: Testsuite.to_file is deprecated. It will be removed in version 2.0.0. Use function to_xml_report_file
    warnings.warn(

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
- generated xml file: /root/ansible_collections/redhatci/ocp/tests/output/junit/python3.11-controller-units.xml -
======================== 2 passed, 2 warnings in 0.19s =========================
Run command with stdout: podman exec --user pytest -i ansible-test-controller-NdFtEWCV sh -c 'tar cf - -C /root/ansible_collections/redhatci/ocp/tests --exclude .tmp output | gzip'
Run command with stdin: tar oxzf - -C /Users/makovgan/src/github.com/workspace/collections/ansible_collections/redhatci/ocp/tests
Run command: podman stop --time 0 ansible-test-controller-NdFtEWCV
Run command: podman rm ansible-test-controller-NdFtEWCV

- fixes redhatci#511 (fix test_ocp_compatibility)

Signed-off-by: Maxim Kovgan <[email protected]>
@mvk mvk requested a review from a team as a code owner January 16, 2025 09:34
@dcibot
Copy link
Collaborator

dcibot commented Jan 16, 2025

from change #532:

  • no check (not a code change)

1 similar comment
@dcibot
Copy link
Collaborator

dcibot commented Jan 16, 2025

from change #532:

  • no check (not a code change)

@mvk mvk added the bug Something isn't working label Jan 16, 2025
Copy link

Copy link
Contributor

@ramperher ramperher left a comment

Choose a reason for hiding this comment

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

Looks good to me but I'd like to hear @tkrishtop 's opinion on this, since she implemented the ocp_compatibility feature

@tkrishtop
Copy link
Contributor

We had a sync and agreed on adding timestamps into junit2dict filter.
This is to ease the ongoing migration to rhel9 by minimizing the number of places where junitparser will be used.
PR #532 will be also addressed out of the same bare-minimal change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants