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

Finish removing teuthology-worker #1960

Merged
merged 2 commits into from
Jul 25, 2024
Merged

Finish removing teuthology-worker #1960

merged 2 commits into from
Jul 25, 2024

Conversation

zmc
Copy link
Member

@zmc zmc commented Jun 25, 2024

The dispatcher and supervisor were added in #1546, but code was copied and pasted into the new modules, leaving the worker untouched. Also untouched were the unit tests, meaning that the dispatcher and supervisor were never unit tested. As the copied code changed, the dispatcher and supervisor were not being tested for regressions, while the worker - which wasn't being anymore - had passing unit tests, giving some false sense of security.

This commit removes the old worker code, and adapts the old worker tests to apply to the dispatcher and supervisor. It also splits out teuthology-supervisor into its own command.

@zmc zmc force-pushed the worker-supervisor branch 4 times, most recently from 13ca937 to c531ecb Compare June 25, 2024 21:43
@zmc zmc requested review from kamoltat and VallariAg June 27, 2024 17:23
@zmc
Copy link
Member Author

zmc commented Jun 27, 2024

@kamoltat @VallariAg I was mistaken when I mentioned a test regression in this PR; it's ready for review!

@kshtsk
Copy link
Contributor

kshtsk commented Jul 2, 2024

with docopt it looked nicer imho

@kshtsk
Copy link
Contributor

kshtsk commented Jul 2, 2024

the head of PR: "Finish removing teuthology-worker" does not reflect what is in this patch, in fact there is introducing teuthology-supervisor as separate tool, dropping worker may be probably in separate PR.
I don't know why do say worker unittests are not passing, when I run pytest against it and get 12 passed, 8 warnings in 0.67s

@kshtsk
Copy link
Contributor

kshtsk commented Jul 2, 2024

Why underscoring unit tests by the way? Following the logic, other modules also must have underscore suffixes?

@zmc
Copy link
Member Author

zmc commented Jul 24, 2024

@kshtsk I think you're ok with removing the worker at this point, is that the case? Also, responses to your earlier comments:

with docopt it looked nicer imho

It may, but it's less flexible and harder to maintain

the head of PR: "Finish removing teuthology-worker" does not reflect what is in this patch, in fact there is introducing teuthology-supervisor as separate tool, dropping worker may be probably in separate PR.

That bit is just adding the entry point; the tool has been in use for quite some time, sharing teuthology-dispatcher's entry point

I don't know why do say worker unittests are not passing, when I run pytest against it and get 12 passed, 8 warnings in 0.67s

I didn't claim the worker tests weren't passing, only that the dispatcher and supervisor were not being tested.

Why underscoring unit tests by the way? Following the logic, other modules also must have underscore suffixes?

Sorry I'm not sure what you're asking here
Edit: Oh, if you're referring to the filenames test_dispatcher_.py & test_supervisor_.py, it's so py.test sees them as different from the files in scripts/test/.

@kshtsk
Copy link
Contributor

kshtsk commented Jul 25, 2024

Why underscoring unit tests by the way? Following the logic, other modules also must have underscore suffixes?

Sorry I'm not sure what you're asking here
Edit: Oh, if you're referring to the filenames test_dispatcher_.py & test_supervisor_.py, it's so py.test sees them as different from the files in scripts/test/.

if you want to add test for the scripts, I suggest to use test_script_dispatcher.py and test_script_supervisor.py for them and test_dispatcher.py and test_supervisor.py leave for the modules, otherwise you're breaking name conventions.

@kshtsk
Copy link
Contributor

kshtsk commented Jul 25, 2024

with docopt it looked nicer imho

It may, but it's less flexible and harder to maintain

okay, that sounds reasonable, but then we need to refactor the other scripts too, in scheduled manner, probably someone would love to volunteer to do it

zmc added 2 commits July 24, 2024 18:26
The dispatcher and supervisor were added in #1546, but code was copied and
pasted into the new modules, leaving the worker untouched. Also untouched were
the unit tests, meaning that the dispatcher and supervisor were never unit
tested. As the copied code changed, the dispatcher and supervisor were not being
tested for regressions, while the worker - which wasn't being anymore - had
passing unit tests, giving some false sense of security.

This commit removes the old worker code, and adapts the old worker tests to
apply to the dispatcher and supervisor. It also splits out teuthology-supervisor
into its own command.

Signed-off-by: Zack Cerza <[email protected]>
The old dispatcher expects to be able to invoke the supervisor via
`teuthology-dispatcher --supervisor`, so add this compatibility shim for the
time being.

Signed-off-by: Zack Cerza <[email protected]>
@zmc zmc merged commit 53ce146 into main Jul 25, 2024
9 checks passed
@zmc zmc deleted the worker-supervisor branch July 25, 2024 18:06
zmc added a commit that referenced this pull request Jul 30, 2024
Originally, #1960 was intended to do this, but in some review back-and-forth the
commit removing the file was dropped. Let's actually remove the file.

Signed-off-by: Zack Cerza <[email protected]>
@zmc zmc mentioned this pull request Jul 30, 2024
zmc added a commit that referenced this pull request Jul 31, 2024
Originally, #1960 was intended to do this, but in some review back-and-forth the
commit removing the file was dropped. Let's actually remove the file.

Signed-off-by: Zack Cerza <[email protected]>
kshtsk pushed a commit to kshtsk/teuthology that referenced this pull request Aug 4, 2024
Originally, ceph#1960 was intended to do this, but in some review back-and-forth the
commit removing the file was dropped. Let's actually remove the file.

Signed-off-by: Zack Cerza <[email protected]>
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.

2 participants