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

quincy: test/pybind: replace nose with pytest #55060

Merged
merged 5 commits into from
Jan 18, 2024

Conversation

cbodley
Copy link
Contributor

@cbodley cbodley commented Jan 4, 2024

backport tracker: https://tracker.ceph.com/issues/63937


backport of #52143
parent tracker: https://tracker.ceph.com/issues/61567

this backport was staged using ceph-backport.sh version 16.0.0.6848
find the latest version at https://github.com/ceph/ceph/blob/main/src/script/ceph-backport.sh

@cbodley cbodley requested review from a team as code owners January 4, 2024 18:54
@cbodley cbodley added this to the quincy milestone Jan 4, 2024
@cbodley cbodley added the pybind label Jan 4, 2024
@cbodley
Copy link
Contributor Author

cbodley commented Jan 4, 2024

there were several conflicts around filtering for the crimson-rados suite; hopefully i got everything right

Copy link
Contributor

@idryomov idryomov left a comment

Choose a reason for hiding this comment

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

there were several conflicts around filtering for the crimson-rados suite; hopefully i got everything right

I spotted some leftovers, mostly around markers. Otherwise LGTM!

qa/suites/crimson-rados/basic/tasks/rados_python.yaml Outdated Show resolved Hide resolved
qa/workunits/rbd/test_librbd_python.sh Outdated Show resolved Hide resolved
src/test/pybind/test_rbd.py Outdated Show resolved Hide resolved
src/test/pybind/test_rbd.py Outdated Show resolved Hide resolved
src/test/pybind/test_rados.py Outdated Show resolved Hide resolved
src/test/pybind/test_rados.py Outdated Show resolved Hide resolved
src/test/pybind/test_rados.py Outdated Show resolved Hide resolved
src/test/pybind/pytest.ini Outdated Show resolved Hide resolved
@ljflores
Copy link
Contributor

ljflores commented Jan 4, 2024

@cbodley let me know when this is ready to get into testing

@cbodley
Copy link
Contributor Author

cbodley commented Jan 5, 2024

thanks @idryomov, cleaned up the cherry-picks and documented the conflicts around markers

@idryomov
Copy link
Contributor

idryomov commented Jan 5, 2024

jenkins test make check

@idryomov
Copy link
Contributor

idryomov commented Jan 5, 2024

jenkins test api

@idryomov
Copy link
Contributor

idryomov commented Jan 5, 2024

@cbodley Backport looks great, but I noticed that wait marker used in RADOS tests is missing from pytest.ini in main. Is that intentional?

@cbodley
Copy link
Contributor Author

cbodley commented Jan 5, 2024

@cbodley Backport looks great, but I noticed that wait marker used in RADOS tests is missing from pytest.ini in main. Is that intentional?

not intentional, no

@ljflores
Copy link
Contributor

ljflores commented Jan 8, 2024

Waiting on this PR to go into testing / merge to unblock https://trello.com/c/Yjrx9ygD/1911-wip-yuri8-testing-2023-12-15-0911

@cbodley
Copy link
Contributor Author

cbodley commented Jan 10, 2024

seeing one failure from test_rbd.py, ex. http://qa-proxy.ceph.com/teuthology/yuriw-2024-01-09_20:56:52-rbd-quincy-distro-default-smithi/7510134/teuthology.log

=================================== FAILURES ===================================
_________________________ TestImage.test_diff_iterate __________________________

self = <test_rbd.TestImage object at 0x7fa827636dd8>

    def test_diff_iterate(self):
        check_diff(self.image, 0, IMG_SIZE, None, [])
        self.image.write(b'a' * 256, 0)
        check_diff(self.image, 0, IMG_SIZE, None, [(0, 256, True)])
        self.image.write(b'b' * 256, 256)
        check_diff(self.image, 0, IMG_SIZE, None, [(0, 512, True)])
        self.image.discard(128, 256)
        check_diff(self.image, 0, IMG_SIZE, None, [(0, 512, True)])

        self.image.create_snap('snap1')
        self.image.discard(0, 1 << IMG_ORDER)
        self.image.create_snap('snap2')
        self.image.set_snap('snap2')
>       check_diff(self.image, 0, IMG_SIZE, 'snap1', [(0, 512, False)])

../../../clone.client.0/src/test/pybind/test_rbd.py:1226:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../../../clone.client.0/src/test/pybind/test_rbd.py:1450: in check_diff
    eq(extents, expected)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

a = [], b = [(0, 512, False)]

    def assert_equal(a, b):
>       assert a == b
E       AssertionError

../../../clone.client.0/src/test/pybind/assertions.py:2: AssertionError

@idryomov any idea what might be happening there?

@idryomov
Copy link
Contributor

@cbodley See https://tracker.ceph.com/issues/63941. I have updated pacific branch in ceph-ci.git, it's possible that other named branched need to be pushed as well.

@idryomov
Copy link
Contributor

idryomov commented Jan 10, 2024

@cbodley Scratch the above, I see that it's a different test. The root cause is the same binaries vs test mismatch though.

I think you just need to rebase to pick up #54950 that landed in quincy in the interim.

* use fixtures for temporary images and groups
* use pytest.skip instead of nose.SkipTest
* replace setUp/tearDown with setup/teardown_method
* add @pytest.mark.skip_if_crimson
* replace nose assertions

Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit af04457)

Conflicts:
	qa/suites/crimson-rados/rbd/tasks/rbd_python_api_tests.yaml
		does not exist on quincy
	qa/suites/crimson-rados/rbd/tasks/rbd_python_api_tests_old_format.yaml
	qa/workunits/rbd/test_librbd_python.sh
	src/test/pybind/test_rbd.py
		skip_if_crimson filter not present on quincy
* use a fixture for setup_test()
* invoke test_cephfs.py with pytest

Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 0bd813f)

Conflicts:
	src/test/pybind/test_cephfs.py
		missing ceph#43546
		missing ceph#46905
* replace nose.Skiptest with pytest.skip()
* replace nose attrs with @pytest.mark
* replace nose assertions
* replace setUp/tearDown with setup/teardown_method

Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 0d0128f)

Conflicts:
	qa/suites/crimson-rados/basic/tasks/rados_python.yaml
	src/test/pybind/test_rados.py
		no rollback or wait markers, added snap marker
* use a fixture for setup_test()
* replace nose assertions

Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 136b3ec)
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit cbdd520)

Conflicts:
	qa/suites/crimson-rados/rbd/tasks/rbd_python_api_tests.yaml
		does not exist on quincy
@ljflores
Copy link
Contributor

jenkins test api

@idryomov idryomov modified the milestones: quincy, v17.2.8 Jan 17, 2024
@cbodley cbodley merged commit 7fa3524 into ceph:quincy Jan 18, 2024
10 checks passed
@cbodley cbodley deleted the wip-63937-quincy branch January 18, 2024 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants