-
Notifications
You must be signed in to change notification settings - Fork 343
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
Requirements database [v2] #5418
Requirements database [v2] #5418
Conversation
538aaf7
to
a6b407c
Compare
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.
Hi @richtja,
Thanks for following up with this v2. This version looks pretty close to getting my ACK, but there are a small few things that need your attention.
It changes order of runtime tasks in dependency graph, in such way that pre-test task are depending on each other, which ensures serial run in state machine for pre-test tasks. It will solve problems with conflicts between different pre-test task runs. Signed-off-by: Jan Richter <[email protected]>
The runtime task has information about all its dependencies. Let's add a method which will list all of them which have been already finished. Signed-off-by: Jan Richter <[email protected]>
The RuntimeTask has all the information to about dependencies to make a decision if the dependencies were resolved, and it is possible to run a task. So let's move this responsibility to the RuntimeTask. Signed-off-by: Jan Richter <[email protected]>
This adds few methods for manipulating with requirements cache. This will be useful for spawners which will use requirements cache. Signed-off-by: Jan Richter <[email protected]>
This commit add ability to spawners to store requirements into cache. This will make more efficient running multiple tests with the same requirement or rerunning the jobs itself. This also brings ability to use requirements with podman spawner. So now is possible to run something like this: class SuccessTest(Test): def check_hello(self): result = process.run("hello", ignore_status=True) self.assertEqual(result.exit_status, 0) self.assertIn('Hello, world!', result.stdout_text,) def test_a(self): """ 🥑 dependency={"type": "package", "name": "hello"} """ self.check_hello() Warning: Right now, the requirement cache doesn't have any controls for clearing cache or updating, and also didn't check the current environment. So if the user do some changes to the environment outside Avocado runtime, like uninstalling package, podman prune, removing asset, etc. The tests with requirements will be broken. Reference: Signed-off-by: Jan Richter <[email protected]>
This will define the values for `RuntimeTask.status` so it will be easier to use them, and It will be easier to detect in which state the `RuntimeTask` is. Signed-off-by: Jan Richter <[email protected]>
a6b407c
to
6e689d2
Compare
Thanks @clebergnu for your comments, I resoled them with |
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.
Hi Jan, just one small suggestion. But again, good work, LGTM.
@abc.abstractmethod | ||
async def save_requirement_in_cache(runtime_task): | ||
"""Saves the information about requirement in cache before | ||
the runtime_task is 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.
Nitpick: PEP-257, oneline + empty line + description.
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.
I was about to change this, but then noticed all docstrings in that file are non-PEP-257 compliant. If you don't mind, let's defer that to a mass change/check effort.
failfast = 'FINISHED FAILFAST' | ||
fail_triage = 'FAILED ON TRIAGE' | ||
fail_start = 'FAILED ON START' | ||
started = 'STARTED' |
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.
Usually Enum constants are upper case.
Closing in favor of #5421 |
This PR adds the ability to spawners to store requirements into cache.
This will make more efficient running multiple tests with the same
requirement or rerunning the jobs itself.
This also brings ability to use requirements with podman spawner. So now
is possible to run something like this:
Warning: Right now, the requirement cache doesn't have any controls for
clearing cache or updating, and also didn't check the current
environment. So if the user do some changes to the environment outside
Avocado runtime, like uninstalling package, podman prune, removing
asset, etc. The tests with requirements will be broken.
Signed-off-by: Jan Richter [email protected]
Changes from v1 (#5412):
RuntimeTask
states.test_requirements.py
to avocadoTest
and usage of varianter.