-
Notifications
You must be signed in to change notification settings - Fork 74
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
Test case tweak #349
Test case tweak #349
Conversation
So that they describe the expected behavior better.
This now correctly handles cases where there was no failure in the action. When an action fails we save the initial state that went in. However, when an action succeeds, we would only store the final state for that action. So now, if the action was successful, we go back to the prior sequence ID to get its state as the input, and use the state from the action as the desired final state. This assumes you want to say "hey here's expected behavior, I want to enshrine it". Adjusts docs with new option.
114af10
to
9165661
Compare
The docs refactor missed fixing some links. This also throws in a regenerated state graph image too.
So demo data is only relevant for the local backend. It also should use the `burr_path` env variable if present. This is unclean because we leak encapsulation from the actual burr local backend...
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.
Looks good, some nits
base_dir = os.path.expanduser("~/.burr") | ||
if not no_copy_demo_data: | ||
|
||
if backend == "local" and not no_copy_demo_data: |
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.
Best to instantiate the settings module if we can -- that way it's more future-proof/solves your TODO
@@ -322,13 +333,19 @@ def import_from_file(file_path: str) -> ModuleType: | |||
required=False, | |||
help="Python file or fully qualified python module to import for custom serialization/deserialization.", | |||
) | |||
@click.option( |
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.
Why do we need to change this? A little unclear what this does -- worth adding a bit more docs
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.
it provides the name of the action to test for the test case.
enables you to use output from somewhere else as input for another action easily.
- state loaded would be the ending state, so to get the starting state, we need to look at the prior sequence ID | ||
""" | ||
if after_action["status"] == "completed": | ||
print("Action was successful so loading initial and expected state into test fixture.") |
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.
We should have logger.warn instead of print here as we use stdout.
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.
prints are used throughout here.
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.
We shouldn't -- it sometimes will/sometimes won't parse, and you'll be putting that to a file. You want to be able to pipe it.
|
||
# TODO -- make this configurable through an env variable | ||
To override the path, set a `burr_path` environment variable to the path you want to use. |
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.
Point out the settings class that corresponds to this
Clarifies test case creation behavior and adds ability to override the action name
Changes
How I tested this
Notes
Checklist