-
Notifications
You must be signed in to change notification settings - Fork 9
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
use latest oras-py and fix get_tags bug #21
Conversation
Hmm, something is different now :) Maybe we need to clean the registry between tests? cc @vsoch maybe you have an idea. |
okay - so for the current error:
The previous test relied upon having all the tags, so if you just deleted them above, that result would be different. For these updates you'll either need to make a separate test for tags, or add to this test but update the quantities for the other tests. Perhaps oras-py should have a delete function for tags instead of trying to do it here? |
Yeah I have the feeling that right now the order of tests and state of the registry matters. Probably good to do a cleanup. I think it'd be great to move these functions to oras-py at some point but it'll be OK to have them here for the time being as well :) |
I'll probably run out of things to do by the end of today and want to at least get started on this! I think generally if there are some core set of things that people would want to do, it makes sense to provide them with our base oras-py client, given they are generic, etc. |
I am using fixtures with |
I really like it! I like having the mirror as a fixture too, it's a much more expected design than the "helpers." |
yay!! The linting burned you, but that is tiny details. Here is the output if you missed it:
|
|
||
@pytest.fixture | ||
def oci_registry(xprocess): | ||
class Starter(ProcessStarter): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh this is super cool! https://pytest-xprocess.readthedocs.io/en/latest/ I've never looked at this library before!
So this handles bringing the registry up/down for the specific test (in a process?) How does that relative to the GitHub action service? Do we need both of them?
If this is a general solution to (during testing) bring a service up/down, within testing, this will be hugely useful - I usually have some hackadoo way of doing it. 😆
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay - working on adding delete function to oras-py, and I'm also going to add the retry there. I realize I made an issue for it last year (and then promptly forgot about it, it seems!)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update: finished that, going to try updating the PR here with these functions oras-project/oras-py#73
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unfortunately we don't really need the function anymore since we remove / restart the entire registry now :D But I love that it made it's way into oras-py. Functions to delete_blob
would be a great addition as well, btw! :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And yes, xprocess starts a subprocess and checks if the service is up by running a regex against the output (pattern = r".*listening on \[::\]:5000.*"
). Once it sees the pattern in the output, the tests can be run.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Functions to delete_blob would be a great addition as well, btw! :)
Then it shall be done! oras-project/oras-py#74
And yes, xprocess starts a subprocess and checks if the service is up by running a regex against the output (pattern = r".listening on [::]:5000."). Once it sees the pattern in the output, the tests can be run.
Love that. I have a bunch of projects that would warrant this refactor, so I'll do them slowly over time. It's like a piece to a puzzle I was missing!
yeah, i finally fixed the linting on my side by upgrading to |
No description provided.